Maildir relative paths change was not complete
Commit e023f190b0
changed the storing of
file paths in the messagelist variable to be relative paths, but we were
using the full absolute path anyway as we missed one spot.
Adapt this and construct the full file path in the one place where we
need it.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
6295d64d54
commit
9ecac29aaa
@ -133,7 +133,7 @@ class MaildirFolder(BaseFolder):
|
|||||||
folderstr = ',FMD5=' + foldermd5
|
folderstr = ',FMD5=' + foldermd5
|
||||||
for dirannex in ['new', 'cur']:
|
for dirannex in ['new', 'cur']:
|
||||||
fulldirname = os.path.join(self.getfullname(), dirannex)
|
fulldirname = os.path.join(self.getfullname(), dirannex)
|
||||||
files.extend(os.path.join(fulldirname, filename) for
|
files.extend(os.path.join(dirannex, filename) for
|
||||||
filename in os.listdir(fulldirname))
|
filename in os.listdir(fulldirname))
|
||||||
for file in files:
|
for file in files:
|
||||||
messagename = os.path.basename(file)
|
messagename = os.path.basename(file)
|
||||||
@ -151,10 +151,9 @@ class MaildirFolder(BaseFolder):
|
|||||||
|
|
||||||
#Check and see if the message is too big if the maxsize for this account is set
|
#Check and see if the message is too big if the maxsize for this account is set
|
||||||
if(maxsize != -1):
|
if(maxsize != -1):
|
||||||
filesize = os.path.getsize(file)
|
size = os.path.getsize(os.path.join(self.getfullname(), file))
|
||||||
if(filesize > maxsize):
|
if(size > maxsize):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
foldermatch = messagename.find(folderstr) != -1
|
foldermatch = messagename.find(folderstr) != -1
|
||||||
if not foldermatch:
|
if not foldermatch:
|
||||||
@ -177,6 +176,7 @@ class MaildirFolder(BaseFolder):
|
|||||||
flags = set(flagmatch.group(1))
|
flags = set(flagmatch.group(1))
|
||||||
else:
|
else:
|
||||||
flags = set()
|
flags = set()
|
||||||
|
# 'filename' is 'dirannex/filename', e.g. cur/123_U=1_FMD5=1:2,S
|
||||||
retval[uid] = {'uid': uid,
|
retval[uid] = {'uid': uid,
|
||||||
'flags': flags,
|
'flags': flags,
|
||||||
'filename': file}
|
'filename': file}
|
||||||
|
Loading…
Reference in New Issue
Block a user