9

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!

drewag
  • 311

1 Answers1

11

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

drewag
  • 311