Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Oct 23, 2013 7:09 pm 
Offline
Newbie

Joined: Wed Oct 23, 2013 7:04 pm
Posts: 3
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!


Top
   
PostPosted: Wed Oct 23, 2013 7:30 pm 
Offline
Newbie

Joined: Wed Oct 23, 2013 7:04 pm
Posts: 3
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


Top
   
PostPosted: Thu Oct 24, 2013 3:57 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
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.


Top
   
PostPosted: Thu Oct 24, 2013 4:11 am 
Offline
Newbie

Joined: Wed Oct 23, 2013 7:04 pm
Posts: 3
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.


Top
   
PostPosted: Wed Apr 02, 2014 10:49 am 
Offline
Newbie

Joined: Wed Apr 02, 2014 10:05 am
Posts: 2
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???


Top
   
PostPosted: Wed Apr 02, 2014 8:56 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
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.


Top
   
PostPosted: Thu Apr 03, 2014 8:30 am 
Offline
Newbie

Joined: Wed Apr 02, 2014 10:05 am
Posts: 2
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. :(


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group