I'm trying to send an email, through PHP, to an info@ account for the site. The mail function returns true, but the email fails to send.

The server is CentOS 5, and is utilizing postfix for the SMTP server. I can see that the message is added to the queue, but then fails with a "User unkown in virtual alias table" error. After reading the Virtual Readme file, I think postfix is trying to deliver the message locally, because the sending server and the host server of the domain are the same.

The mail is hosted with Google, and I would like to have the mail for the info@ account be delivered there instead of on the local server. How do I configure postfix to do this?

migrated from stackoverflow.com Sep 8 '11 at 2:07

This question came from our site for professional and enthusiast programmers.

  • Can you show the output of postconf -n? – bahamat Sep 8 '11 at 5:50

If you try to send a mail for info@example.com and the domain example.com is at Googlemail then you are not allowed to mention example.com in mydestination= and in virtual_domains=. Otherwise Postfix thinks it should deliver the mail locally. But you want Postfix to relay the mail externally.

And exactly this is described in section "Canonical versus hosted versus other domains".

  • The domain was listed in the virtual_alias_maps file. I made sure it was not listed in mydestination=, but misunderstood how virtual aliases worked when I read the documentation. Cheers. – emarcee Sep 14 '11 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.