Mailing List Archive

mail looping with same server
This Qmail server is the secondary MX record to the primary mail server for this domain. It’s job is to queue messages when the primary mail server is down and store them until it is back up and then deliver them.

There are 2 of these qmail servers behind a load balancer. Qmail is trying to deliver the message to the load balanced IP address which comes back to the same server, this continues until it errors, "554_too_many_hops,_this_message_is_looping” and bounces the message.

is there a way to qmail not to try to send to the same server / load balanced IP address? The logs are below.

Thanks,
Luke


Apr 24 06:42:26 local@2mx2 qmail: [ID 748625 mail.info] 1493041346.139746 new msg 943641
Apr 24 06:42:26 local@2mx2 qmail: [ID 748625 mail.info] 1493041346.139874 info msg 943641: bytes 68177 from <FROM> qp 13543 uid 7513
Apr 24 06:42:26 local@2mx2 qmail: [ID 748625 mail.info] 1493041346.142859 starting delivery 24713257: msg 943641 to remote TO
Apr 24 06:42:26 local@2mx2 qmail: [ID 748625 mail.info] 1493041346.183823 bounce msg 943641 qp 13548
Apr 24 06:42:26 local@2mx2 qmail: [ID 748625 mail.info] 1493041346.184079 end msg 943641
Apr 24 06:49:07 local@2mx2 qmail: [ID 748625 mail.info] 1493041747.276742 new msg 943641
Apr 24 06:49:07 local@2mx2 qmail: [ID 748625 mail.info] 1493041747.276819 info msg 943641: bytes 253102 from <FROM> qp 27753 uid 7513
Apr 24 06:49:07 local@2mx2 qmail: [ID 748625 mail.info] 1493041747.280575 starting delivery 24713887: msg 943641 to remote TO
Apr 24 06:49:07 local@2mx2 qmail: [ID 748625 mail.info] 1493041747.360623 delivery 24713887: success: IP_accepted_message./Remote_host_said:_250_ok_1493041747_qp_27757/
Apr 24 06:49:07 local@2mx2 qmail: [ID 748625 mail.info] 1493041747.361252 end msg 943641
Apr 24 06:49:07 local@2mx2 qmail: [ID 748625 mail.info] 1493041747.442497 new msg 943641
Apr 24 06:49:07 local@2mx2 qmail: [ID 748625 mail.info] 1493041747.442633 info msg 943641: bytes 253466 from <FROM> qp 27761 uid 7513
Apr 24 06:49:07 local@2mx2 qmail: [ID 748625 mail.info] 1493041747.446085 starting delivery 24713889: msg 943641 to remote TO
Apr 24 06:49:07 local@2mx2 qmail: [ID 748625 mail.info] 1493041747.930481 end msg 943641
Apr 24 06:49:08 local@2mx2 qmail: [ID 748625 mail.info] 1493041748.145700 new msg 943641
Apr 24 06:49:08 local@2mx2 qmail: [ID 748625 mail.info] 1493041748.145776 info msg 943641: bytes 253830 from <FROM> qp 27786 uid 7513
Apr 24 06:49:08 local@2mx2 qmail: [ID 748625 mail.info] 1493041748.147923 starting delivery 24713891: msg 943641 to remote TO
Apr 24 06:49:08 local@2mx2 qmail: [ID 748625 mail.info] 1493041748.462232 bounce msg 943641 qp 27799

Apr 24 06:49:08 local@2mx2 qmail: [ID 748625 mail.info] 1493041748.304721 delivery 24713891: failure: IP_failed_after_I_sent_the_message./Remote_host_said:_554_too_many_hops,_this_message_is_looping_(#5.4.6)/
Re: mail looping with same server [ In reply to ]
Luke Miller <millerlu@integra.net> wrote:
> This Qmail server is the secondary MX record to the primary mail server for
> this domain. It’s job is to queue messages when the primary mail server is
> down and store them until it is back up and then deliver them.
>
> There are 2 of these qmail servers behind a load balancer. Qmail is trying
> to deliver the message to the load balanced IP address which comes back to
> the same server, this continues until it errors,
> "554_too_many_hops,_this_message_is_looping” and bounces the message.

The problem is that you've got qmail delivering mail to an IP address that
belongs to the same machine that qmail is running on (i.e. traffic to that
address ends up at the qmail server - I know it's indirectly through the load
balancer, but that doesn't matter) but qmail doesn't know that address is
part of that server, so it doesn't avoid sending to that address.

Scott Gifford's moreipme patch was designed for situations such as these.
Apply the patch, and list all IP addresses which indirectly map to the server
in the appropriate control file.
https://lists.gt.net/qmail/users/73878

Another thing you can do is, on the "secondary" MX machines, don't have them
rely on DNS MX records to know where to forward the mail to. Hardcode the
address to deliver those messages in qmail's control files.

Charles
--
--------------------------------------------------------------------------
Charles Cazabon
GPL'ed software available at: http://pyropus.ca/software/
Read http://pyropus.ca/personal/writings/12-steps-to-qmail-list-bliss.html
--------------------------------------------------------------------------