The Network People Support Forums

Mail::Toaster => Documentation => Topic started by: twa on February 20, 2004, 03:21:38 AM

Title: Using a toaster as a backup mailserver
Post by: twa on February 20, 2004, 03:21:38 AM
A backup mailserver will receive mail for your domain(s) in case the primary mailserver can't accept mail for some reason.


Scenario:

The host mail.example.com handles mail for example.com and acme-widgets.com. Hence, MX records for example.com and acme-widgets.com both point to mail.example.com and has a priority of 10.


If mail.example.com goes offline, we want mail to be sent to the server backup.example.com and stored there until mail.example.com comes back up.


Here's how you do it:

Title: More good information, thanks
Post by: davidcl on February 20, 2004, 06:21:18 AM
More good information, thanks.

The smtproutes entry is not necessary if your DNS is set up correctly.  I'd generally recommend against putting it there, because it's duplication of information that could end up causing confusion in certain situations.

For example, if the name of the primary server changes, and you update it in DNS, but you forget to update the smtproutes entry, it might be a while before you found the problem.

I generally use smtproutes in only two situations:

1) The customer's mail is destined for an "internal" mail server, but that server's name is not published to the outside world as an MX record in DNS.

2) My mail server is listed in my DNS server as an MX for the domain, but the end user has not yet changed their DNS to "go live" with my service.  Then I use smtproutes so that I can send email to the customer's old mail server.  (This commonly comes up when moving complex sites from another hosting company).
Title: For how long will the messages stay queued?
Post by: johannes on June 25, 2004, 05:49:02 AM
I have used this information to set up a backup mail server using qmail. The MX is higher (50) than of the primary MX (10).

Our client will unplug his mail server (the primary MX) for quite a long time, uncertain how long, but it could be weeks. Meanwhile, I want the backup server to store all incoming email. Eventually, the client's mail server will come up again, and all the email from the backup server will get delivered to it.

My questions:
1. Is there any limit for how long qmail will store the email, and try to deliver to the primary mail server?
2. And, will there be any "Sorry, I could not deliver..." messages sent from qmail?

I want this to be transparent to the mail senders, so that they do not notice that mail has not yet reached the primary server...

Any tips on how to do this? Question Thanks,
/ Johannes
Title: queuelifetime
Post by: davidcl on June 25, 2004, 08:20:29 AM
/var/qmail/control/queuelifetime

Number of seconds a message  can  stay  in  the  queue.   Default: 604800  (one  week).  After this time expires, qmail-send will try the message once more, but it will treat  any  temporary  delivery failures as permanent failures.

If the primary MX will be down for several weeks, you want to increase this number to be greater than the expected downtime.  

For example, 3024000 would be five weeks.

qmail does not send anything to the sender until the messages reach this age, then it sends a "permanent" bounce.

I think you have to restart qmail-send after you create/change this file.
Title: Re: Using a toaster as a backup mailserver
Post by: Nick Cockinos on May 18, 2005, 10:08:20 PM
I've also used this technique to serve as a mail-gateway.

Basically, MX 10 the mail-gateway and MX 20 the destination mail server. Works great in our situation. We have an Exchange box and another two toasters. The Mail-Gateway checks in coming mail and sends it to the destination server(s)

Title: Re: Using a toaster as a backup mailserver
Post by: noratx on October 17, 2008, 12:28:57 AM
I have just used this guide to get me a backup mailserver...  but how do I know that it works?