Re: [exim] send mail based on origin domain

Pàgina inicial
Delete this message
Reply to this message
Autor: Phil Pennock
Data:  
A: Nicolas Leonel
CC: exim-users
Assumpte: Re: [exim] send mail based on origin domain
On 2018-02-01 at 13:32 -0300, Nicolas Leonel via Exim-users wrote:
> Im using Sendgrid to send out email through my exim server, it uses a
> remote SMTP host, port, username and password for sending email. The
> problem is that now I would like to segment my delivery through multiple
> SMTP users, aka SendGrid Sub-users.
>
> It appears I can do this by either using their API or through the MTA which
> I believe would be easier to implement, my question is does anyone know how
> to specify a certain SMTP user and password depending on the domain used to
> send the email from?


Yes. This post might help:

https://lists.exim.org/lurker/message/20171015.030553.5600347d.en.html

The two censored-for-web email addresses in the sample config extract
were `xyz@???` and `zyx@???`.

In essence: in the Router, use a lookup of `$sender_address` in some
data-source to get space-separated key=value pairs and stash that with
the `address_data` option, then refer to `$address_data` in the
Transport via `${extract{keyname}{$address_data}{true-val}{false-val}}`
to get the values of various options.

-Phil