NOQUEUE: reject: Relay access denied

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" target="_blank">](https://library.linode.com/email/postfi … 0.19-mysql">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= 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!

6 Replies

I actually just figured out the problem.

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/officia … EASE_NOTES">http://de.postfix.org/ftpmirror/official/postfix-2.10.0.RELEASE_NOTES

Thanks for posting; this change in Postfix is good to know.

I would recommend verifying that your new configuration does not allow others to relay mail through your machine. The tester I used to use seems to be shut down; a search for "open relay test" turns up several choices, but some of these look shady. I don't know of a specific one to recommend.

Thank you Vance for the suggestion, I didn't know there were tests for such a thing. I don't actually even leave port 25 open on my server so none of the tests I tried worked as is. However, just to be sure about the setting, I opened up port 25 and ran the open relay test at http://mxtoolbox.com/diagnostic.aspx. It confirmed that my server is not acting as an open relay.

I have the same problem, BUT:

My postfix version in 2.9.6, like in the tutorial I followed : https://library.linode.com/email/postfi … 0.19-mysql">https://library.linode.com/email/postfix/postfix2.9.6-dovecot2.0.19-mysql

1. if I change "smtpddestinationrestrictions" to "smtpdrelayrestrictions" I get errors when I restart Postfix:

service postfix restart

  • Stopping Postfix Mail Transport Agent postfix /usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

[ OK ]

  • Starting Postfix Mail Transport Agent postfix postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpdrelayrestrictions=permitsaslauthenticated,permitmynetworks,rejectunauth_destination

[ OK ]

2. The problem is: I can receive mail in my mail client from gmail, yahoo or hotmail, I can send mail from command line ( and my gmail email test address receives mail from root@mydomain.com ) but I cannot send email from my mail client ( Outlook ). NOTE: I can send an email to myself via Outlook email client.

The /var/log/mail.log output is:

Apr 2 17:43:56 mail postfix/smtpd[5013]: warning: hostname xx-xxx-xx-xxx.ispdomain.tld does not resolve to address xx.xxx.xx.xxx: Name or service not known

Apr 2 17:43:56 mail postfix/smtpd[5013]: connect from unknown[xx.xxx.xx.xxx]

Apr 2 17:43:56 mail postfix/smtpd[5013]: NOQUEUE: reject: RCPT from unknown[xx.xxx.xx.xxx]: 554 5.7.1 <testuser@yahoo.com>: Relay access denied; from=<myaddress@mydomain.com> to=<testuser@yahoo.com> proto=ESMTP helo= Apr 2 17:43:59 mail postfix/smtpd[5013]: disconnect from unknown[xx.xxx.xx.xxx]

Any ideea on why it does not send email to externet mail servers via mail client???

1. smtpdrelayrestrictions was not introduced until Postfix 2.10, so it will not work on 2.9.6.

2. Probably because of #1, the permitsaslauthenticated option isn't being applied. You need that to relay authenticated mail through Postfix.

Go back to using smtpdrecipientrestrictions and see if it works.

yes, of course, i did that straight away:

smtpdrecipientrestrictions = permitsaslauthenticated, permitmynetworks, rejectunauth_destination

needless to say it does not work, furthermore i found out the my mail.domain.com has been listed in a blacklist ( LISTED ivmSIP24 188.119.150.233 was listed Detail 2100 94 Ignore ) i don't know why, i haven't even succeded in setting it to work. :(

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct