[ANNOUNCE] OfflineIMAP v6.4.0

Sebastian Spaeth Sebastian at SSpaeth.de
Fri Sep 30 07:44:37 BST 2011


On Thu, 29 Sep 2011 20:31:28 +0300, Daniel Shahaf <d.s at daniel.shahaf.name> wrote:

> On the other hand, in an account that does use nametrans, I didn't add
> any new nametrans's to the config, and I don't see any warning or error.
> Is that expected?  Will there be any ill effects, other than perhaps not
> creating folders on the remote side?

That is a good question, and I have appended the documentation right
*after* the release to include more information on nametrans rules when
and where they are needed:
https://github.com/spaetz/offlineimap/commit/3f7749016f0794a36b6df51189e21a2cce495dd3

The short answer is: If you never intend to create new folders on the
LOCAL repository that need to be synced to the REMOTE repository, it is
sufficient to create a nametrans rule on the remote Repository section.

The relevant bits from the MANUAL are:

Where to put nametrans rules, on the remote and/or local repository?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

If you never intend to create new folders on the LOCAL repository that
need to be synced to the REMOTE repository, it is sufficient to create a
nametrans rule on the remote Repository section. This will be used to
determine the names of new folder names on the LOCAL repository, and to
match existing folders that correspond.

*IF* you create folders on the local repository, that are supposed to be
 automatically created on the remote repository, you will need to create
 a nametrans rule that provides the reverse name translation.

(A nametrans rule provides only a one-way translation of names and in
order to know which names folders on the LOCAL side would have on the
REMOTE side, you need to specify the reverse nametrans rule on the local
repository)

OfflineImap will complain if it needs to create a new folder on the
remote side and a back-and-forth nametrans-lation does not yield the
original foldername (as that could potentially lead to infinite folder
creation cycles).

What folder separators do I need to use in nametrans rules?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

**Q:** If I sync from an IMAP server with folder separator '/' to a
  Maildir using the default folder separator '.' which do I need to use
  in nametrans rules?::

  nametrans = lambda f: "INBOX/" + f
or::
  nametrans = lambda f: "INBOX." + f

**A:** Generally use the folder separator as defined in the repository
  you write the nametrans rule for. That is, use '/' in the above
  case. We will pass in the untranslated name of the IMAP folder as
  parameter (here `f`). The translated name will ultimately have all
  folder separators be replaced with the destination repositories'
  folder separator.

So if ̀f` was "Sent", the first nametrans yields the translated name
"INBOX/Sent" to be used on the other side. As that repository uses the
folder separator '.' rather than '/', the ultimate name to be used will
be "INBOX.Sent".

(As a final note, the smart will see that both variants of the above
nametrans rule would have worked identically in this case)
-------------- 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/20110930/4c76eda9/attachment-0001.sig>


More information about the OfflineIMAP-project mailing list