Nethserver 8 Email Storage Location

Hi Brad,

If you want to avoid NS7 reinstall + NS8 migration, you’ve to explore a new path!

To import existing mails I can just give you some commands, but finding the missing pieces is up to you.

I assume the Mail module is new, already configured, but no message received yet.

Get the absolute volume path with this command.

 VMAIL_PATH=$(runagent -m mail1 podman volume inspect dovecot-data --format '{{.Mountpoint}}')
 echo $VMAIL_PATH

Copy/Move /var/lib/nethserver/vmail contents of NS7 to that path.

:warning: As said many times, fixing the ownership to the correct value is a real challenge in the containers world and for this reason absolute path operations must be avoided.

The VMAIL_PATH directory ownership should be already correct (if you didn’t overwrite it in the copy/move step). Let’s use it as reference to fix the ownership of that dir contents (in this case they are homogeneous and the trick works):

chown -R --reference "${VMAIL_PATH}" "${VMAIL_PATH}"/*

Now you have imported the Maildirs, but some format conversion are needed by NS8.

Get a shell of mail1:

runagent -m mail1

Stop Dovecot

systemctl --user stop dovecot

Run the Maildir conversion

../actions/import-module/35migrate_maildirs

Start Dovecot

systemctl --user start dovecot

Start quota recalculation

../actions/import-module/60quota_recalc

Good luck!

4 Likes