Gmane
Favicon
From: John Simpson <jms1@...>
Subject: Re: nuB question : relay
Newsgroups: gmane.mail.qmail.qmr
Date: 2007-06-22 15:00:55 GMT (2 years, 1 week, 5 days, 11 hours and 41 minutes ago)
Expires: This article expires on 2007-07-06
On 2007-06-20, at 0558, Matteo Cisilino wrote:
>
> Hi all , i know this is a stupid a question , but i cannot find  
> nothing
> interesting on google .
>
> I need to make a backup mx on a qmail server , how to do this ?

(1) build a qmail machine with no domains (i.e. the "locals" and  
"rcpthosts" files are both zero bytes, and the "virtualdomains" file  
is empty.) basically, install qmail, but DON'T run the "config-fast"  
script- just create the "me" file with a unique hostname for the server.

(2) add the domain(s) you will be "backup MX'ing" to the "rcpthosts"  
control file.

(3) create an MX record in your DNS data which points to the new  
server, with a higher priority than the existing MX record which  
points to your primary server.

example: build a new server "b.mx.domain.xyz" with IP 2.2.2.2, which  
will be a "backup MX" for the domain "domain.xyz". the primary MX for  
that domain is "a.mx.domain.xyz" with IP 1.1.1.1.

on the new machine:

control/me:
	b.mx.domain.xyz

control/rcpthosts:
	domain.xyz

control/locals:
	(exists but is zero bytes)

control/virtualdomains:
	(does not exist)

in your DNS data (if using tinydns)...

	@domain.xyz:1.1.1.1:a:1    (already existed)
	@domain.xyz:2.2.2.2:b:2    (add to the file)

in your DNS data (if using BIND)...

	a.mx.domain.xyz.  IN A       1.1.1.1           (already existed)
	domain.xyz.       IN MX 1    a.mx.domain.xyz.  (already existed)
	b.mx.domain.xyz.  IN A       2.2.2.2           (add to the file)
	domain.xyz.       IN MX 2    b.mx.domain.xyz.  (add to the file)

this is all that's necessary.

and before people jump in, screaming about the smtproutes file... in  
this case it's not needed. the backup MX server will know to forward  
the messages (instead of delivering them locally) because the domain  
is not listed in control/locals or control/virtualdomains, and it  
will know WHERE to forward them because the primary server will be  
listed in the DNS data with a lower-priority MX record.

----------------------------------------------------------------
| John M. Simpson    ---   KG4ZOW   ---    Programmer At Large |
| http://www.jms1.net/                         <jms1@...> |
----------------------------------------------------------------
| http://video.google.com/videoplay?docid=-4312730277175242198 |
----------------------------------------------------------------