Postfix issue


#1

Hi.

I configured my postfix server to relay local messages to my Dreamhost SMPT server.

However it doesn’t work.
mail.log says:

Dec 28 17:44:26 vmtest postfix/pickup[2473]: 8942843BDC: uid=0 from=<geo@mydomain.com> Dec 28 17:44:26 vmtest postfix/cleanup[2502]: 8942843BDC: message-id=<20161228164426.8942843BDC@mydomain.com> Dec 28 17:44:26 vmtest postfix/qmgr[2474]: 8942843BDC: from=<geo@mydomain.com>, size=340, nrcpt=1 (queue active) Dec 28 17:44:28 vmtest postfix/smtp[2504]: 8942843BDC: to=<geo@mydomain.com>, relay=mail.mydomain.com[208.xxx.xxx.xxx]:587, delay=2.2, delays=0.02/0.01/2/0.17, dsn=5.7.1, status=bounced (host mail.mydomain.com[208.xxx.xxx.xxx] said: 554 5.7.1 <wa-3232.ee.lu[85.xx.xxx.xx]>: Client host rejected: Access denied (in reply to RCPT TO command)) Dec 28 17:44:28 vmtest postfix/cleanup[2502]: 8942811BDC: message-id=<20161228164428.8942811BDC@mydomain.com> Dec 28 17:44:28 vmtest postfix/qmgr[2474]: 8942811BDC: from=<>, size=2260, nrcpt=1 (queue active) Dec 28 17:44:28 vmtest postfix/bounce[2506]: 8942843BDC: sender non-delivery notification: 8942811BDC Dec 28 17:44:28 vmtest postfix/qmgr[2474]: 8942843BDC: removed Dec 28 17:44:29 vmtest postfix/smtp[2504]: 8942811BDC: to=<geo@mydomain.com>, relay=mail.mydomain.com[208.xxx.xxx.xxx]:587, delay=1.4, delays=0/0/1.2/0.18, dsn=5.7.1, status=bounced (host mail.mydomain.com[208.xxx.xxx.xxx] said: 554 5.7.1 <wa-3232.ee.lu[85.xx.xxx.xx]>: Client host rejected: Access denied (in reply to RCPT TO command)) Dec 28 17:44:30 vmtest postfix/qmgr[2474]: 8942811BDC: removed

I configured accoring this howto …


… except that I changed …
“mydestination =”

What did I do wrong?


#2

I can’t find any mention of “mydestination =” in the tutorial you used. What’s happening is that the relay host is not accepting your mail. Most likely, the host you’re trying to connect to accepts only authenticated connections and you either aren’t providing the correct credentials or something else is going on. Too hard to tell without more details. Maybe share the full content of /etc/postfix/main.cf somewhere?


#3

You are right regarding “mydestination =”. I had to change this additionally due to postfix not being able at all to reach the DH SMTP server (mail.log entry “relay=local”).

root@vmtest:~# cat /etc/postfix/main.cf smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no append_dot_mydomain = no readme_directory = no smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination myhostname = example.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = relayhost = [mail.example.com]:587 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = all smtp_sasl_auth_enable = yes smtp_sasl_security_options = noanonymous smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_use_tls = yes smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt


#4

In fact, the problem was that I didn’t set the brackets around the server FQDN in “sasl_passwd”. So … “mydestination =” wasn’t relevant.

root@vmtest:~# cat /etc/postfix/sasl_passwd [<mail.mydomain.com>]:587 <smpt_user>@<smtp_password>