php mail() function sends to internal mailserver regardless of MX entry for domain.

I host my site on the virtualmin server but the email is hosted with google. The email works fine from anywhere but my server, if i try to use mail() in php it tries to deliver the message locally. Is there a way to override this behaviour?




It’s no problem to host email elsewhere, but if you do that – you’d need to go into Edit Virtual Server -> Enabled Features, and disable the “Mail for Domain” feature. So long as that feature is set, Postfix will attempt to accept delivery for that email locally.


Thank you! I’ll go untick that little box now :slight_smile: