From 9ecac29aaa6d17d4fd5561c993e5ec8ca4a1f6f4 Mon Sep 17 00:00:00 2001 From: Vladimir Marek Date: Mon, 22 Aug 2011 11:09:07 +0200 Subject: [PATCH] Maildir relative paths change was not complete Commit e023f190b0eed84fefc10e28bfe5e4e0467ff257 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 Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/Maildir.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/offlineimap/folder/Maildir.py b/offlineimap/folder/Maildir.py index f72f4ea..cedcb5d 100644 --- a/offlineimap/folder/Maildir.py +++ b/offlineimap/folder/Maildir.py @@ -133,7 +133,7 @@ class MaildirFolder(BaseFolder): folderstr = ',FMD5=' + foldermd5 for dirannex in ['new', 'cur']: 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)) for file in files: 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 if(maxsize != -1): - filesize = os.path.getsize(file) - if(filesize > maxsize): + size = os.path.getsize(os.path.join(self.getfullname(), file)) + if(size > maxsize): continue - foldermatch = messagename.find(folderstr) != -1 if not foldermatch: @@ -177,6 +176,7 @@ class MaildirFolder(BaseFolder): flags = set(flagmatch.group(1)) else: flags = set() + # 'filename' is 'dirannex/filename', e.g. cur/123_U=1_FMD5=1:2,S retval[uid] = {'uid': uid, 'flags': flags, 'filename': file}