Sync -> Mails there. Sync -> mails gone
mail at beyermatthias.de
Thu Jan 29 10:53:55 GMT 2015
Sorry guys, but the more I get into it, the more I get confused:
I managed to outsource the python code which does the nametrans. No
I also inserted debug messages (simple print() calls), and it actually
prints _all_ my folders, like the folderfilter wouldn't apply _at
Here's my python code:
# Translate the local folder name to the remote folder name:
# hfu.INBOX -> INBOX
# hfu.foo -> INBOX.foo
if (name == "hfu.INBOX"):
ret = "INBOX"
ret = "INBOX." + re.sub('^hfu\.', '', name)
print("Translated local->remote: '" + name + "' to '" + ret + "'")
# Translate the remote folder name to the local folder name:
# INBOX -> hfu.INBOX
# foo -> hfu.foo
ret = "hfu." + re.sub('^INBOX\.', '', name)
print("Translated remote->local: '" + name + "' to '" + ret + "'")
the hfu_local_folderfilter() should tell offlineimap that it should
only sync folders which start with my prefix, which is "hfu.". My
Maildir structure looks like this:
hfu.INBOX # Inbox for account "hfu"
inbox # Inbox for main account
I hope someone can help me with this, as this is my test-run for
offlineimap. After I configured it properly, I will use all my mail
accounts with it (using getmail with POP by now on the other accounts,
as the main account mentioned above).
Sorry for bothering you guys...
On 29-01-2015 11:20:13, Matthias Beyer wrote:
> I found the issue, but I don't know how to solve it:
> My nametrans renames the folders as requested, BUT the "INBOX" folder
> gets renamed to "localPREFIX.INBOX" (which is fine) when syncing
> remote->local. But on syncing local to remote, it gets renamed
> "INBOX.INBOX", which is obviousely wrong.
> The problem is, that I don't know how to solve this issue properly.
> Doing an if-else in the nametrans results in syntax errors, I don't
> know how much python this thing understands, so I tried solving it
> with regex only, but ... well, I can't get it working.
> Maybe you guys can?
> On 29-01-2015 10:44:49, Matthias Beyer wrote:
> > [Repository LocalFoo]
> > ...
> > nametrans = lambda foldername = "INBOX." + re.sub('^localPREFIX\.', '', foldername)
> > folderfilter = lambda foldername = foldername.startswith('localPREFIX.')
> > [Repository RemoteFoo]
> > ...
> > nametrans = lambda foldername = "localPREFIX." + re.sub('^INBOX\.', '', foldername)
> Mit freundlichen Grüßen,
> Kind regards,
> Matthias Beyer
> Proudly sent with mutt.
> Happily signed with gnupg.
Mit freundlichen Grüßen,
Proudly sent with mutt.
Happily signed with gnupg.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 819 bytes
Desc: not available
More information about the OfflineIMAP-project