nametrans to add a dot in the beginning of the foldername
Rainer M Krug
Rainer at krugs.de
Fri Oct 3 11:51:43 BST 2014
Niklaas Baudet von Gersdorff <niklaas at kulturflatrate.net> writes:
> Aaron Schrab <aaron <at> schrab.com> writes:
>
>> ######## From .offlineimaprc
>> [general]
>> pythonfile = ~/.offlineimap.py
>>
>> [Repository atsRemote]
>> nametrans = imap_nametrans_qqx
>>
>> ######## .offlineimap.py
>> def imap_nametrans_qqx( foldername ):
>> if foldername == 'INBOX':
>> return '.'
>> else:
>> return '.' + foldername
>
> Because I also want to achieve that every folder is saved with a dot at the
I am doing something similar, only that I add a prefix for each
account. So for my gmail, I have the following:
,----
| [Repository RemoteRMKrugGMAIL]
| type = Gmail
| ...
| # Add RMKrugGMAIL prefix when copying to local
| nametrans = lambda foldername: 'RMKrugGMAIL.' + foldername
| ...
|
| [Repository LocalRMKrugGMAIL]
| type = IMAP
| ...
| ######
| ## Remove RMKrugGMAIL prefix when copying to remote
| nametrans = lambda folder: re.sub('^RMKrugGMAIL.', '', folder)
| ######
| ## Only copy folders if they start with RMKrugGMAIL
| ## Other folders are ignored and are only local.
| folderfilter = lambda folder: folder.startswith('RMKrugGMAIL')
| # folderfilter = lambda foldername: foldername not in ['notmuch']
| ######
`----
Hope this helps,
Rainer
> beginning, I am using the same configuration. Unfortunately, newly created
> folders are not uploaded to the server. On the following page
>
>
> http://docs.offlineimap.org/en/latest/nametrans.html#where-to-put-nametrans-rules-on-the-remote-and-or-local-repository
>
> it is said that it is also important to have a nametrans for uploading.
> Otherwise offlineimap would not upload newly created folder. Hence, I added
> the following lines
>
> def dovecot_nametrans_local ( foldername ):
> if foldername == '.' :
> return 'INBOX'
> else :
> return foldername
>
> and also added
>
> nametrans = dovecot_nametrans_local
>
> under the definition of my local repository. Nevertheless, a newly created
> folder is not uploaded.
>
> Does anybody know how to solve this issue? Any help is appreciated.
>
>
>
> _______________________________________________
> 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
>
--
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 494 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20141003/f6a4db77/attachment-0003.sig>
More information about the OfflineIMAP-project
mailing list