Linode Forum
https://forum.linode.com/

NOQUEUE: reject: Relay access denied
https://forum.linode.com/viewtopic.php?f=11&t=10547
Page 1 of 1

Author:  drewag [ Wed Oct 23, 2013 7:09 pm ]
Post subject:  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) 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:

Quote:
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:

Quote:
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!

Author:  drewag [ Wed Oct 23, 2013 7:30 pm ]
Post subject:  Re: NOQUEUE: reject: Relay access denied

I actually just figured out the problem.

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

Code:
    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

Author:  Vance [ Thu Oct 24, 2013 3:57 am ]
Post subject:  Re: NOQUEUE: reject: Relay access denied

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.

Author:  drewag [ Thu Oct 24, 2013 4:11 am ]
Post subject:  Re: NOQUEUE: reject: Relay access denied

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.

Author:  alex_and_dark [ Wed Apr 02, 2014 10:49 am ]
Post subject:  Re: NOQUEUE: reject: Relay access denied

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

1. if I change "smtpd_destination_restrictions" to "smtpd_relay_restrictions" 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: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
[ OK ]
* Starting Postfix Mail Transport Agent postfix postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_relay_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_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 <test_user@yahoo.com>: Relay access denied; from=<myaddress@mydomain.com> to=<test_user@yahoo.com> proto=ESMTP helo=<UserPC>
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???

Author:  Vance [ Wed Apr 02, 2014 8:56 pm ]
Post subject:  Re: NOQUEUE: reject: Relay access denied

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

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

Go back to using smtpd_recipient_restrictions and see if it works.

Author:  alex_and_dark [ Thu Apr 03, 2014 8:30 am ]
Post subject:  Re: NOQUEUE: reject: Relay access denied

yes, of course, i did that straight away:

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_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. :(

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/