I am attempting to configure exim4 under Debian 6 or 7 as follows:
- For mails being forwarded for a "virtual" domain, send directly via SMTP
- For all other mails, send via Amazon SES
The first bullet seems necessary because SES will not allow the sending of a message whose "From" address does not match a valid configured domain for that AWS account (if anybody does know a way to do this with SES, that would be a preferred solution, although I am pretty sure it is not possible).
So, right now this system works fine with SES; everything sends correctly, exim is configured correctly, etc. From that point, I defined a some new virtual domain I'd like to forward for, for example in /etc/exim4/virtual/example.com
:
user : [email protected]
I then created a new router, for example /etc/exim4/conf.d/router/090_exim4-config_virtual_redirect
containing:
sender_redirect:
driver = redirect
domains = dsearch;/etc/exim4/virtual
data = ${lookup{$local_part}lsearch{/etc/exim4/virtual/$domain}}
So far, this works fine -- exim attempts to relay messages addressed to [email protected]
to [email protected]
instead, but it fails because of the SES restriction mentioned above.
At this point, I want this router to send messages directly server-to-server, without affecting the sending of any other mails on the server.
Is this possible? I have a feeling there is one small addition I am missing here, but I haven't been able to find it.