F
F
Fader2016-10-21 10:02:53
SMTP
Fader, 2016-10-21 10:02:53

How to send mail in Exim4 through different IPs?

There is a web-server with several IP. Each site has its own dedicated domain/IP.
Letters are sent from sites and need to be configured so that Exim correctly detects them and sends them from the correct IP.
Otherwise, Exim sends all mail from the IP of the main interface.
I believe that you need to make a regular match, because the configuration below can only specify 1 IP

remote_smtp:
driver = smtp
interface = <IP address>

We also need help - to compose the correct regular expression for helo_data.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2016-10-21
@Fader

stolen from exim configs in cPanel

interface = ${if exists {/etc/mailips}{${lookup{$original_domain}lsearch{/etc/mailips}{$value}{${lookup{$sender_address_domain}lsearch{/etc/mailips}{$value}{${lookup{${perl{get_sender_from_uid}}}lsearch*{/etc/mailips}{$value}{}}}}}}}}
  helo_data = ${if exists {/etc/mailhelo}{${lookup{$original_domain}lsearch{/etc/mailhelo}{$value}{${lookup{$sender_address_domain}lsearch{/etc/mailhelo}{$value}{${lookup{${perl{get_sender_from_uid}}}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}}}}}{$primary_hostname}}

file format:
/etc/mailhelo
10.10.10.10: domain1.com
10.10.10.11: domain2.com
*: domain3.com

/etc/mailips
domain1.com: 10.10.10.10
domain2.com: 10.10.10.11
*: 10.10.10.13

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question