My exim relays all its incoming email to third-party smtp relays. They use smtp authentication (username/password).
It seems I can only define ONE username/password in the begin authenticators
section of the Exim config. I want to route certain email through one relay (with its own username/password auth), and other email through a second relay (its username/password auth is different than the first).
Here's much of my config. The begin routers
relays domains in the +local_domains
list to smtp-relay-1
and the rest relays to smtp-relay-2
.
begin routers
my_domains_relay:
debug_print = "R: my_domains_relay for $local_part@$domain"
driver = manualroute
domains = +local_domains
transport = remote_smtp_smarthost
route_list = * "<+ smtp-relay-1.example.com:465"
host_find_failed = defer
no_more
smart_host_relay:
debug_print = "R: smart_host_relay for $local_part@$domain"
driver = manualroute
transport = remote_smtp_smarthost
route_list = * "<+ smtp-relay-2.example.net:465"
host_find_failed = defer
no_more
begin transports
remote_smtp_smarthost:
debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
driver = smtp
port = 465
hosts_require_tls = *
hosts_require_auth = *
protocol = smtps
begin authenticators
login:
driver = plaintext
public_name = PLAIN
client_send = ^my-username^top-secret-password
What I want is to define separate username/password auth in the begin authenticators
section, and assign each to a single router/transport. Right now, the username/password auth is global and used for all relays.
The exim documentation says it matches the public_name with an advertised authentication by the server. So if both my smtp relays advertise as AUTH PLAIN
then they both use that one authenticators username/password in the config. I'm hoping there's a setting that allows me to link an authenticators instance with a specific router/transport, but I don't see how.