Skip to main content

Configure EXIM to handle all forwards locally

Comments

10 comments

  • cPanelMichael
    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
  • PeteS
    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
  • mamoo108
    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
  • PeteS
    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
  • mamoo108
    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
  • andryangouw
    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
  • PeteS
    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
  • Infopro
    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
  • saadimam01
    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
  • PeteS

    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.