nametrans not working as expected

Florian Lindner mailinglists at xgm.de
Wed Aug 21 13:45:55 BST 2013


Am Mittwoch, 21. August 2013, 12:03:01 schrieb Florian Lindner:
> Am Mittwoch, 21. August 2013, 00:25:30 schrieb Tomasz ┼╗ok:
> > Hi Florian,
> > 
> > my (working) gmail nametranses contain a slash, not a dot between
> > '[Gmail]'
> > and folder name part. Use '[Gmail]/Gesendet' and it should work fine.
> 
> Yeah, it works!
> 
> > Also, as a side note, the folder names look strange if they contain
> > unicode
> > characters. In polish gmail I need to use the following in my nametrans
> > '[Gmail]/Wys&AUI-ane', where the whole '&AUI-' part inside of the word is
> > a single polish letter. So probably you should take special care for
> > german
> > umlauts if you continue to develop further nametrans functions.
> 
> Ok.
> 
> > Btw. Is there a special reason to access gmail through IMAP remote account
> > type and not the builtin Gmail type?
> 
> Oh, didn't know there were such an accound type. Got my documentation from a
> third party site (Arch Wiki) and from the config file. Changed to Gmail
> type now.
> 
> One more questions:
> 
> The local target maildir is mdir. Mail from the remote inbox is copied to
> mdir/.INBOX/cur/  (dot comes from my nametrans) while it really should go to
> mdir/cur/  How can I achieve that?

Ok, seems to work by replacing INBOX with a dot, like that:

nametrans = lambda foldername: ("." + foldername).replace(
                                "INBOX", "").replace(
                                "[Gmail]/Gesendet", "Sent").replace(
                                "[Gmail]/Papierkorb", "Trash").replace(
                                "[Gmail]/Entw&APw-rfe", "Drafts").replace(
                                "[Gmail]/Spam", "Spam").replace(
                                "[Gmail]/Alle Nachrichten", "Archiv")


> 
> > Best regards,
> > Tomasz
> 
> Thanks!
> Florian
> 
> > On 2013-08-20 at 13:17, Florian Lindner wrote:
> > > Hello,
> > > 
> > > I have this .offlineimaprc
> > > 
> > > [general]
> > > accounts = florian
> > > 
> > > [Account florian]
> > > localrepository = FloLocal
> > > remoterepository = FloRemote
> > > 
> > > [Repository FloLocal]
> > > type = Maildir
> > > localfolders = ~/Mail/foo at xgm.de
> > > 
> > > [Repository FloRemote]
> > > type = IMAP
> > > ssl = yes
> > > readonly = yes
> > > remotehost = imap.gmail.com
> > > remoteuser = foo at xgm.de
> > > remotepass = 123
> > > nametrans = lambda foldername: ("." + foldername).replace(
> > > 
> > >                                "[Gmail].Gesendet", "Sent")
> > > 
> > > Remote it a german gmail account.
> > > 
> > > The nametrans should replace "[Gmail].Gesendet" to ".Sent". It works
> > > fine
> > > 
> > > with a python shell:
> > > >>> a = lambda foldername: ("." + foldername).replace(
> > > 
> > > ...                                 "[Gmail].Gesendet", "Sent")
> > > 
> > > >>> a("[Gmail].Gesendet")
> > > 
> > > '.Sent'
> > > 
> > > But shows no effect when used in the configuration file. There is no
> > > .Sent
> > > folder but still  [Gmail].Gesendet
> > > 
> > > What's wrong?
> > > 
> > > Thanks,
> > > Florian
> > > 
> > > _______________________________________________
> > > OfflineIMAP-project mailing list
> > > OfflineIMAP-project at lists.alioth.debian.org
> > > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/offlineimap-proj
> > > ec
> > > t
> > > 
> > > OfflineIMAP homepage: http://software.complete.org/offlineimap
> 
> _______________________________________________
> OfflineIMAP-project mailing list
> OfflineIMAP-project at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/offlineimap-project
> 
> OfflineIMAP homepage: http://software.complete.org/offlineimap





More information about the OfflineIMAP-project mailing list