Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


linux mirroring

Posted on 2000-03-31
Medium Priority
Last Modified: 2013-11-15
Currently we are running Sendmail/Redhat 6.0 as our primary email server. Is it possible to have our primary email server backup/mirror to a secondary email server on a daily or hourly bases so that in the event of a failure of our primary email server  the secondary can be brought online by a change of its ip.
detail/steps would be much appreciated
If I have two linux boxes and need to copy email users from one to the other, what files need to be copied.
Question by:n_athen
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 40

Expert Comment

ID: 2673176
You could use rdist to replicate the mail spool to another machine, but if the mail server is very busy the spool area will get pretty out of date in the intervals between "syncs". If you are really worried about loosing email service and can spend the bucks, having all of the mail stuff on a separate disk (SCSI is best), or better yet a small standalone RAID system that can be moved from the failed server to it's backup might make more sense. You'd want to be careful in configuring the system so that everything other than program binaries needed for email services are located on the "movable drive". What would need to be there in addition to the user mailboxes depends on what email services you provide (POP, IMAP, etc) and which implementation is being used.

Expert Comment

ID: 2673288
There are plenty of >$10,000 solutions from vinca and others.  If you're talking about rolling your own standby server system, this is not at all simple, it depends very much on many details of your individual system, and you would not be able to maintain it if you just followed a cookbook without understanding what is going on.  The simplest way would be to check out who offers a prebuilt clustering package - buy it,  install it, spend time learning how it works.  RedHat may offer one, too.  

That said, if you really want to do this yourself (and I don't recommend it!), surf on over to, where the developers of high-availability linux have put up their work.  

I think the simplest and cheapest way to do this yourself is to have two servers that update each others spool files with rsync, preferably linked to each other with a separate set of network cards connected with a crossover Ethernet cable on a separate mini-network.  You will need to take particular care that both servers agree on the time, and that their CMOS clocks also agree on the time, since rsync depends on that.  There's a utility called netdate (search on that can handle that.  

You have one primary server that sends and receives mail: when it goes down, the other takes over its IP address and starts handling the load.  Resynchronizing once you have the primary server back up is a bit of a problem and you probably don't want to do that automatically.  

One big question is, how does the backup server decide that the primary is down?  You could use a ping script - but I've seen servers that were responding to ping but were otherwise hung and not completing processes.  You probably can't design an absolutely foolproof system yourself.  An interesting step-by-step overall guide is at

Author Comment

ID: 2674291
Edited text of question.
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.


Expert Comment

ID: 2674615
I think this might be what you're are
really after.  It doesn't solve the problem of, if mail is on the server
and the server goes then it's not mirrored to the other server, however
mail will still be processed.
There is another technical issue with
a complete mirror.. mail might be sent twice if it's stuck in the output queue.
on the down server when it is finally

I personally believe this way I'll explain here is the easiest... it's also the most widely used.

Basically its all handled by the DNS
server configuation.  I'm going to assume you have configured DNS before..
if not, ask a friend or go to and look up the docs on configuring it.

Set up 2 or more mail servers as normal.
Give them seperate IP addresses.

In your zone configuration file DNS add an MX record for each mail exchanger (server).

e.g. with this type of format...

a.b.c.d IN MX 20
a.b.c.e IN MX 30

(I think thats the right format it's all
from my memory).

basically where you see the numbers 20
and 30 they are the order of preference
given to the server.  So all mail should
generally be sent to the primary exchanger first... if that is unsuccessful then it will try smtp2
You could make both the 20 and 30 the same number so that no preference is given to either server.. in effect this is like very cheap load balancing... it's not really but the results are similar.


a.b.c.d IN MX 20
a.b.c.e IN MX 20

you can even add a 3rd if you wish...

a.b.c.f IN MX 20

If you plan to use these servers for
outgoing mail as well. you might want
to configure them to ensure the mail
appears from the same host etc...

For sendmail have a look here.

Unlike swapping in a new mail server you
will find that this system is automatic.
Now if you combine this with a monitoring program like "son of pong" or netmonitor? then you can be notified if one of you mail servers karks it.

Thats about it.

LVL 40

Expert Comment

ID: 2674622
What does your email system look like?

Pure sendmail with user mailboxes in mbox format in /var/spool/mail? Are you running a POP or IMAP server? Does the system provide LDAP directory services? Are you using only local password files or do you use NIS with the master being some other system? Are there any virtual email accounts? What about aliases or mailing lists? Do you allow .forwards and, if so, where are the user home dirs? As you can see there are a number of considerations. They are all solvable for the existing system, but you might want to consider something of a re-design to make the whole process simpler.

Now if you'd like a write up of what my production email system looks like (and it has essentially the characterics you are looking for), how it was designed and why, I can pull all the notes, etc together into one document this weekend.

Accepted Solution

matt_hook earned 1500 total points
ID: 2674632
Woops I did get the MX records wrong.
Sorry my brain was not quite fully
functioning this morning.

here's what it should look like

MX Records:
client.domain. IN MX 10 mailserver.client.domain.
client.domain. IN MX 20 mailserver.client.domain.



Expert Comment

ID: 2685092
first i want to tell you i'm a network dummy so be patient if what a say is a stupidity , but i'm a not so dummy unix user . for mirroring your email take a look at fetchmail
i use it for one user (me) and he do the job perfectly , i don't know if he can work on your case .

Featured Post

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

721 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