Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Can you show the output of postconf -n? –  bahamat Sep 8 '11 at 5:50
add comment

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

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

1 Answer

up vote 1 down vote accepted

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".

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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