Re: [exim] Using Routing, Maildir and MBOX for email backups

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Mike Cardwell
Date:  
À: Exim Users List
Sujet: Re: [exim] Using Routing, Maildir and MBOX for email backups
Eric Kiara wrote:

> I have an Exim setup on one of my Gentoo boxes that I'd like to
> configure for daily use and archiving/backup of all inbound messages:
>
> The current setup is a vanilla Exim installation appending MBOX files
> in "/var/spool/mail" for local deliveries. I'd like to add archiving
> and webmail.
>
> My initial idea is to have a "/var/spool/mail" and a
> "/var/spool/mail/webmail" directories. With /var/spool/mail/webmail
> to contain Maildir directories
> "/var/spool/mail/webmail/{user1,user2}". Then I'll point my POP
> daemon to retrieve messages from "/var/spool/mail/webmail/user1"...
> etc as well as configure Horde to use the same directory:
> "/var/spool/mail/webmail".
>
> So Exim would perform local deliveries by running an unseen router
> first to the MBOX files in "/var/spool/mail" and then a second (final)
> deliver to Maildir directories.
>
> The rationale behind this is that "/var/spool/mail" would remain
> untouched, and act as an archive that I can periodically backup.
>
> My question is: is this an "okay" or "standard" approach to setting up
> routing for what I want to achieve (webmail and backing up inbound
> emails in a small or medium sized office, i.e. less-than 500 users)?
> How have others setup routing for archiving emails when you only have
> one box to do it on?


That sounds fine to me. However, one recommendation I'd make is to use
maildir for the backup as well as the live mail instead of mbox. That
way you can easily delete mail from your backup over a certain age. Eg,
to delete everything over 30 days (untested):

find /var/spool/mail -type f -mtime +30 -exec /bin/rm -f {} \;

It would also be much more straight forward to retrieve mail from the
backup and then insert it back into a users current live mail...

--
Mike Cardwell - IT Consultant and LAMP developer
Cardwell IT Ltd. (UK Reg'd Company #06920226) http://cardwellit.com/