I'm trying to setup Exim with Amazon's SES. I've defined a router that catches all emails and sends them through SES. I don't want to filter anything for outboud. Everything goes through SES. My router config is the following:
begin routers
aws_ses:
debug_print = "R: aws_ses for $local_part@$domain"
driver = accept
require_files = AWS_SES_SEND_EMAIL : AWS_CREDENTIALS_FILE
transport = aws_ses_pipe
no_more
It's working great except for one problem. Whenever I get any inbound email, Exim also tries sending them through SES. That's the problem. Local emails should be caught by Exim. I tried adding this just before my aws_ses router but it's not working. Exim still uses the aws_ses router for inbound emails to mydomain.com
localusers:
driver = accept
domains = mylocaldomain.com
transport = virtual_userdelivery
So, how do I make Exim send all outbound emails through aws_ses router but at the same time, tell it to catch all inbound mails to mydomain.com so that it can be delivered to the user's mailboxes?
Thanks.
p.s. You can see the complete configuration on the tutorial I've put together. The relevant configs are pasted in this question though.