I have a stake in a London based fire protection company and sometimes get involved with their IT. Being a small company they run MS Small Business Server 2003 and connect to the internet using ADSL and a fixed IP address. For their email the MX reccord points to their internal server via a port mapping on their firewall. I also wanted to give them a secondary MX record with a store and forward service in case their server or Internet connection is down for a prolonged period. I looked at various commercial services but eventually decided to make use of their dedicated web server hosted by their ISP. The server runs Fedora Core and includes Qmail as part of the build.
I’m far from being skilled in Linux/Qmail but I can stumble my way through when necessary. There’s a plethora of resource material on the Internet and I use a little Unix and Sendmail at work. Dave Sill has produced the excellent Life With Qmail guide that will get you started with Qmail.
Firstly you’ll need an SSH client. I use PuTTY. Once logged in to your server navigate to /var/qmail/control.
Next vi the rcpthosts file. (I’m sure there are other editors but I learnt the basics of vi back at university on VAX/VMS systems so stick with what I know.) Add to the file the domain you want to store and forward for e.g. griffinfire.co.uk. Save your changes and exit.
Now vi the smtproutes file. Here you need to add the SMTP domain and destination host in the following format SMTPdomainname:FQDNofdestinationhost e.g. griffinfire.co.uk:mail.griffinfire.co.uk. Save and exit.
And that’s all there is to it.
You can’t adjust the delivery retry intervals in Qmail but it will keep the messages for 1 week before expiring. This is longer than the defaults for some other messaging systems (Exchange 2003 defaults to 48 hours, MIMEsweeper is 72 hours) and therefore ideal for a store and forward service.
With some slight further configuration it should also be possible to access the stored email via a web interface which would be useful in a DR scenario. This is on my to-do list and I’ll blog the process once done.