More details on folder translator function

Thomas Kahle tomka at gentoo.org
Wed Jan 19 08:23:10 GMT 2011


Hi,

On 10:58 Tue 18 Jan     , Philippe LeCavalier wrote:
> On Sat, 2011-01-15 at 22:26 +0100, Thomas Kahle wrote:
> > Hi,
> > 
> > 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
> > 
> > INBOX 
> > folder1 
> > folder2
> > 
> > locally it looks like this:
> > 
> > acc1
> > acc1.folder1
> > acc1.folder2
> Oh! I see. So you're not doing what I thought you were. Although, I
> think I can still work off of your example. I'm pulling from two
> separate IAMP servers to my IMAP server and then syncing to maildir. For
> starters I'm only pulling from one to the other to keep it as simple as
> possible. SO what I need to figure out is:
> 
> srcIMAP1 (cyrus IMAP)
> INBOX
> folder1
> folder2
> 
> srcIMAP2 (cyrus IMAP)
> INBOX
> folder3
> folder4
> 
> destIMAP (me, courier IMAP)
> INBOX
> client1
> client1.INBOX
> client1.INBOX.folder1
> client1.INBOX.folder2
> client2
> client2.INBOX
> client2.INBOX.folder3
> client2.INBOX.folder4
> many
> many.other
> many.other.folders
> 
> > 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
> In your case my question no longer makes sense(I think) since the dots
> and slashes aren't acting as separators. 
> > 
> > INBOX 
> > or
> > folder1
> > or 
> > folder2
> > 
> > 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.
> I think so...your saying it would translate to: folder1.folder1a

Yes it would.  The folder translator function is really easy.  Takes a
folder name, gives a folder name, transparently (i.e. bi-directionally).
Just make sure that no two accounts ever use the same directory
somewhere.

Cheers, Thomas



> 
> Thanks,
> Phil
> 
> > Cheers,
> > Thomas
> > 
> > > 
> > > >     return retval
> > > > 
> > > > 
> > > > 
> > > > I hope this helps a little, I have quickly copied it from my guide on
> > > > offlineimap, mutt, etc. to be found here:
> > > > 
> > > > http://dev.gentoo.org/~tomka/mail.html
> > > > 
> > > > 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
http://dev.gentoo.org/~tomka/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 316 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20110119/88be292b/attachment-0001.sig>


More information about the OfflineIMAP-project mailing list