Migrated Virtualmin to another server with different hostname, now email is bouncing

Hello, I migrated my virtualmin server to another server and in the process I changed it’s hostname.

Now whenever I try to send emails to a domain registered in virtualmin (i’m using google docs to handle emails) emails get bounced back.

This is the message from the log:

Dec 7 12:54:19 pesto postfix/pickup[20488]: 60B9A1E202C: uid=508 from= Dec 7 12:54:19 pesto postfix/cleanup[21105]: 60B9A1E202C: message-id=<20131207125419.60B9A1E202C@meh.ovelha.org> Dec 7 12:54:19 pesto postfix/qmgr[20489]: 60B9A1E202C: from=, size=712, nrcpt=1 (queue active) Dec 7 12:54:19 pesto postfix/error[21107]: 60B9A1E202C: to=, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.0.0, status=bounced (User unknown in virtual alias table) Dec 7 12:54:19 pesto postfix/cleanup[21105]: 634ED1E202D: message-id=<20131207125419.634ED1E202D@meh.ovelha.org> Dec 7 12:54:19 pesto postfix/bounce[21108]: 60B9A1E202C: sender non-delivery notification: 634ED1E202D Dec 7 12:54:19 pesto postfix/qmgr[20489]: 634ED1E202D: from=<>, size=2505, nrcpt=1 (queue active)

any ideas on how to fix that?



So just to clarify, are you saying that the email is hosted externally (over at Gmail)?

If so, it appears as if Postfix thinks the email is local, and is trying to deliver it to your server.

That may mean that the Mail for Domain feature is enabled.

If email is hosted at a third party, you would want to go into Edit Virtual Server -> Enabled Features, and disable the Mail for Domain feature.


But i’m still using the php’s mail() function to send email from website forms,
what would the best way to tackle this be?

thank you eric!

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.



Dec 8 04:06:21 pizza postfix/cleanup[18182]: BC8EE120C42: message-id=<20131208040621.BC8EE120C42@meh.ovelha.org> Dec 8 04:06:21 pizza postfix/qmgr[13168]: BC8EE120C42: from=, size=712, nrcpt=1 (queue active) Dec 8 04:06:21 pizza postfix/smtp[18184]: BC8EE120C42: to=, relay=none, delay=0.04, delays=0.03/0.01/0/0, dsn=5.4.6, status=bounced (mail for fazendarioencantado.com.br loops back to myself) Dec 8 04:06:21 pizza postfix/cleanup[18182]: C7D6F120C44: message-id=<20131208040621.C7D6F120C44@meh.ovelha.org> Dec 8 04:06:21 pizza postfix/bounce[18185]: BC8EE120C42: sender non-delivery notification: C7D6F120C44 Dec 8 04:06:21 pizza postfix/qmgr[13168]: C7D6F120C44: from=<>, size=2575, nrcpt=1 (queue active)


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.


Thank you Eric, it worked perfect!!!