From: The Imp on
Hi all, I need to configure Postfix in order to allow mail relay to any destination not only from client in local network (default), but from authenticated clients too.
The server is CentOS 5.2, with Postfix and Cyrus SASL installed.

in /etc/sasl2/smtpd.conf:

pwdcheck: saslauthd
mech_list: PLAIN LOGIN

in /etc/postfix/main.cf:

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_path = smtpd
broken_sasl_auth_clients = yes
smtpd_recipient_restriction = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

I've made many tries, from common mail clients like Thunderbird/Outlook etc, and from command line via telnet (port 25) too.
The authentication goes ok (I see that from logs and from telnet session too), but when I try to send a message to a mail domain not included in mydestination=...... I get this error:

Sat 13 17:46:27 apps postfix/smtpd[18361]: NOQUEUE: reject: RCPT from host201-187-dynamic.54-82-r..........: 554 5.7.1 <....recipient....>: Relay access denied; from=<...sender....> to=<...recipient....> proto=ESMTP helo=<...mailserver....>

Thank you very much for any suggestion.
From: John Wingate on
The Imp <roland(a)gilead.it> wrote:
> Hi all, I need to configure Postfix in order to allow mail relay to
> any destination not only from client in local network (default), but
> from authenticated clients too.
> The server is CentOS 5.2, with Postfix and Cyrus SASL installed.
>
> in /etc/sasl2/smtpd.conf:
>
> pwdcheck: saslauthd
> mech_list: PLAIN LOGIN
>
> in /etc/postfix/main.cf:
>
> smtpd_sasl_auth_enable = yes
> smtpd_sasl_security_options = noanonymous
> smtpd_sasl_path = smtpd
> broken_sasl_auth_clients = yes
> smtpd_recipient_restriction = permit_mynetworks,
> permit_sasl_authenticated, reject_unauth_destination
>
> I've made many tries, from common mail clients like
> Thunderbird/Outlook etc, and from command line via telnet (port 25) too.
> The authentication goes ok (I see that from logs and from telnet
> session too), but when I try to send a message to a mail domain not
> included in mydestination=...... I get this error:
>
> Sat 13 17:46:27 apps postfix/smtpd[18361]: NOQUEUE: reject: RCPT from
> host201-187-dynamic.54-82-r..........: 554 5.7.1 <....recipient....>:
> Relay access denied; from=<...sender....> to=<...recipient....>
> proto=ESMTP helo=<...mailserver....>

That you are getting this log entry, from the reject_unauth_destination
test, suggests that the permit_sasl_authenticated test is failing,
despite your experience in trials. Do you have verbose logging turned
on? If not, do so; it will give you a great deal of information about
what is happening during the connection, and should quickly identify
where the problem occurs. Add the -v flag to the smtp line in the
Postfix master.cf and reload postfix. Like:

smtp inet n - n - - smtpd -v


--
John Wingate Mathematics is the art which teaches
johnww(a)worldpath.net one how not to make calculations.
--Oscar Chisini