<DKIM> Mapping INBOX to a folder

Nicolas Sebrecht nicolas.s-dev at laposte.net
Fri Feb 16 22:46:44 GMT 2018


On Fri, Feb 16, 2018 at 08:46:50PM +0100, Friedemann Schorer wrote:
>    Hi all!
>    I'd like to have OfflineIMAP file all my mails from one IMAP accounts
>    INBOX to a pre-existing folder in a different IMAP account.
>    My offlineimaprc already allows to access both IMAP accounts and the
>    correct folders (INBOX and Job/Kliinik/) get selected (according to a
>    'offlineimap --info ' output). But I'm not familiar with the nametrans
>    syntax and failed to sourt it out for > 2h now.
>    Would anyone be so kind to help me out?

Sure!

First, make sure to read this page entirely:

  http://www.offlineimap.org/doc/nametrans.html

Then, train yourself in a python shell:

> python2
Python 2.7.14 (default, Jan 28 2018, 14:32:44) 
[GCC 6.4.0] on linux2
>>> import re
>>> nametrans_test = lambda folder: re.sub('^origin_name$', 'destination_name', folder)
>>> nametrans_test('origin_name')
'destination_name'
>>> nametrans_test('another_name')
'another_name'
>>> nametrans_reverse = lambda folder: re.sub('^destination_name$', 'origin_name', folder)
>>> nametrans_reverse('destination_name')
'origin_name'
>>> nametrans_reverse('got_it')
'got_it'
>>>

Let us know if you have more specific questions.

Good luck! ,-)

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list