Link to home
Start Free TrialLog in
Avatar of clau
clau

asked on

Setting up secondary mail server

This is not a Sendmail question, it is a Linux mail server question.
I work at a little ISP, at present we have two servers, both working well:
1. RH 8 + Postfix + MySQL + Courier-imap + sqwebmail + Bind
2. RH 8 + Apache + PHP 4.3.0 + Bind

and DNS is setup like this
MX 10 server1
MX 100 server2
In server #2 there is no mail server program yet.

I've tried to use PHP's "mail" function in server2 but as I have no SMTP server it didn't work.
So I wanted to install some kind of mail server, and use it also as a secondary server if server1 fails. My aim is that no mail get lost.

Question 1:
Can I setup Postfix as a "catchall" server? (so if server1 fails server2 gets every mail and then when server1 is fixed I guess I can deliver mail back with fetchmail)
Or should I duplicate server 1 maildir and database structure?

Question 2:
Is there a simpler solution?

Thanks



ASKER CERTIFIED SOLUTION
Avatar of Nick Accad
Nick Accad
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of periwinkle
You'll  need mail server software on the secondary mail server in order to queue the email.  Postfix can serve that purpose.

The question, however, is more a matter of how to appropriately configure postfix to queue the mail for the other server.

In sendmail, you'd set up the secondary MX (like you've done), and then you'd add the host to a file called 'relay-domains'.  It would appear that the similar configuration item in postfix  (based on the documentation at postfix.org) is called 'mynetworks'.
P.S. in answer to the part of the question as to whether or not you'd have to set up all the email accounts, etc., the answer is no - it's not going to be emailed locally - it's going to be queued for delivery to the main server.
Avatar of clau
clau

ASKER

Ok, so if server1 breaks the mail will stay queued in server2 till server1 is repaired?
I must be sure to set maximal_queue_lifetime very high.

naccad: if server2 is a backup for the domain, will it store every mail coming to server1? Please tell me what 'backup' means when talking about mail servers.
clau -

If server1 breaks (working again, from my knowledge of sendmail, not postfix), the email queues at server2.  With sendmail, when server1 comes back up again, you issue a set of commands (usually through a perl script) to retreive the email via ETRN.  With sendmail, a sample perl script is provided;  I would search the postfix site to see if there is a similar type of program there as well.
Avatar of clau

ASKER

Ok, so if server1 breaks the mail will stay queued in server2 till server1 is repaired?
I must be sure to set maximal_queue_lifetime very high.

naccad: if server2 is a backup for the domain, will it store every mail coming to server1? Please tell me what 'backup' means when talking about mail servers.
ok.. a backup mail server, or a secondary MX is a mail server
that will just queue the emails locally until the primary
MX comes back online. it will not deliver it to local users
because by definition a backup MX has no local users.

Most ISPs will offer this for you, worldcom/uunet will
allow u to put mail.uunet.com (or something) as secondary
MX for backups.

by default, sendmail will queue the email fro 4 days, in
my experience more than enough to get the primary up and
running.

most will use SMTP to relay the emails after the primary
comes back up, some will use UUCP or FTP or whatever, SMTP
is prolly the easiet.

hope that helps
tc
-nick

Avatar of clau

ASKER

Thanks to periwinkle too. Both were of great help, but naccad answered first (and with Postfix configuration).
clau -

Glad to help - and you're correct, naccad deserved the points!