Bug#314767: exim4-config: possible code for sender-dependent smarthost

Marc Haber Marc Haber <mh+debian-bugs@zugschlus.de>, 314767@bugs.debian.org
Sat, 18 Jun 2005 15:03:53 +0200


Package: exim4-config
Version: 4.50-8
Severity: wishlist

Most Free-E-Mail services want to see their own address in the
envelope sender of submitted messages. The following (untested!)
config snippet reads a table and chooses the smarthost depending on
the envelope sender of a message.

smarthost_list:
  debug_print = "R: smarthost list for $local_part@$domain"
  driver = manualroute
  domains = ! +local_domains
  senders = wildlsearch;CONFDIR/sender.smarthost
  transport = remote_smtp_list
  route_list = * ${lookup{$sender_address}wildlsearch{CONFDIR/sender.smarthost}}
  host_find_failed = defer
  same_domain_copy_routing = yes
  no_more

Transport:
remote_smtp_list:
  debug_print = "T: remote_smtp_list for $local_part@$domain"
  driver = smtp
  hosts_try_auth = ${lookup{$sender_address}wildlsearch{CONFDIR/sender.smarthost}}

/etc/exim4/sender.smarthost:
*@gmx.de        mail.gmx.net
*@nurfuerspam.de        mail.gmx.net

If anybody using multiple free-mail servers, please test.

Greetings
Marc