Locally created mailboxes not synchronized to IMAP
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
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)
> 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:
More reasons to have a comprehensive test suite that tests a wide range
of configuration situations.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: not available
More information about the OfflineIMAP-project