Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 566826 - mail-mta/netqmail-1.06-r2: incorrectly detects local IPs (message is looping)
Summary: mail-mta/netqmail-1.06-r2: incorrectly detects local IPs (message is looping)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Rolf Eike Beer
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-25 16:10 UTC by Alex Efros
Modified: 2019-09-25 03:34 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Efros 2015-11-25 16:10:27 UTC
I've issue with secondary MX server: when primary MX is not available all
emails bounced in a couple of seconds because of sending them again and
again from that secondary MX to itself.

I suppose problem is qmail don't understand this is it's own (local) IP
and tries to deliver email to (as it thinks) another MX.

This server has many (8) network interfaces (lo, 4 network cards, 3
openvpn tun devices). First network card has about 122 IP addresses
assigned. Qmail is running on just one of these 122 IP addresses, but
it's not the first one - this IP is actually somewhere in the middle.
I'm using netqmail-1.06 with extra outgoingips patch.

The setup is like this (problem is when sending to user@target.domain.host):

    # dnsmx target.domain.host
    1 b.mx.target.domain.host 
    0 a.mx.target.domain.host

    # dnsip a.mx.target.domain.host
    (some other IP, not reachable right now)

    # dnsip b.mx.target.domain.host
    1.2.3.66

    # grep TCPSERVER_HOST conf-common
    TCPSERVER_HOST=1.2.3.66

    # cat locals
    localhost
    127.0.0.1
    this.secondary.mx.host

    # cat me
    this.secondary.mx.host

    # cat outgoingips
    :1.2.3.66
    this.secondary.mx.host:1.2.3.66

    # cat rcpthosts
    localhost
    127.0.0.1
    this.secondary.mx.host
    target.domain.host

I've checked ipmeprint output (BTW, why is this tool won't installed by default?):
/var/tmp/portage/mail-mta/netqmail-1.06-r2/work/netqmail-1.06 # ./ipmeprint

0.0.0.0
127.0.0.1
1.2.3.4
1.2.3.4
1.2.3.4
...
1.2.3.4
1.2.3.4
1.2.3.4         (122 times same _FIRST_ IP on 1st network card)
10.10.20.1      (this is IP on 2nd network card)
10.100.200.102  (this is IP on tun2)
10.100.200.100  (this is IP on tun0)
10.100.200.101  (this is IP on tun1)

So looks like instead of IPs 1.2.3.4-1.2.3.126 on 1st network card qmail
thinks all these IP are the same IP 1.2.3.4.

I'm trying to fix this using qmail-1.03-moreipme.patch, hope it'll helps.
Comment 1 Rolf Eike Beer archtester 2019-08-30 19:59:14 UTC
We are going to fix that in notqmail, the issue is tracked here: https://github.com/notqmail/notqmail/issues/95

I have a branch with patches for this issue, that not only fixes the problem for me, but also should speed things up a bit as it has to do much less ioctls. Would be nice if you could test this and sees if it helps for you.
Comment 2 Larry the Git Cow gentoo-dev 2019-09-25 03:34:40 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6901a0a254a693859b3b83fabb26680d1bc900a0

commit 6901a0a254a693859b3b83fabb26680d1bc900a0
Author:     Rolf Eike Beer <eike@sf-mail.de>
AuthorDate: 2019-09-21 16:51:05 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2019-09-25 03:31:58 +0000

    mail-mta/netqmail: upgrade EAPI, clean up
    
    - properly handle multiple IP addresses on the same interface
    
    Closes: https://bugs.gentoo.org/show_bug.cgi?id=566826
    Closes: https://github.com/gentoo/gentoo/pull/12989
    Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 .../netqmail/files/genqmail-20080406-ldflags.patch |   4 +-
 .../files/netqmail-1.06-ipme-multiple.patch        | 117 ++++++++++++
 .../files/use-new-path-for-functions.sh.patch      |   4 +-
 mail-mta/netqmail/netqmail-1.06-r7.ebuild          | 201 +++++++++++++++++++++
 4 files changed, 322 insertions(+), 4 deletions(-)