Postfix SMTP relay through exchange 2003 with authentication
Posted: Wed Nov 05, 2014 4:01 am
I've installed nagios core in Centos 6.5 and configured it to send alerts through our exchange 2003 server using postfix, which is installed in nagios server, as relay agent. Everything worked fine, but recently, as part of securing the network, the exchange admin disabled 'Anonymous' relay. Now, I tried to configure postfix relay authentication, but the mail/sendmail command fails with the following error.
Please see the changed sections of postfix config files.
# vi \etc\postfix\mainf.cf
smtp_sasl_auth_enable = yes
#smtp_sasl_mechanism_filter = plain, login
smtp_sasl_mechanism_filter = login !ntlm
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_generic_maps = hash:/etc/postfix/generic
relayhost = [exchange.mydomain.net]
mtp_use_tls = yes
smtp_tls_loglevel = 1
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_timeout = 3600s
smtp_tls_CAfile =
broken_sasl_auth_clients = yes
smtp_always_send_ehlo = yes
myhostname = comp-292.mydomain.net
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
#canonical_maps = hash:/etc/postfix/canonical
disable_dns_lookups = yes
# vi /etc/postfix/sasl_passwd
exchange.mydomain.net [email protected]:password
# vi /etc/postfix/generic
@localdomain.local [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
If I give invalid 'From" by editing \etc\postfix\generic I get the following error, which means the above error triggers at least after passing 'From' command successfully,Nov 5 14:06:21 comp-292 postfix/smtp[23210]: 3880A1804CC: to=<[email protected]>, relay=exchange.mydomain.net[10.8.0.25]:25, delay=0.35, delays=0.15/0.03/0.02/0.15, dsn=4.0.0, status=deferred (host exchange.mydomain.net[10.8.0.25] said: 454 5.7.3 Client does not have permission to Send As this sender. (in reply to end of DATA command))
Exchange has been configured to allow relay from postfix/nagios server, and from the authenticating user.Nov 5 13:47:16 comp-292 postfix/smtp[22736]: 8EDC2180481: to=<[email protected]>, relay=exchange.mydomain.net[10.8.0.25]:25, delay=42204, delays=42204/0.11/0.01/0, dsn=4.0.0, status=deferred (host exchange.mydomain.net[10.8.0.25] said: 454 5.7.3 Client does not have permission to Send As this sender. (in reply to MAIL FROM command))
Please see the changed sections of postfix config files.
# vi \etc\postfix\mainf.cf
smtp_sasl_auth_enable = yes
#smtp_sasl_mechanism_filter = plain, login
smtp_sasl_mechanism_filter = login !ntlm
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_generic_maps = hash:/etc/postfix/generic
relayhost = [exchange.mydomain.net]
mtp_use_tls = yes
smtp_tls_loglevel = 1
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_timeout = 3600s
smtp_tls_CAfile =
broken_sasl_auth_clients = yes
smtp_always_send_ehlo = yes
myhostname = comp-292.mydomain.net
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
#canonical_maps = hash:/etc/postfix/canonical
disable_dns_lookups = yes
# vi /etc/postfix/sasl_passwd
exchange.mydomain.net [email protected]:password
# vi /etc/postfix/generic
@localdomain.local [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]