Solved Exim and sending mail from secondary ip since updating to 1.652

Richard G

Verified User
Joined
Jul 6, 2008
Messages
14,282
Location
Maastricht
Exim is suddenly sending out mail via the secondary ip, this is a real issue.
Also Softaculous is using the secondary ip it seems.

Is there any way to fix this so Exim will use the primary ip again as should be?
I can't use the swapip.sh script because the ip's are already in the correct order. So in fact Exim should use the primary ip anyway.
 
No it's still the correct one. I only have 1 device.
This is the ip a output.
Code:
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 90:1b:0e:91:c4:36 brd ff:ff:ff:ff:ff:ff
    inet 17x.xx.xxx.13/32 scope global noprefixroute enp0s31f6
       valid_lft forever preferred_lft forever
    inet 17x.xx.xxx.28/27 scope global enp0s31f6
       valid_lft forever preferred_lft forever
    inet6 2a01:xxx:xxx:xxx::2/64 scope global noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::921b:eff:xxx:xxx/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

The ipv6 is connected to the first ip so to the .13 ip.

I checked the ips.list:
Code:
less ip.list
2a01:xxx:xxx:xxx:0:0:0:2
17x.xx.xxx.13
17x.xx.xxx.28

and the setup.txt from the server also points to the first .13 ip.

It was going fine and now I got a mail that a customer could not send mail.
It was refused because the .28 ip was not allowed to send mail in behalf of the customer's domain in SPF.

So I temp added the .28 ip in SPF for the customer, but this prooves that Exim is sending on the wrong ip for some reason.
 
It maybe might not have to do with the 1.652 version, just seems it happened since then.

Still not found the cause. I did some additional checking and checked:
/etc/httpd/conf/extra/httpd-vhosts.conf
and
/usr/local/directadmin/data/admin/show_all_users.cache

All are showing the primary ip.

I totally have no clue as to why Exim decides to use the 2nd ip.

Also Softaculous sees the primary ip is the .13 ip but says the licensing is running on the .28 ip. But I don't mind that, I need exim back defaulting to the primary ip.
 
Still no clue as to why Exim choose to use the secondary ip, but it seems sometimes this can happen.

For anyone else having this issue, easy fix. Create a /etc/virtual/domainips file and chown to mail and chmod to 640.
Then add the ip you want Exim to use:
*:192.168.10.1
ofcourse this is an example ip, replace with your own. But the characters in front are required!!

Thanks John from DA for the solution!
 
Back
Top