When you ISP's mail-server quotum is reached, you can archive your mail into a
separate server locally on your own server. And it is accessible by multiple local users.
apt instlall dovecot-imapd
The archive user is created with the following command:
useradd --system --no-create-home --shell /sbin/nologin --uid 900 --gid office archive
List of available variables for expansion:
| Variable | Expands to |
|---|---|
%u |
full username (e.g. archive) |
%n |
username without domain (useful if using user@domain format) |
%d |
domain part only (e.g. example.com) |
%h |
home directory of the user |
%l |
first letter of username (useful for sharding) |
%L |
lowercase version of the following variable |
%U |
uppercase version of the following variable |
To change the storage location of the archive mailbox, edit file /etc/dovecot/conf.d/10-mail.conf
and change the line mail_location = ... to:
mail_location = maildir:/mnt/data/mail/%n/files:LAYOUT=fs:INDEX=/mnt/data/mail/%n/index
mail_access_groups = office
To allow the archive user to access the storage location, set the sticky bit on
the directory for the group:
chmod g+rs /mnt/data/mail
Only the
filessubdirectory needs this since eml-files are only in that directory.