ar-djblists at acrconsulting
Sep 3, 2009, 8:26 AM
Post #4 of 7
On Thursday 03 September 2009, yilmaz wrote:
> On Thu, Sep 3, 2009 at 1:36 PM, Andrew Richards
> <ar-djblists [at] acrconsulting> wrote:
> > On Thursday 03 September 2009, yilmaz wrote:
> > > Hi all, I have a problem regarding the failover of a domain
> > > name in smtproutes file.
> > > I have set up smtproutes file for a single domain name so that
> > > qmail will ask DNS for MX records as I have read in qmail
> > > remote manual. Here is the file smtproutes content
> > >
> > > testdomain.com:
> > > :192.168.1.1
> > >
> > > DNS server for this domain tesdomain.com returns two MX records
> > > as such:
> > >
> > > mx 10 smtp1.relayserver.com
> > > mx 20 smtp2.relayserver.com
> > >
> > > I have sent a test message from qmail to e.g
> > > sample [at] testdomain and the message is delivered to
> > > smtp1.relayserver.com as expected. I have shut down
> > > smtp1.relayserver.com and sent the same message again and after
> > > that Qmail sent the message to
> > > smtp2.relayserver.com as I expected. However, when I bring the
> > > first server up and shut down the second server, presumably
> > > qmail should try smtp1.relayserver.com again but it isn't what
> > > happens. Qmail insists on sending the message to the
> > > unavailable server again and again although the first server is
> > > back again. I don't know what I actually miss on this
> > > configuration or does it work like this?
> > Has qmail marked smtp1... as unreachable - try running
> > qmail-tcpto to see if it's listed there. If so you can reset this
> > with qmail-tcpok (see the man pages for both commands to see
> > what's happening).
> Thank you Andrew. I have repeated the test and I have seen that
> qmail marks unreachable hosts
> after 2 timeouts which takes around 2 mins for each host. Once I
> clear the timeout table, qmail starts trying the host again.
> but what I have realized is qmail marks the host unreachable only
> when there is no network layer connectivity.
> If the remote machine has still the IP but no smtp service is being
> listened, qmail receives TCP reset packet sent from the remote host
> and keeps trying without marking it unreachable.
> This is what I have discovered if I am not mistaken.
I like your stretching the use of smtproutes for failover/failback; as
you're finding the tcpto timeout is getting in the way, given its
design goal was to deal with something else - but you could adjust the
code to address your particular issue, it looks fairly
* Custom email solutions * Systems Administration * Networking