More details on folder translator function

Sebastian Spaeth Sebastian at SSpaeth.de
Thu Jan 13 10:21:03 GMT 2011


On Thu, 13 Jan 2011 08:51:22 +0100, Thomas Kahle <tomka at gentoo.org> wrote:
> pythonfile=~/bin/offlineimap-helpers.py
> 
> Then some account might look like this
> 
> [Repository acc1remote]
> type = IMAP
> remotehost = imap.acc1.com
> remoteusereval = get_username("imap.acc1.net")
> remotepasseval = get_password("imap.acc1.net")
> nametrans = oimaptransfolder_acc1
> ssl = yes
> 
> Note how nametrans is set to a function in the python file which looks
> like this:
> 
> import re
> def oimaptransfolder_acc1(foldername):
>     if(foldername == "INBOX"):
>         retval = "acc1"
>     else:
>         retval = "acc1." + foldername
>     retval = re.sub("/", ".", retval)
>     return retval

Nice, it would make sense to copy these useful bits into a "exemplary
set ups" of "configuration examples" or "use cases" document IMHO.

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/20110113/6f82eeb0/attachment-0001.sig>


More information about the OfflineIMAP-project mailing list