SMTP Banner Check multiple IP's

kaijidesign

New member
Joined
Jun 27, 2017
Messages
2
I'm trying to setup the smtp server correctly for mulitple IP's
When I'm checking the IP on mxtoolbox.com there is a warning that the SMTP banner is not correct.
I have search google and saw the following solution for adding to the exim.xonf

Code:
smtp_banner =\
${if and{\
{def:interface_address}\
{eq{${interface_address}}{1.2.3.4}}\
} {mail.host1.com}{mail.host.com}} ESMTP $tod_full

This works fine for 2 IP's the base IP and 1 IP for my customer.
But I have multiple IP's and was looking for a solution.

There was an website with the solution:
Code:
smtp_banner =\
${if and{\
{def:interface_address}\
{eq{${interface_address}}
{1.2.3.4}
{2.3.4.5}
{3.4.5.6}
}\
}
{www.host1.com}
{www.host2.com}
{www.host3.com}

{}

{www.host.com}} ESMTP $tod_full

So I treid this but when I restart EXIM it won't restart.

Can someone explain what is wrong:confused:
 
Good solution!

Hi kaijidesign,

For me this solution works very good.
add it in the beginning of exim.conf

Code:
local_interfaces = your ip1 : your ip 2 : your ip3 : your ip 4 and etc ...
smtp_active_hostname = ${lookup{$interface_address}lsearch{/etc/virtual/smtp_active_hostnames}{$value}}
smtp_banner = "$smtp_active_hostname ESMTP $tod_full"

Dont forget create /etc/virtual/smtp_active_hostnames in this format:
your ip1:your related ptr
your ip2:your related ptr
and etc ...

now
in exim.conf find this lines:
remote_smtp:
driver = smtp

and immediately after that add:
Code:
interface = "${lookup{$sender_address_domain}lsearch{/etc/virtual/domainips}{$value}}"
helo_data = "${lookup{$sending_ip_address}lsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}"

create /etc/virtual/domainips in this format:
*:your server ip
your ip1:related domain1
your ip1:related domain2 (if you have multiple domain on an IP)
your ip2: related domain
and etc ...

create /etc/virtual/helo_data in tjis format:
your ip1:your related ptr
your ip2:your related ptr
and etc ...


restart exim.
Done!

Sorry for my bad English.

Regards,
Sergey
 
Last edited:
Smtp_banner

Hi Sergey

Thanks for your explanation.
I have one question.

I have 3 IP's
2 IP's are dedicated for 2 customers (2 domains) the main IP is for the rest of mij customers (VPS)

Should I add all the domains in the domainsip file?

Marco


Hi kaijidesign,

For me this solution works very good.
add it in the beginning of exim.conf

Code:
local_interfaces = your ip1 : your ip 2 : your ip3 : your ip 4 and etc ...
smtp_active_hostname = ${lookup{$interface_address}lsearch{/etc/virtual/smtp_active_hostnames}{$value}}
smtp_banner = "$smtp_active_hostname ESMTP $tod_full"

Dont forget create /etc/virtual/smtp_active_hostnames in this format:
your ip1:your related ptr
your ip2:your related ptr
and etc ...

now
in exim.conf find this lines:
remote_smtp:
driver = smtp

and immediately after that add:
Code:
interface = "${lookup{$sender_address_domain}lsearch{/etc/virtual/domainips}{$value}}"
helo_data = "${lookup{$sending_ip_address}lsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}"

create /etc/virtual/domainips in this format:
*:your server ip
your ip1:related domain1
your ip1:related domain2 (if you have multiple domain on an IP)
your ip2: related domain
and etc ...

create /etc/virtual/helo_data in tjis format:
your ip1:your related ptr
your ip2:your related ptr
and etc ...


restart exim.
Done!

Sorry for my bad English.

Regards,
Sergey
 
Hi Marco,

zEitEr's suggestion
Check this: https://www.directadmin.com/features.php?id=1692 and let DA to manage those 2 files:

/etc/virtual/domainips
/etc/virtual/helo_data
didn't work for me in my case but i think that it's a official and right DA solution.
My suggestion works great for my server in production many months.

If you have 3 ips. 2 dedicated and one server ip then you should set your /etc/virtual/domainips as below:
*:server ip
customer 1 ip:customer 1 domain
customer 2 ip:customer 2 domain
server ip:first related domain
server ip:second related domain
server ip:thired related domain
and etc ...

Best regards,
Sergey Popov
 
Back
Top