More details on folder translator function

Thomas Kahle tomka at
Sat Jan 15 21:26:42 GMT 2011


On 09:47 Fri 14 Jan     , Philippe LeCavalier wrote:
> Hi. I hope you don't mind me cc'ing the list on this. I think it could
> useful.

Sure, actually I tend to forget that the offlineimap list is not
configured to hijack reply-to.

> After working with your guide for a day or so I think I may have a few
> 'misconceptions'. If I have this right...
> > import re
> > def oimaptransfolder_acc1(foldername):
> >     if(foldername == "INBOX"):
> >         retval = "acc1"
> this part is simply stating to olimap replace INBOX with acc1? When I
> change acc1 to what I want(an existing folder within my Maildir) it
> doesn't bring in mail from the INBOX on the IMAP server to the specified
> folder. There's a slight chance this might be an MUA issue since
> Evolution requires the user to point to the Maildir root and names that
> folder Inbox. But I would think that despite that offlineimap would
> still bring the mail into that folder nonetheless and I would see it.

Remotely it looks like this


locally it looks like this:


Since the dot is not a folder separator, everything lives in the same
level of the directory tree.  If evolution wants the maildir root to be
INBOX, then the other folders have to go to subdirectories and you
actually have to put in slashs, right.

> >     else:
> >         retval = "acc1." + foldername
> this part tells it that for every subfolder of acc1 add a prefix of
> 'acc1.'
> >     retval = re.sub("/", ".", retval)
> and this is for swapping Cyrus separator from / to . ?
> In my case I'm using Evo so if the above is correct I would need to do
> the exact opposite because Evo want a forward slash as the separator.
> What's confusing me in this case is that my mail is being pulled from a
> Courier server and the other account is on Cyrus so I think I might need
> to state this separately maybe?

You are right about Evolution, but I don't really get the rest of the
question.  You should try to identify what's the argument of the
function and then adjust the function appropriately.  In my case the
function is called with either


If folder1 had a subfolder called folder1a then the function would be
called with 'folder1/folder1a' and the replacement flattens the
directory structure.

I hope this makes sense.


> >     return retval
> > 
> > 
> > 
> > I hope this helps a little, I have quickly copied it from my guide on
> > offlineimap, mutt, etc. to be found here:
> > 
> >
> > 
> > Cheers,
> > Thomas
> I'm confused about how your storing the mail in your maildir. In the
> guide you show the folder structure as follows:
> ~/Mail
>   -> acc1
>     -> acc1 
>     -> acc1.folder1
>     -> acc1.folder2
>     ...
>   -> acc2
>     -> acc2 
>     -> acc2.folder1
>     -> acc2.folder2
>   -> mairix-search
> However in your olimap setup for your local repo you have the mail stored in the same folder as follows:
> [Repository acc1local]
> type = Maildir
> localfolders = ~/Mail/acc2
> [Repository acc2local]
> type = Maildir
> localfolders = ~/Mail/acc2
> Is acc2local suppose to read ~/Mail/acc1 by any chance? Or is it because mutt can make separate folders appear in the same hierarchy...I don't understand.
> Thanks,
> Phil

Thomas Kahle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 316 bytes
Desc: not available
URL: <>

More information about the OfflineIMAP-project mailing list