OfflineIMAP 6.5.5 is out

Giuseppe Attardi attardi at di.unipi.it
Sat Oct 5 17:16:36 UTC 2013


It seems you did not incorporate the fix I submitted on 7/17/2013.

It addresses mapping between folder names that use Unicode character.
This was necessary in particular to deal with Exhange migration where 
folders may contain dots.

I decided to adopt the solution to convert '.' to Unicode MIDDLE /DOT/' 
(U+00B7), which looks similar.
I wrote nametrans functions that encode the names in mUTF-7, as used by 
IMAP.

The nametrans and the separator replacement are not commutative 
operations, hence they must be performed in inverse order depending on 
the direction.
More precisely, one must do first nametrans and then replace on the 
source repository, for example:

# Transform, replace:
     a/b.c -> a/b&ALc-c -> a.b&ALc-c

while replace and then nametrans in the reverse direction:

# Replace, transform:
     a.b&ALc-c -> a/b&ALc-c -> a/b.c

This requires the following change to sync_folder_structure(), in Base.py:

         src_hash = {}
         for folder in src_folders:
             # Transform, replace:
             # a/b.c -> a/b&ALc-c -> a.b&ALc-c
             src_hash[folder.getvisiblename().replace(
                     src_repo.getsep(), dst_repo.getsep())] = folder
         dst_hash = {}
         for folder in dst_folders:
             # Replace, transform:
             # a.b&ALc-c -> a/b&ALc-c -> a/b.c
             src_name = folder.name.replace(
                 dst_repo.getsep(), src_repo.getsep())
             src_name = folder.repository.nametrans(src_name)
             dst_hash[src_name] = folder

Note that this entails that all transformations be done in the space of 
the source repository.
The documentation page http://docs.offlineimap.org/en/latest/nametrans.html
says that the mapping should use the separator of the repository, 
without specifying which.
It should always read the source repository for both the direct and 
reverse nametrans.

Let me know if you need further explanations.

Thank you

Giuseppe Attardi
Università di Pisa

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/offlineimap-project/attachments/20131005/e041763e/attachment.html>


More information about the OfflineIMAP-project mailing list