I’ve just had a server die that was running Virtualmin, so I deployed the server in pretty much the same fashion as the old one. However there is something odd this time with emails.
One of the scripts I wrote would happily send emails out to my gmail account but not to any email addresses that were hosted on the server.
I suspect Postfix is attempting local delivery of the emails and simply throwing them on the floor somewhere. I performed a yum erase postfix and sendmail delivers the emails fine. However, try using Virtualmin to set up the Virtual hosts and it needs postfix installed.
Can someone advise how to either get virtualmin to work without postfix or to get postfix to not locally deliver any emails and behave like sendmail?
You may want to take a peek in the email logs, either /var/log/maillog or /var/log/mail.log, whenever trying to send a message. You can use that to track down what’s going on.
Also, if there’s any glaring configuration issues, they may show up when going into Virtualmin, and running System Settings -> Re-Check Config.
So are you saying that the MX record for one particular domain points to an external server?
If that’s the case, you would need to uncheck the “Mail for Domain” feature in “Edit Virtual Server”.
When that is set, that means Postfix is configured to deliver email locally.
It only works on Sendmail, because Virtualmin wasn’t configured to use Sendmail when the Virtual Server was added.
But, if a particular domain doesn’t have local email addresses – you’d want to disable the Mail for Domain feature… once you do that, email should go through correctly.