Locally created mailboxes not synchronized to IMAP

Sebastian Spaeth Sebastian at SSpaeth.de
Tue Aug 16 10:25:26 BST 2011


On Tue, 16 Aug 2011 08:47:42 +0200, Vladimir Marek <Vladimir.Marek at Oracle.COM> wrote:
> Would you know how to reproduce that?

See below. Summary: I see 2 things that could be improved a) allow empty
foldernames through nametrans and b) allow Maildirs to start with '/'.
 
You are trying to map this with 
re.sub('^outside/?', '', foldername)?

1) If all of your mails are in the outside folder you might be better
served by simply setting "reference=outside" and be done with it :-)

2) This nametrans will lead to an empty folder "" by translating
"outside" to "". Empty folder names will work. Empty foldernames ('')
create problems when creating the LocalStatus() folder ''. This could
probably be fixed in folder/Base.py:getfolderbasename() which could
test for empty folder names and use a special file name.

You will need something like '/' for the highest folder, I guess. But
this seems to interfere with the rule that no Maildir folder may start
with '/' when you use Maildir.sep=/.

>  * re.sub('^outside/', '', foldername)
> That creates
> maildir/inside
> maildir/outside

Yes, this looks like a good solution, although not the one you were
looking for :). It works as you never have empty folder names.
 
>  * re.sub('^outside/?', '.', foldername)
> maildir/new
> maildir/cur
> maildir/cur/U=1,FMD5=5058f1af8388633f609cadb75a75dc9d:2,S
> maildir/tmp
> maildir/.inside
> maildir/.inside/tmp
> maildir/.inside/cur
> maildir/.inside/new
> maildir/.inside/new/U=5,FMD5=73ee1943692f76db315f5374b153650b:2,
> ....
>   File "/builds/vm156888/offlineimap/offlineimap/repository/Maildir.py", line 85, in makefolder                                                                                   
>     assert not foldername.startswith('/'), "Folder names may not begin with /"                                                                                                    
> AssertionError: Folder names may not begin with /  

Interesting why you would have a folder name here that starts with
'/'. Can you debug print the folder name it attempts to create here?
Is it the remote folder '/' ?

In any case, this one seems something that can be improved!
I am not sure why we shouldn't allow Maildir folder names starting with
'/'. This is an old check and I am sure we can deal with that
somehow. We will get into this situation only if:
Maildir.sep=/ and foldername is '/*'. What would happen if we simply
stripped any leading '/' from Maildir foldernames?

'/' would become '' and would be represented by the folders:
 maildir/cur
 maildir/new

More reasons to have a comprehensive test suite that tests a wide range
of configuration situations.

Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20110816/6fabd32f/attachment-0001.sig>


More information about the OfflineIMAP-project mailing list