-2

Here is the story, I would like to use POSTFIX relayhost config to send mails to gmail. I use 2-step Authentication and change and double check password and username. everything looks fine in sasl_passwd

>postmap -q smtp.gmail.com:587 /etc/postfix/sasl_passwd
Jonh:adfasdfasdfixvl

I am really tired of looking web but find nothing ANY IDEA HOW TO RESOLVE THE ISSUE ?!

Here is my config main.cf :

postconf -n

    alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = local.domain
myhostname = host.local.domain
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
relayhost = smtp.gmail.com:587
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_type = cyrus
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_use_tls = yes
smtpd_sasl_path = smtpd
unknown_local_recipient_reject_code = 550

And here is the log why it failed :

Jan 12 00:19:53 gamma postfix/pickup[11859]: A1EFD800DB: uid=0 from=<root>
Jan 12 00:19:53 gamma postfix/cleanup[11886]: A1EFD800DB: message-id=<20150112001953.A1EFD800DB@host.local.domain>
Jan 12 00:19:53 gamma postfix/qmgr[11860]: A1EFD800DB: from=<root@host.local.domain>, size=456, nrcpt=1 (queue active)
Jan 12 00:19:53 gamma postfix/error[11887]: A1EFD800DB: to=<john@gmail.com>, relay=none, delay=0.02, delays=0.01/0.01/0/0, dsn=4.7.0, status=deferred (delivery temporarily suspended: SASL authentication failed; cannot authenticate to server smtp.gmail.com[173.194.78.109]: no mechanism available)
1

Check if SASL binaries and libraries are installed.

Try install cyrus-sasl* packages:

sudo yum install cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.