Super User is a question and answer site for computer enthusiasts and power users. 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

I recently setup a mail server following the instructions on linode.com (https://library.linode.com/email/postfix/postfix2.9.6-dovecot2.0.19-mysql) except I am using postgreSQL instead of mySQL.

Everything about the server is working properly except that I am unable to send email to external addresses from my mail client (Mac Mail). When I try to send a message to an external address, I get the following error from postfix:

NOQUEUE: reject: RCPT from comcast.net[174.51.xxx.xx]: 554 5.7.1 <user@somewhere.external.com>: Relay access denied; from=<user@mydomain.com> to=<user@somewhere.external.com> proto=ESMTP helo=<[10.0.0.15]>

(Note I redacted the from ip address)

I have it configured to use dovecot as the authentication mechanism. In the dovecot logs I get:

Oct 23 16:44:31 auth: Debug: client in: AUTH    2   PLAIN   service=smtp    nologin lip=50.116.xx.xx    rip=174.51.xxx.xx   secured resp=<hidden>
Oct 23 16:44:31 auth: Debug: sql(user@mydomain.com,174.51.xxx.xx): query: SELECT email as user, password FROM virtual_users WHERE email='user@mydomain.com';
Oct 23 16:44:31 auth: Debug: client out: OK 2   user=user@mydomain.com

So it seems like dovecot is approving the username and password but postfix is still treating it like it has been rejected. Does anyone have an idea of what is going on or a way I can debug this further?

Thanks!

share|improve this question
up vote 9 down vote accepted

I was able to fix my problem by changing the postfix main.cf configuration to read:

smtpd_relay_restrictions = 
    permit_mynetworks 
    permit_sasl_authenticated 
    defer_unauth_destination

instead of using smtpd_recipient_resrictions

It turns out that after postfix 2.10.0, smtpd_relay_restrictions should be used instead of smtpd_recipient_restrictions. (smtpd_recipient_restrictions should now only be used for spam restrictions).

For more info: http://de.postfix.org/ftpmirror/official/postfix-2.10.0.RELEASE_NOTES

share|improve this answer
    
Does this mean we have to remove smtp_recipient_restrictions section? It seems that my main.cf configuration file has both... @drewag – CoderSpinoza Jan 20 at 4: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.