Skip to main content

Force the correct MX record for remote delivery?

Comments

7 comments

  • cPanelMichael
    Hello @FM Kappungal, If you don't have control over the DNS for "example.com", then the best approach to this type of problem is to contact the email administrator for the remote domain and report the issue. Thank you.
    0
  • FM Kappungal
    Hi @cPanelMichael Thank you. I did send an email to the webadmin for that domain to rectify the faulty MX, but didn't get any response. That's why I'm looking for any workarounds to prevent my client's emails to that domain from bouncing. If I manually create a DNS zone for that domain and enter only the 4 working MX records, will that help? I would assume that cpanel first queries the local DNS before venturing outside right? The risk in that case would be that in case the original domain owners change their MX records or IP's, I wouldn't know. But is my thinking correct? Is there any other way of stopping cpanel from picking the faulty MX? Like some "do-not-send-to" blacklist? Any help is appreciated. Thanks
    0
  • cPanelMichael
    Hello @FM Kappungal, I don't have a specific example to provide, but you should be able to use the Exim manualroute feature for the purpose you are seeking: 20. The manualroute router [QUOTE]The manualroute router is so-called because it provides a way of manually routing an address according to its domain. It is mainly used when you want to route addresses to remote hosts according to your own rules, bypassing the normal DNS routing that looks up MX records.
    Let me know if this helps. Thank you.
    0
  • FM Kappungal
    Thanks for the suggestion Michael, What about your comments on my idea of creating a DNS zone for that domain on WHM with the preferred MX records?
    0
  • cPanelMichael
    What about your comments on my idea of creating a DNS zone for that domain on WHM with the preferred MX records?

    Hello @FM Kappungal, I don't believe that method will work because Exim will still check externally to see where the DNS for the domain is hosted. That said, let us know the outcome if you decide to test out that method. Thank you.
    0
  • FM Kappungal
    Hi Michael, Yes, you're right. It didn't work. Exim would still randomly end up targeting the faulty MX record of the lot. But thanks to your suggestion of manualroute, I was able to fix the problem. I added the following lines: example.com: driver = manualroute domains = example.com transport = remote_smtp route_list = example.com smtp1.example.com:smtp2.example.com:smtp3.example.com randomize I was tempted to try dkim_remote_smtp as the transport, but then decided to keep it simple. Thanks again Michael. However, out of academic interest, my questions that still remain: 1. Is there any similar Exim commands that will avoid a particular target host all together? 2. How can I modify the above lines to incorporate dkim for those sending domains that have dkim enabled? 3. Is there any method by which I can be alerted when the original nameserver for example.com ever changes their MX records? Because now that I have effectively hard-coded the MX records permanently for example.com, there is always a risk in case they ever make changes. Looking forward to your wise suggestions again. Thanks FMK
    0
  • cPanelMichael
    Hello @FM Kappungal, I'm glad to see the manualroute suggestion helped.
    . Is there any similar Exim commands that will avoid a particular target host all together?

    While you could likely explore additional methods of altering the DNS lookups from your system, using the Exim manualroute router seems like the best approach for this task.
    . How can I modify the above lines to incorporate dkim for those sending domains that have dkim enabled?

    You could temporarily try using "transport = dkim_remote_smtp" to see if this achieves the result you're looking for. Let me know if you encounter any issues with this method.
    . Is there any method by which I can be alerted when the original nameserver for example.com ever changes their MX records? Because now that I have effectively hard-coded the MX records permanently for example.com, there is always a risk in case they ever make changes.

    I see multiple results when searching for "monitor dns changes" on Google. One of those monitoring tools should offer the functionality you are looking for. Thank you.
    0

Please sign in to leave a comment.