Exim: trying to send emails from different ips and hostnames

Issues related to applications and software problems
Post Reply
ClintonLee83
Posts: 1
Joined: 2023/07/08 15:42:31

Exim: trying to send emails from different ips and hostnames

Post by ClintonLee83 » 2023/07/09 08:23:58

I have 2 ips on my server, I’m trying to set up 2 emails, one email sends from one ip, the other sends from the second ip. The first email is fine but I’m getting an error in mail-tester.com for the second email (ips are obviously dummy examples):
Your IP address 1.1.1.2 is associated with the domain port25.domain.com.
Nevertheless your message appears to be sent from port24.domain.com.
You may want to change your pointer (PTR type) DNS record and the host name of your server to the same value.
Here are the tested values for this check:
IP: 1.1.1.2
HELO: port24.domain.com
rDNS: port25.domain.com
My setup on my vps - 2 ip’s each has their own hostname rdns
port24.domain.com → 1.1.1.1 (ip1)
port25.domain.com → 1.1.1.2 (ip2)

I’ve set up 2 domains in vesta cp, domain1.com uses ip1, domain2.com uses ip2. DNS is correct.

I’ve created emails in roundcube. I’ve added the following to my exim conf:

interface = ${lookup{$sender_address_domain}lsearch{/etc/exim/mailips}{$value}{}}
helo_data = ${if exists {/etc/exim/mailhelo}{${lookup{$sender_address_domain}lsearch{/etc/exim/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
I’ve added the following to my mailips and mailhelo file:

mailips:
domain1.com:1.1.1.1
domain2.com:1.1.1.2

mailhelo:
domain1.com: port24.domain.com
domain2.com: port25.domain.com
*: port24.domain.com

The previous error in mail-tester.com shows emails from domain2.com on 1.1.1.2 are coming from port24 when they should be coming from port25.

Telnet is also showing port24 instead of port25:

Code: Select all

# telnet 1.1.1.2 587
Trying 1.1.1.2...
Connected to 1.1.1.2.
Escape character is '^]'.
220 port24.domain.com ESMTP Exim 4.96 Sat, 08 Jul 2023 10:57:23 -1000
Any ideas about how to solve this?

User avatar
TrevorH
Site Admin
Posts: 33221
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Exim: trying to send emails from different ips and hostnames

Post by TrevorH » 2023/07/09 12:19:07

I'd ask somewhere else. We do not ship exim - not since CentOS 5 - so the pool of knowledge about it here will be small.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply