Create a separated mailbox for archived mails

Marc Marc at f1-outsourcing.eu
Wed Oct 20 19:49:55 EEST 2021




> 
> thanks for replying, I would like to archive e-mail older than 5 years
> on a second storage, it seems like the namespace with a new
> mail_location that you suggested could be good for me, but then I will
> need the auto-archiving script that move mails older than 5 years to the
> archive namespace.

Indeed and if you are choosing a period of 5 years you can just run it at the end of the year. I do this every year, so I decided to do it after the first quarter. I have inbox stored on ssd and archive on hdd. (I have some users that have >80GB mail????). I decided to enable this for specific users by creating an autoarchive sieve entry. My cron job script checks which users are having these and then moves the email. I also decided to control to have this done within specific down hours, so there is no moving done during 'working hours'. I also made an array of folders to move like common Inbox and Sent Items (yes these are also getting big), and move these all to a specific year. Apple mail is even so smart to link inbox emails to archived folders mails in thread view.

This is what you need to build your script around:
doveadm move -u $account Archive/$year mailbox "$mbox" SENTBEFORE $nyear-01-01 SENTSINCE $year-01-01


> A question: how can I configure client like Thunderbird to access that
> archive namespace so that users can still access their old mails?

Clients will just see these folders. Maybe you need to add subscriptions = yes to the configuration.


More information about the dovecot mailing list