How to Import Mail Messages and Sieve Filters?

I have a decade old server that I want to retire, moving all of the messages to NS. The old server has about twenty users with anywhere from 3 to 40GB each, of e-mail, and some of the sieve scripts are truly impressive in their complexity.
Using webtop to add the sieves would take forever, and errors are sure to creep in. I copied my script over to NS, and overwrote;
/var/lib/nethserver/vmail/user@example.com/.dovecot.sieve
but alas, webtop doesn’t seem to read this file (which would give my users the ability to simply maintain their scripts).
My first question: Is there a fairly simply mechanism to import sieve scripts?

Back to that 2.8TB of mail; I set up the pop3-connector, pointed it at the old server, and gave it my imap login credentials, it pulled in my Inbox beautifully… I had hoped it would mirror the imap structure of the old server.
My second question: Is there a fairly simple mechanism to import all of the sub-folders as well as the inbox?

My third question: Is there a simple mechanism to import about 300 e-mail aliases from my old /etc/aliases?

Thank you!

Steve - aka - Linux_Monger

For the 1st and 2nd question, if the origin server uses Maildir format (was it dovecot, too?) the best strategy is rsync IMO. Otherwise theres imapsync tool somewhere… But I don’t know if it supports sieve protocol, too. POP3 does not see subfolders: no way for it!

3rd question - a shell script can do the job: both source and destination files are plain text files.

Where is the aliases file in NS? I added a few through the Management / Email Addresses / Aliases, but they didn’t appear in /etc/aliases, though I can see that /etc/aliases.db was rebuilt when I added the the aliases through the web interface.

As for the sieve scripts, I added Roundcube, where the scripts show up and are editable, but webtop doesn’t see any changes I make - that’s okay, I like roundcube better.

Thank you!

Please refer to

http://docs.nethserver.org/projects/nethserver-devel/en/v7/nethserver-mail-server.html#accounts-database

And

http://docs.nethserver.org/projects/nethserver-devel/en/v7/databases.html

So, after perusing much documentation, I found the perfect command, in the nethserver-sssd section;
/usr/share/doc/nethserver-sssd-1.1.9/scripts/import_emails Addresses.csv ','
where Addresses.csv contains;

NethUser1,user1@example.com
NethUser2,user2@example.com
NethUser1,extra-address@example.com
NethUser2,another-address@example.com
NethUser1,john.doe@example.com
NethUser2,jane.doe@example.com
NethUser1,secretxyzzy@example.com

3 Likes