Exim customization to allow multiple domain to send mail on their dedicated IP

jadmin

New member
Joined
Nov 17, 2014
Messages
4
Hi,

I am managing a server hosting several domains each of them having its dedicated IP different from the server IP.

In order to avoid any impact on other domains or an the whole server of possible blacklisting of one IP, I would like to make sure that each domain uses its own IP to send mail and that the server IP or any server related info (host name, DA user name, …) does not appear in the message header or in the smtp HELO answer.

I am not sure of what are the EXIM configurations which need to be made to achieve that.

I have found various posts related to that but none seems to give the full answer, the more elaborate I have located are related to a cpanel environment and point to cpanel functions which do not seem to exist in DA:
http://forums.jaguarpc.com/dedicated-servers/17391-exim-customization.html
http://forums.deftechgroup.com/showthread.php?t=3018

Can somebody provide me the full description of what needs to be done or direct me to a link providing that?

Thanks in advance for your help.
 
This I used
Ex main server ip : 173.252.192.172
Edit exim.conf

...
remote_smtp:
driver = smtp
interface = ${lookup{$sender_address_domain}lsearch{/etc/exim.interface}{$value}{173.252.192.172}}
...

create file /etc/exim.interface
And fill with format
domain : Dediip
Ex.
Mydomain.com : 173.252.192.174
custdomain.com : 173.252.192.173
 
Thanks for the feedback defomaz,

My Exim version is: 4.83
My DirectAdmin version is: 1.43.0
My Centos version is: 5.3

First let correct the link to the cpanel realted post I mentioned in my message, tha correct link is:
https://documentation.cpanel.net/display/CKB/How+to+Change+the+Sending+IP+for+Outbound+Email+in+Exim

Now, let me try to clarify my question and summarize what I understand from the various posts I read (no guarantee!) or do not understand:
What needs to be done is:

1- Create two text files
First file (IP -> domain): /etc/domainips
Format is:
IP: domain
xx.xx.xx.xx: addomain.com
yy.yy.yy.yy: anotherdomain.com
etc...
Second file (domain -> IP): /etc/domainips_reverse
Format is:
domain: IP
adomain.com: xx.xx.xx.xx
anotherdomain.com: yy.yy.yy.yy

2-For incoming connections modify the hello message seen by clients and confirms they are connected to the correct server/domain.
Under the line containing "perl_startup" add:
:
smtp_active_hostname = ${lookup{$interface_address}lsearch{/etc/domainips}{$value}{$primary_hostname}}
message_id_header_domain = $smtp_active_hostname
Question: do we need to keep the full line as it is before adding those lines below it? (perl_startup = do '/etc/exim.pl' in my case)
And then change the line containing smtp_banner to:
smtp_banner = "${smtp_active_hostname} ESMTP Exim ${version_number}
\
Question: I do not find this line in my exim conf file, do I need to add this line? Where?At the beginning of the conf file?


3-For outgoing connections
Change
remote_smtp:
driver = smtp
to
remote_smtp:
driver = smtp
interface = ${lookup{$sender_address_domain}lsearch{/etc/domainips_reverse}{$value}{$interface_address}}
helo_data = ${lookup{$interface_address}lsearch{/etc/domainips}{$value}{$primary_hostname}}

(Similar to solution used by defomaz)

4-For received lines
Under "smtp_banner" string add the following:

received_header_text = Received: \
${if def:sender_rcvhost {from $sender_rcvhost\n\t}\
{${if def:sender_ident \
{from ${quote_local_part:$sender_ident} }}\
${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\
by $smtp_active_hostname \
${if def:received_protocol {with $received_protocol}} \
${if def:tls_cipher {($tls_cipher)\n\t}}\
(Exim $version_number)\n\t\
${if def:sender_address \
{(envelope-from <$sender_address>)\n\t}}\
id $message_exim_id\
${if def:received_for {\n\tfor $received_for}}
Same question as above: I do not find this line in my exim conf file. Where do I need to add this? I guess after the line added above
Does that seem correct?
This does not seem to include the piece driven by the /etc/mailhelo file mentioned in the cpanel related solution in the link quoted above

Is it all we need to do to insure each domain manages mail with its own IP and domain name not mentioning server IP or other server information in the headers or the HELO
 
Back
Top