[Pkg-exim4-users] How to choose a smarthost based on From: address in Exim4

Marc Haber mh+pkg-exim4-users at zugschlus.de
Mon Mar 20 15:57:57 GMT 2023


On Mon, Mar 20, 2023 at 11:09:01AM -0400, Ian Kelling wrote:
> I don't know what Marc Haber is talking about, but I don't think there
> are any issues. I have my workstation's exim setup to go to various
> smarthost based on the rcpt from address. That has worked well for
> years for me. Doing it that way would handle bounces, using the from
> header wouldn't. here is an example:

I think you mean the MAIL FROM address. There is no such thing like a
RCPT FROM address.

> dd of=/etc/exim4/conf.d/router/188_exim4-config_smarthost <<'EOF'
> # ian: copied from /etc/exim4/conf.d/router/200_exim4-config_primary, and added senders = and
> # replaced DCsmarthost with hostname
> fsfsmarthost:
>   debug_print = "R: smarthost for $local_part@$domain"
>   driver = manualroute
>   domains = ! +local_domains
>   senders = *@fsf.org
>   transport = remote_smtp_smarthost
>   route_list = * mail.fsf.org::587 byname
>   host_find_failed = ignore
>   same_domain_copy_routing = yes
>   no_more
> 
> posteosmarthost:
>   debug_print = "R: smarthost for $local_part@$domain"
>   driver = manualroute
>   domains = ! +local_domains
>   senders = *@posteo.net
>   transport = remote_smtp_smarthost
>   route_list = * posteo.de::587 byname
>   host_find_failed = ignore
>   same_domain_copy_routing = yes
>   no_more
> EOF

That one doesn't scale well beyond a handful of source addresses, and it
needs considerable knowledge of exim's configuration to grok this.

Just out of curiosity, how does your password file (in Debian that would
be /etc/exim4/passwd.client) look like? Be sure to edit out the actual
passwords before pasting.

To explain a bit, mail.fsf.org has a single IPv4 and a single IPv6
address that both resolve back to mail.fsf.org. Giving "mail.fsf.org" in
passwd.client is expected to work with that.

The fun begins with posteo, they have in total 6 IP addresses for
posteo.de in DNS, none of which having meaningful reverse DNS. I'd
expect exim to refuse authentication to those hosts.

Disclaimer: I have never used SMTP AUTH for machines that are not under
my control, and I pay attention to proper reverse DNS, so I don't know
how picky exim is with hosts that are as badly set up as posteo seems to
be.

If you have experience with getting this to work AND are willing to take
the heat of users complaining about their setups not working after
copying your configuration, please by all means get involved and help us
by writing documentation that the Debian exim4 team can include in the
package. Up to today, noone has accepted that challenge, that's why
things are they are today.

Greetings
Marc


-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421



More information about the Pkg-exim4-users mailing list