Configure EXIM to handle all forwards locally
To use AWS SES as SMTP for all non-local mail I have this configured in the PREROUTERS section of the EXIM config file:
send_via_ses:
driver = manualroute
domains = ! +local_domains
transport = ses_smtp
route_list = * email-smtp.us-west-2.amazonaws.com;
I would like to also restrict it from sending forwards set up in accounts on the server to SES. So in the same way that domains = ! +local_domains prevents local mail from routing to SES, I need a conditional statement that would also prevent all forwards from being sent through SES. But I can't find an answer anywhere-probably because I don't know what I'm looking for.
Any help would be appreciated. Thanks.
-
Hi Pete, The Exim user's mailing list is often a good resource for these types of custom Exim configuration settings: Also, while not exactly related to what you want to setup, there are some useful overall examples of smarthost configurations you may find helpful at: Thank you. 0 -
Thanks. I have a thread at the EXIM mailing list as well, but so far no response the concept of blocking forwards from a smarthost router. Hoping for something here - I can't imagine I'm the first to want to handle forwards separately. (I'll post a solution here if I find one elsewhere.) 0 -
Did you end up finding a solid solution for this? I think I have the same setup. It's a shame ses can't forward the emails for us. You can do this manually each time like this: send_via_ses: driver = manualroute domains = ! +local_domains condition = ${if !eqi{$local_part@$domain}{EMAILADDRESS}} condition = ${if !eqi{$local_part@$domain}{EMAILADDRESS2}} transport = ses_smtp self = send route_list = * localhost Where EMAILADDRESS is the email you are forwarding to (your gmail) Can someone please post here if you find a dynamic way to do this. 0 -
Did you end up finding a solid solution for this? I think I have the same setup. It's a shame ses can't forward the emails for us. ... Can someone please post here if you find a dynamic way to do this.
Thanks for bumping me. I have a solution that appears to work but I got bogged down with other things and didn't test it extensively yet. Here's the link to the relevant part of the EXIM list thread, and what I have so far... Integrating Amazon SES with Exim - Amazon Simple Email Service). The problem is that forwards from off server senders fail (are rejected by AWS SES). Then in the prerouters section I use this, and it appears to do what I want: PREROUTERS send_via_ses: driver = manualroute domains = ! +local_domains condition = ${if match_domain{$sender_address_domain}{+local_domains}} transport = ses_smtp route_list = * email-smtp.us-west-2.amazonaws.com; Domain = sends local recipient mail to the local router that follows this one. Condition = sends mail from a non-local sender (only the case when a non-local sender sends to an alias) to the local router that follows this one. So only outgoing mail from a local sender to a non-local recipient goes to SES. I would be interested in how this works for others.0 -
Awesome! That looks like it's working perfectly. Thanks so much for posting that. Will let you know here if I find any caveats with it. :) 0 -
Thanks, I was looking for a similar case where smarthost needs to be ignored for valiases or forwards routing. This line seems to do the trick, but it has a typo. I added it to my routers configuration (I have them in ROUTERSTART section, instead of PREROUTERS). [QUOTE]condition = $if{match_domain {$sender_address_domain}{+local_domains}}
The correct one is [QUOTE]condition = ${if match_domain{$sender_address_domain}{+local_domains}}0 -
Thanks, I was looking for a similar case where smarthost needs to be ignored for valiases or forwards routing. This line seems to do the trick, but it has a typo. I added it to my routers configuration (I have them in ROUTERSTART section, instead of PREROUTERS). The correct one is
Thanks for catching that. Just curious, did it cause an error, just not work, or work even with the incorrect syntax? (I ask because I'm currently not using the AWS SES and can't test, but I thought it was working and I used cut/paste to post here.) @cPanelMichael Could you edit the code in my post? I can't seem to find the edit function.0 -
I've updated your post for you. The Edit button is on the bottom right corner of your posts, tools menu, but it's only available for 24 hours from posting I believe. 0 -
Dear PeteS, I have followed the same PRE Route for my exim configuration. The issue is that my domain is verified inside Amazon SES but the email is not generated inside the cPanel as it is part of Gsuit. Previously emails were rejected with 554 error but now it is getting deferred. Can you please suggest what I'm missing ? 0 -
Sorry, I know this is quite late, but we abandoned using SES for a variety of reasons, so I don't have anything further to offer.
0
Please sign in to leave a comment.
Comments
10 comments