I have a virtualmin server on CentOS 6.3 (Final).
The domain’s email is hosted by Google so I don’t need to host email. However, the domain is a PHP domain that needs to send alert emails.
Don’t want to bore you with the script, but this is the command code:
echo mail(‘firstname.lastname@example.org’, ‘My Subject’, $message,$headers) or die(‘boo’);
And email doesn’t go out.
So, I used my own syntax from the bash prompt:
mail -s “Test” email@example.com
And I see the following error in maillog:
Nov 20 05:11:35 dev postfix/pickup: B2F04DF85: uid=502 from=
Nov 20 05:11:35 dev postfix/cleanup: B2F04DF85: message-id=20121120101135.B2F04DF85@dev.hostname.com
Nov 20 05:11:35 dev postfix/qmgr: B2F04DF85: firstname.lastname@example.org, size=438, nrcpt=1 (queue active)
Nov 20 05:11:35 dev postfix/error: B2F04DF85: email@example.com, relay=none, delay=0.12, delays=0.08/0.01/0/0.03, dsn=5.0.0, status=bounced (User unknown in virtual alias table)
Nov 20 05:11:35 dev postfix/cleanup: C74AADF8B: message-id=20121120101135.C74AADF8B@dev.hostname.com
Nov 20 05:11:35 dev postfix/bounce: B2F04DF85: sender non-delivery notification: C74AADF8B
Nov 20 05:11:35 dev postfix/qmgr: C74AADF8B: from=<>, size=2210, nrcpt=1 (queue active)
Nov 20 05:11:35 dev postfix/qmgr: B2F04DF85: removed
Nov 20 05:11:36 dev postfix/local: C74AADF8B: firstname.lastname@example.org, relay=local, delay=0.38, delays=0.02/0.01/0/0.34, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Nov 20 05:11:36 dev postfix/qmgr: C74AADF8B: removed
main.cf has the hostname as dev.hostname.com
Oh, and during the script being tested “Mail for domain” was enabled. But I read somewhere on the forum that it needs to be enabled to handle inbound mail. So, I disabled “Mail for domain”. Restarted postfix manually on the server as well. Nogo.
Hmm, did you send that message to “email@example.com”, or “firstname.lastname@example.org”?
It looks as if it’s trying to deliver to “email@example.com”.
But yeah, as you mentioned – the Mail for Domain feature would need to be disabled for any Virtual Server that isn’t hosting email locally.
The same goes for DNS – if you’re not using your server as a nameserver, you would want to disable the “DNS Domain” feature.
If you are using your server as a nameserver, you’d want to make sure that the MX records are setup to point to your actual mail server, rather than your Virtualmin server.
Sending it to firstname.lastname@example.org and I see it’s sending it to email@example.com, don’t know why…
“Hostname” is a placeholder for the hostname of your server?
If Postfix changes the destination host like that, there has to be some kind of rewrite/redirect configured in Postfix. I don’t know its intricacies well enough to say “it must be there or there”. So you might want to go through its configuration, either in Webmin’s GUI, or by grepping for “hostname.com” in all files in
/etc/postfix, to see if there is any kind of mapping that might cause this redirection.
Yes, hostname is a fictitious name for the real hostname I have on our server, for privacy reasons.
Okay, did you check your Postfix config like I suggested?
grep "yourhostname" /etc/postfix/* should turn up something.
It’s in main.cf as:
mydestination = $myhostname, localhost.$mydomain, localhost,