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 get the following error trying to send an email to my Google Apps Email at admin@mydomain.com from my Postfix server.

to=, relay=local, delay=0.09, delays=0.07/0/0/0.02, dsn=5.1.1, status=bounced (unknown user: "admin")

Is there a way I can force it to not use the LOCAL relay and treat admin@mydomain.com as outside email and not look for a user in the current postfix configuration.

I am trying to email the full email address "admin@mydomain.com" not only "admin".

I have the Google Apps MX record on mydomain.com + SPF record which before was:

v=spf1 include:_spf.google.com ~all (emailing to admin@mydomain.com used to work with that record)

But I had to change it to v=spf1 a mx ip4:MY.IP.HERE include:_spf.google.com ~all

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Yes you can. Don't use admin as the recipient. Use something that is "outside" like admin@mydomain.com.

This only works if mydomain.com is not the domain configured in Postfix. Because Postfix thinks everything is local when you configured it to be local.

You should provide WAY more information than "it doesn't work". What are your configured domains, relay hosts, transport maps, MX records and the like?

share|improve this answer
    
I have only one configured domain "mydomain.com", no other fancy stuff that is not out of the box Postfix. –  Ivo Sabev Aug 15 '11 at 18:46
    
And there is the problem. You told "mydomain.com" belongs to Postfix. But then you want that domain to be outside. That does not fit. –  mailq Aug 15 '11 at 18:54
1  
I am a bit confused on the matters related to postfix :) I fixed the issue by not setting the mydestination param in main.cf –  Ivo Sabev Aug 15 '11 at 19:00
    
Fine. That is what I proposed. –  mailq Aug 15 '11 at 19:04
2  
Nothing more easy than that! Set it to myhostname = thehost.mydomain.com. That's why it is called myhostname and not mydomainname. –  mailq Aug 15 '11 at 19:09

Set the fallback_transport variable to relay , that way it'll send it to Google or whatever server it should, if doesn't find the user locally.

If you never want the mail to be sent to a local user change the mydestination variable to localhost , that way it'll only forward locally email addresses ending in .localhost

It would look like that in your main.cf file:

mydestination = localhost.localdomain, localhost
fallback_transport = relay
share|improve this answer
    
Would you literally type in 'localhost.localdomain, localhost'? Or would you substitute 'localdomain' with the actual domain? –  pgunston Dec 10 at 1:39

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.