Syncing Back Locally Created Folders -- Pointers on implementation?

Sebastian Spaeth Sebastian at SSpaeth.de
Thu May 5 00:35:23 UTC 2011


On Wed, 04 May 2011 17:02:22 -0700, creole.sleepr at gmail.com wrote:
> I have been looking around the internet and this list for quite some
> time, and I can't seem to figure out why this feature (a folder is
> created locally, offlineimap detects this and then creates the folder
> with those contents on the IMAP server).

Hi, so it was you in the IRC channel? I always tried to ping you right
after you had left :-).

Let me explain what I believe is the biggest difficulty (note that I had
no part in any initial design of this thing):

The problems is with the "folderfilter" and "nametrans" options. Those
options make it possible to suppress folders (so only a few are synced)
and to transpose names from the remote IMAP server to the local
repository.

a) folderfilter: If I mask folders on the REMOTE IMAP, offlineimap
currently treats them as non-existent. So when those folders are on the
LOCAL side, we would then try to create the folder and sync mails
there. E.g. I mask out all my email archives from before 2011 but they
exist on both the REMOTE and the LOCAL side. It's a complication, but
it's solvable (check if the remote folder exists and don't create it
doesn't.

b) nametrans: With the nametrans function you can transpose a folder
name on REMOTE IMAP to the LOCAL repository. So what happens when you
create a local filter? What name should it get on the REMOTE side? The
nametrans function is like a hash function, it works one-way only. So
you would need to start handing it nametrans functions for both ways
(and write the documentation so users get it).

> I am willing to implement this feature, 
Hurray! 
> because sorting emails into
> folders is an essential component of my email workflow with mutt. The
> lack of this feature is blocking my adoption of offlineimap, which
> otherwise looks like a fantastic package. Would the feature be very hard
> to implement?
 
> Any pointers on where to get started?

accounts.py calls remoterepository.syncfolders(...) which does the
folder creation on the local side.

The implementation is in repository.Base.py:

    def syncfoldersto(self, dest, copyfolders): 

Have a look and feel free to ask questions.

Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/offlineimap-project/attachments/20110505/6a6f74e7/attachment.pgp>


More information about the OfflineIMAP-project mailing list