• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1289
  • Last Modified:

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



0
clau
Asked:
clau
  • 4
  • 3
  • 2
1 Solution
 
naccadCommented:
all you need to do is set relay_domains in main.cf
to the domain name of your ISP.

Actually if you do mail hosting on server1, you can
set server2 to be a backup for all these domains:

relay_domains = mydomain.com, hosted1.com, hosted2.com...etc

tc
-nick
0
 
periwinkleCommented:
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'.
0
 
periwinkleCommented:
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.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
clauAuthor Commented:
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.
0
 
periwinkleCommented:
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.
0
 
clauAuthor Commented:
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.
0
 
naccadCommented:
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

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

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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now