Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My smtp servers domain(origin) is When I try to email 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

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

How is that possible with postfix?


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

migrated from Nov 18 '11 at 1:29

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

up vote 2 down vote accepted

Try removing or $myorigin from mydestination in

share|improve this answer

If the "real" 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 as a domain from your smtp server.

If on the other hand, the real email server for 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 is pointed to google. I also changed hostname of smtp server to, and removed from domain of smtp server. So what do I need to send valid emails from my smtp server as ( – Oguz Bilgic Nov 18 '11 at 1:25
Can you post the relayhosts and relay domains sections from your (sanitised) – Paul Nov 18 '11 at 2:23
added to question. – Oguz Bilgic Nov 18 '11 at 3:21
$mydomain is set to the hostname fqdn minus the first part, so if your hostname is then your are still saying you are a relayhost for, 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.
transport_maps = hash:/etc/postfix/transport


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

share|improve this answer

Your Answer


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.