Well, it doesn’t matter how you’re sending the mail – if you have a Virtual Server on your system, with email at a third party, you’d need to make sure you unset the “Mail for Domain” feature for that domain.
On the virtual server, I have disabled “mail for domain”, and then I have a php mail() function that send an email to the same servername, in which I have google apps receiving them (which are not arriving).
I’m sending a link to the config and in the bottom the error showing that the mail is bounced because it loops back.
The “Mail loops back to myself” error means that the DNS MX record for a domain is pointing to your server, but that Postfix isn’t configured to receive email for that domain.
Is your DNS hosted at a third party?
If so, you would want to disable the “DNS Domain” feature for that domain in Virtualmin.
If your DNS for this domain is not hosted at a third party, but is setup on your Virtualmin server – that means you would need to setup an MX record that points to Google within Virtualmin.