Solved

Backup mail servers

Posted on 2004-08-13
13
322 Views
Last Modified: 2010-04-20
Hi,
   I use sendmail on all my mail servers at the moment but I'm not sure how to go about setting up a backup mail server. Basically I want this server to accept all mail for a given domain and when the primary server is back online - to forward all that email to the primary server. I don't want to have to check each email server to see if any mail has arrived.... is this easy to do?

Thanks in advance!
0
Comment
Question by:petepalmer
  • 6
  • 3
  • 2
  • +1
13 Comments
 
LVL 1

Assisted Solution

by:mcbastian
mcbastian earned 100 total points
ID: 11791588
a possible solution is to add a second MX-Record DNS. give it a higher MX-Value, so mail will only be sent to this server when server with lower MX-Value is not reachable.

on the second server, set up Obtuse's SMTPD. it is a store-and-forward-daemon for SMTP.
0
 
LVL 1

Author Comment

by:petepalmer
ID: 11792033
Unfortunately the other servers are running sendmail so I'd need to do it with sendmail rather than another product - at least for now :)
0
 
LVL 1

Assisted Solution

by:mcbastian
mcbastian earned 100 total points
ID: 11792139
0
 
LVL 1

Author Comment

by:petepalmer
ID: 11792181
That's the set up I have at the moment but I want to move everything to use proper back up mail servers as opposed to storing the email on a remote account and then collecting it with say procmail...


It's all I need to perfect this system lol
0
 
LVL 40

Assisted Solution

by:jlevie
jlevie earned 300 total points
ID: 11792532
You'll need a secondary MX pointing at another Linux box running sendmail with essentially the same sendmail conf you use now. The exception will be that you'll want to tell the secondary mail server to forward all mail to the primary. There are several ways this can be done; explict forwards for each user in the aliases file, explicit forwards and/or catchalls in the virtusertable map, etc. As long as the secondary knows to forward all mail to the primary it'll do what you want.
0
 
LVL 1

Author Comment

by:petepalmer
ID: 11793817
I've already got the MX records setup and the seconary server will accept email for the domain. The problem is I don't know how to get sendmail to hold on to the email until the primary is back up and then to forward it on to there :)
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 40

Assisted Solution

by:jlevie
jlevie earned 300 total points
ID: 11794189
If the secondary believes that all of the users are on the primary and that it is to forward mail to there it will hold the mail until the primary comes back up. The trick here is telling the secondary to forward the mail. Personally I prefer to explictly list each valid address and define the forward, using a alias map for a single domain or a virtusertable map when there's more than one domain involved.  Some spam engines like to target a secondary mail server and I'd rather have that server reject mail for non-existant accounts rather than accepting it and having the primary reject it.
0
 
LVL 6

Assisted Solution

by:de2Zotjes
de2Zotjes earned 100 total points
ID: 11801233
One minor addition...

If you do have an outage of your primary you can trigger the secondary to flush it's mailbuffers by sending an ETRN <domain>.

This will forward any delayed mail to your primary mail site.
0
 
LVL 1

Author Comment

by:petepalmer
ID: 11801451
Can you give an example of how to forward a domain from a secondary to a primary ?  That's the bit I don't know how to do :)

Could also do with an example for mapping just a single account to
0
 
LVL 6

Assisted Solution

by:de2Zotjes
de2Zotjes earned 100 total points
ID: 11801815
I am not sure I understand what you mean, but what I meant with the ETRN bit is the following:

>telnet <secondary> 25
[220 SMTP server]
>HELO <primary>
[250 ...]
>ETRN <primary>
[250(?)...] (can't test right now)
>QUIT

So you contact the secondary and you tell it to start sending buffered mail to the primary. You could even automate this using fetchmail
0
 
LVL 1

Author Comment

by:petepalmer
ID: 11802274
I don't know how to get the secondary to hold email until the primary is back online.
0
 
LVL 40

Accepted Solution

by:
jlevie earned 300 total points
ID: 11804515
The secondary will receive the mail for your domain if it believes it to be a mail server for that domain. And that will happen if the hostname of the secondary lies within the domain or the domain is explictly listed in local-host-names. However, since the user's accounts aren't on the secondary it will bounce the mail (unknown user) unless we tell the secondary what to do with those messages.

One way is with aliases file records, like:

user1:               user1@main.dom.tld
user2:               user2@main.dom.tld
...

Another is with virtusertable records like:

user1@dom.tld     user1@main.dom.tld
user2@dom.tld     user2@main.dom.tld
...

or using a catchall:

@dom.tld               %1@main.dom.tld

In all of those cases the secondary can "see" that the mail needs to be forwarded to the user account on mail.dom.tld. If it happens to be down the mail will set in queue until it can be delivered.
0
 
LVL 1

Author Comment

by:petepalmer
ID: 11804870
Although jlevie has given me the answer I wanted everyone contributed....so I've upped the points to 500, of which 200 is going to be given to jlevie's final answer. All previous answers will each receive 50 points....


Thanks all :)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now