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.

My smtp servers domain(origin) is xxx.com. When I try to email user51@xxx.com from smtp server, it does not deliver that mail since this user51 is not hosted on this smtp server. user51 has an google apps account with domain xxx.com

So I want smtp server to deliver mail remotely if that user is not hosted locally.

How is that possible with postfix?

partial main.cf

# mydomain
relayhost = $mydomain
# relay_domains
share|improve this question

migrated from superuser.com Nov 18 '11 at 1:29

This question came from our site for computer enthusiasts and power users.

3 Answers 3

up vote 2 down vote accepted

Try removing xxx.com or $myorigin from mydestination in main.cf

share|improve this answer

If the "real" xxx.com is pointed at Google Apps for email (ie, its MX records as the internet understands them are pointing at Googles email servers), then your local SMTP should not claim that it is a relay for that domain. It is incorrectly configured.

All you need to do is remove xxx.com as a domain from your smtp server.

If on the other hand, the real email server for xxx.com is your server, then it should correctly attempt to deliver locally and fail if the account doesn't exist.

You cannot have an email domain in two different places like this. You can have two different email servers that are valid recipients for a domains email, but once they take possession of the email it is up to them to ensure they cooperate and get it to the emailbox of the user.

share|improve this answer
    
xxx.com is pointed to google. I also changed hostname of smtp server to smtp.xxx.com, and removed xxx.com from domain of smtp server. So what do I need to send valid emails from my smtp server as xxx.com (noreply@xxx.com) –  Oguz Bilgic Nov 18 '11 at 1:25
    
Can you post the relayhosts and relay domains sections from your main.cf (sanitised) –  Paul Nov 18 '11 at 2:23
    
added to question. –  Oguz Bilgic Nov 18 '11 at 3:21
1  
$mydomain is set to the hostname fqdn minus the first part, so if your hostname is smtp.xxx.com then your are still saying you are a relayhost for xxx.com, so it will still try to deliver locally. –  Paul Nov 18 '11 at 3:38
    
what is the difference between mydomain and mydestination –  Oguz Bilgic Nov 19 '11 at 1:58

You can using transport.

main.cf
transport_maps = hash:/etc/postfix/transport

/etc/postfix/transport
user51@xxx.com smtpserver.google.com:25

Don't forget to postmap /etc/postfix/transport

share|improve this answer

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.