A while back Joel put up a script to backup the key components of the mail store for 10.3 server. With Tiger, we got the added benefit of AMaViS/ClamAV/SpamAssassin so I made a few changes…With all the junkmail and anti-virus additions to Tiger, there’s a whole lot more to backup than just the Postfix config and Cyrus stores.
The configuration files for AMaViS/ClamAV/SpamAssassin are pretty well dispersed:
<code>/etc/mail/spamassassin/ /var/amavis/ /var/clamav/ /etc/amavisd.conf /etc/clamav.conf /etc/freshclam.conf </code>
The script now backs all of these up and restores them. Each one is handled individually so it’s possible to selectively restore by simply commenting out the lines for the components you don’t want restored.
I’ve also added in quotes to better handle backup paths with spaces in them, and the mailbox size report posted by superhenne – allthough this can take some time if you havea number of large (2GB+) mailboxes.
I have only added sections to the script and not made any changes to the existing code (Except the quotes). However, make sure you test this out on a non-production server before running it – especially before running the restore! This has been tested on a 10.4.2 server with the default locations for all files. The only problem I have noticed is that, after some restores, Postfix is unable to start as port 10025 has already been taken (or maybe was never released – it’s used by amavisd for content scanning). Restarting the server fixes this.
As before, any comments or improvements welcome.