Hello,
I am trying to have Exim relay all mails with a destination suffix matching my hostname. I want this, because the hostname in question is only used for DNS and e-mail is actually to be delivered to Microsoft 365 for a specific set of usernames.
I did this by removing the hostname from /etc/virtual/domains and I restarted Exim. This makes sure that Exim won't treat the hostname as a local domain to deliver mail, but instead looks up the MX record (which exists) to deliver mail. This works.
Since Let's Encrypt will automatically re-add the hostname to /etc/virtual/domains when renewing the hostname certificate (why is this the case?), I have a cron script running to periodically check /etc/virtual/domains and remove the hostname from there if it exists and restart Exim. It retrieves the hostname from directadmin.conf, to allow for changing the hostname without having to change the entire script or having to think about it ever again. This works as well.
My question however is:
Should I expect this change to break key functionality within Directadmin or not?
I'm not sure. My Directadmin Users never contact each other by mail, by username using the hostname and they shouldn't: ideally they won't know of each other's existence. So there is no scenario in my head in which Exim should ever route user mail to local users via the hostname. But I just want to make sure that this won't break other functionalities that depend on the domains in /etc/virtual/domains or functionality of the system that routes messages using the server hostname.
Thanks for anyone's input,
Kenneth
I am trying to have Exim relay all mails with a destination suffix matching my hostname. I want this, because the hostname in question is only used for DNS and e-mail is actually to be delivered to Microsoft 365 for a specific set of usernames.
I did this by removing the hostname from /etc/virtual/domains and I restarted Exim. This makes sure that Exim won't treat the hostname as a local domain to deliver mail, but instead looks up the MX record (which exists) to deliver mail. This works.
Since Let's Encrypt will automatically re-add the hostname to /etc/virtual/domains when renewing the hostname certificate (why is this the case?), I have a cron script running to periodically check /etc/virtual/domains and remove the hostname from there if it exists and restart Exim. It retrieves the hostname from directadmin.conf, to allow for changing the hostname without having to change the entire script or having to think about it ever again. This works as well.
My question however is:
Should I expect this change to break key functionality within Directadmin or not?
I'm not sure. My Directadmin Users never contact each other by mail, by username using the hostname and they shouldn't: ideally they won't know of each other's existence. So there is no scenario in my head in which Exim should ever route user mail to local users via the hostname. But I just want to make sure that this won't break other functionalities that depend on the domains in /etc/virtual/domains or functionality of the system that routes messages using the server hostname.
Thanks for anyone's input,
Kenneth