[Pkg-exim4-users] enforce specific outgoing IP
Markus Gschwendt
markus+debianexim at runout.at
Wed Apr 4 13:43:57 BST 2018
Hello!
I serve several domains with the same Exim4.
For some reasons [0] and even for IPv6 [1] i'd like to use a specific
outgoing IP per domain.
I found a very easy solution and i'd like to ask if this or similar
could be integrated in the debian package, as i'd like to integrate it
in Vexim [2] but don't want to change the original transports and i'm
sure this will help other people too:
for the config:
/etc/exim4/conf.d/main/00_vexim_listmacrosdefs
#set outgoing IP addresses default value
OUTGOING_IP_DEFAULT = 10.0.0.1 ; 2002::19
# example for using vexim [2] database [3]
# but this could be done via a file lookup too
OUTGOING_IP_ADDRESSES = ${lookup
mysql{VEXIM_OUTIP}{$value}{OUTGOING_IP_DEFAULT}}
and in 2 transports:
/etc/exim4/conf.d/transport/30_exim4-config_remote_smtp
/etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost
.ifdef OUTGOING_IP_ADDRESSES
interface = <; OUTGOING_IP_ADDRESSES
.endif
Maybe there is a better way to set the default IP addresses.
Markus
[0] Different customers, bulk mail, ...
[1] If the server has several IPv6 addresses its important to make sure
that the outgoing IP is the same as specified in the DNS records.
[2] Vexim
https://github.com/vexim/vexim2
https://github.com/runout-at/vexim2-2016/tree/runout-at-outip
[3] Vexim Database
Needs an additional field in table domains:
`out_ip` varchar(255) NOT NULL DEFAULT '',
Query:
VEXIM_OUTIP = SELECT DISTINCT out_ip FROM domains \
WHERE domain = '${quote_mysql:$sender_address_domain}' \
AND out_ip <> TRIM('')
More information about the Pkg-exim4-users
mailing list