I came up with this:
Download and install Ubuntu server 9.04. (Virtual or hardware)
When the installation is done run:
Code:
sudo -s
Now when you have a root terminal run:
Code:
apt-get update
Code:
apt-get install postfix
Code:
nano /etc/postfix/main.cf
Code:
smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination
Code:
relay_domains = $mydestination domain1.com domain2.net domain3.org
And the last line:
Code:
transport_maps = hash:/etc/postfix/transport
Now we need to create the transport file so run:
Code:
nano /etc/postfix/transport
Code:
domain1.com smtp:mail.domain1.com
domain2.net smtp:mail.domain2.net
domain3.org smtp:mail.domain3.org
Now save the file ctrl + O the exit ctrl + X.
Now we have to create a binary database for the transport.
Code:
cd /etc/postfix/
Code:
postmap transport
Code:
postfix reload
mailq (List the mail queue)
postsuper -r queueid (sends that mail from the queue)
From a external ip portforward port 25 to this unit.
Now add that external ip to your MX records. (with a higer value than your standard mailserver)
When the main MX record server goes down email will be sent to the backup server.
When the primary server gets back online again postfix will send all mails to the smtp specified in "/etc/postfix/transport".
Try to see that it works.
download mailsend.exe
http://www.muquit.com/muquit/softwar.../mailsend.html
Enter the ip to the backupserver and follow the instructions.
if it works it will relay the mail to your server.