local email server picking up emails to own domain

Our virtualmin domain has email enabled which enable the website to email users after registration etc…

Our mx record point to google apps where we host our email.

The problem arrises when the website sends a message to anyone@ourdomain.com. The site sends the mail via localhost and the local mailserver server picks up the mail and puts in the the local mailbox rather than delivering it to the MX address.

We want to leave email enabled on the webserver to continue sending mail from the site.

Does this involve setting up email routing or should the MX records be enough?


That’s what would happen if the “Mail for Domain” feature may be enabled, which would cause Postfix to deliver those emails locally.

You don’t need that feature to be able to send email from your server – that’s only necessary for receiving email.

You can disable that in Edit Virtual Server -> Enabled Features.