Help Getting Postfix Relaying Via Gmail

Home » General » Help Getting Postfix Relaying Via Gmail
General 14 Comments

Hi,

I am trying to get a CentOS 6 system relaying mail via my G-Mail account. I followed the instructions found at https://www.zulius.com/how-to/set-up-postfix-with-a-remote-smtp-relay-host/but there seems to be a problem with authentication. I have done some research but still can’t get this working. Any suggestions ? It seems the user and password are correct.

Dec 27 23:15:36 hbc postfix/pickup[2588]: 8DEB1410B3: uid=0 from=
Dec 27 23:15:36 hbc postfix/cleanup[2603]: 8DEB1410B3: message-id=< 20121227101536.8DEB1410B3@hbc.hillcrest.org.nz>
Dec 27 23:15:36 hbc postfix/qmgr[2589]: 8DEB1410B3: from=< root@hbc.hillcrest.org.nz>, size17, nrcpt=1 (queue active)
Dec 27 23:15:37 hbc postfix/smtp[2605]: connect to smtp.gmail.com[2607:f8b0:400e:c00::6d]:587:
Network is unreachable Dec 27 23:15:37 hbc postfix/smtp[2605]: vstream_buf_get_ready: fd 15 got 45
Dec 27 23:15:37 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.109]:587: 220 mx.google.com ESMTP vo8sm17581810pbc.16 Dec 27 23:15:37 hbc postfix/smtp[2605]: > SMTP.gmail.com[173.194.79.109]:587:
EHLO hbc.hillcrest.org.nz Dec 27 23:15:37 hbc postfix/smtp[2605]: vstream_fflush_some: fd 15 flush 27
Dec 27 23:15:37 hbc postfix/smtp[2605]: vstream_buf_get_ready: fd 15 got 122
Dec 27 23:15:37 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.109]:587: 250-mx.google.com at your service, [121.75.4.39] Dec 27 23:15:37 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.109]:587: 250-SIZE 35882577 Dec 27 23:15:37 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.109]:587: 250-8BITMIME Dec 27 23:15:37 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.109]:587: 250-STARTTLS Dec 27 23:15:37 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.109]:587: 250 ENHANCEDSTATUSCODES Dec 27 23:15:37 hbc postfix/smtp[2605]: server features: 0x101b size 35882577 Dec 27 23:15:37 hbc postfix/smtp[2605]: > SMTP.gmail.com[173.194.79.109]:587:
STARTTLS
Dec 27 23:15:37 hbc postfix/smtp[2605]: vstream_fflush_some: fd 15 flush 10
Dec 27 23:15:37 hbc postfix/smtp[2605]: vstream_buf_get_ready: fd 15 got 30
Dec 27 23:15:37 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.109]:587: 220 2.0.0 Ready to start TLS Dec 27 23:15:37 hbc postfix/smtp[2605]: event_request_timer: reset 0x7f79a9113bb0 0x7f79aa8429d0 5 Dec 27 23:15:37 hbc postfix/smtp[2605]: send attr request = seed Dec 27 23:15:37 hbc postfix/smtp[2605]: send attr size = 32 Dec 27 23:15:37 hbc postfix/smtp[2605]: vstream_fflush_some: fd 9 flush 22 Dec 27 23:15:37 hbc postfix/smtp[2605]: vstream_buf_get_ready: fd 9 got 60 Dec 27 23:15:37 hbc postfix/smtp[2605]: private/tlsmgr: wanted attribute: status Dec 27 23:15:37 hbc postfix/smtp[2605]: input attribute name: status Dec 27 23:15:37 hbc postfix/smtp[2605]: input attribute value: 0 Dec 27 23:15:37 hbc postfix/smtp[2605]: private/tlsmgr: wanted attribute: seed Dec 27 23:15:37 hbc postfix/smtp[2605]: input attribute name: seed Dec 27 23:15:37 hbc postfix/smtp[2605]: input attribute value: xIHq7bnC7bggzN5/v38KVLhUrfnowW/aYWlTcvBI1LMDec 27 23:15:37 hbc postfix/smtp[2605]: private/tlsmgr: wanted attribute: (list terminator) Dec 27 23:15:37 hbc postfix/smtp[2605]: input attribute name: (end) Dec 27 23:15:38 hbc postfix/smtp[2605]: > SMTP.gmail.com[173.194.79.109]:587:
EHLO hbc.hillcrest.org.nz Dec 27 23:15:38 hbc postfix/smtp[2605]: vstream_fflush_some: fd 15 flush 27
Dec 27 23:15:38 hbc postfix/smtp[2605]: vstream_buf_get_ready: fd 15 got 145
Dec 27 23:15:38 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.109]:587: 250-mx.google.com at your service, [121.75.4.39] Dec 27 23:15:38 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.109]:587: 250-SIZE 35882577 Dec 27 23:15:38 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.109]:587: 250-8BITMIME Dec 27 23:15:38 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.109]:587: 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 Dec 27 23:15:38 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.109]:587: 250 ENHANCEDSTATUSCODES Dec 27 23:15:38 hbc postfix/smtp[2605]: server features: 0x102b size 35882577 Dec 27 23:15:38 hbc postfix/smtp[2605]: maps_find: SMTP_sasl_passwd: smtp.gmail.com: not found Dec 27 23:15:38 hbc postfix/smtp[2605]: maps_find: SMTP_sasl_passwd: hash:/etc/postfix/sasl_passwd(0,lock|fold_fix): SMTP.gmail.com:587 clint.dilks@gmail.com: Dec 27 23:15:38 hbc postfix/smtp[2605]: SMTP_sasl_passwd_lookup: host ` smtp.gmail.com' user `@gmail.com’ pass `
Dec 27 23:15:38 hbc postfix/smtp[2605]: starting new SASL client Dec 27 23:15:38 hbc postfix/smtp[2605]: name_mask: noanonymous Dec 27 23:15:38 hbc postfix/smtp[2605]: SMTP_sasl_authenticate:
smtp.gmail.com[173.194.79.109]:587: SASL mechanisms LOGIN PLAIN XOAUTH
XOAUTH2
Dec 27 23:15:38 hbc postfix/smtp[2605]: warning: SASL authentication failure: No worthy mechs found Dec 27 23:15:38 hbc postfix/smtp[2605]: 8DEB1410B3: SASL authentication failed; cannot authenticate to server SMTP.gmail.com[173.194.79.109]: no mechanism available Dec 27 23:15:38 hbc postfix/smtp[2605]: > SMTP.gmail.com[173.194.79.109]:587:
QUIT
Dec 27 23:15:38 hbc postfix/smtp[2605]: name_mask: resource Dec 27 23:15:38 hbc postfix/smtp[2605]: name_mask: software Dec 27 23:15:38 hbc postfix/smtp[2605]: vstream_fflush_some: fd 15 flush 6
Dec 27 23:15:38 hbc postfix/smtp[2605]: vstream_fflush_some: fd 15 flush 0
Dec 27 23:15:38 hbc postfix/smtp[2605]: disposing SASL state information Dec 27 23:15:39 hbc postfix/smtp[2605]: vstream_buf_get_ready: fd 15 got 45
Dec 27 23:15:39 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.108]:587: 220 mx.google.com ESMTP bi8sm14464509pab.15 Dec 27 23:15:39 hbc postfix/smtp[2605]: > SMTP.gmail.com[173.194.79.108]:587:
EHLO hbc.hillcrest.org.nz Dec 27 23:15:39 hbc postfix/smtp[2605]: vstream_fflush_some: fd 15 flush 27
Dec 27 23:15:39 hbc postfix/smtp[2605]: vstream_buf_get_ready: fd 15 got 122
Dec 27 23:15:39 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.108]:587: 250-mx.google.com at your service, [121.75.4.39] Dec 27 23:15:39 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.108]:587: 250-SIZE 35882577 Dec 27 23:15:39 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.108]:587: 250-8BITMIME Dec 27 23:15:39 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.108]:587: 250-STARTTLS Dec 27 23:15:39 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.108]:587: 250 ENHANCEDSTATUSCODES Dec 27 23:15:39 hbc postfix/smtp[2605]: server features: 0x101b size 35882577 Dec 27 23:15:39 hbc postfix/smtp[2605]: > SMTP.gmail.com[173.194.79.108]:587:
STARTTLS
Dec 27 23:15:39 hbc postfix/smtp[2605]: vstream_fflush_some: fd 15 flush 10
Dec 27 23:15:39 hbc postfix/smtp[2605]: vstream_buf_get_ready: fd 15 got 30
Dec 27 23:15:39 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.108]:587: 220 2.0.0 Ready to start TLS Dec 27 23:15:39 hbc postfix/smtp[2605]: event_request_timer: reset 0x7f79a9113bb0 0x7f79aa8429d0 5 Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr request = seed Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr size = 32 Dec 27 23:15:39 hbc postfix/smtp[2605]: vstream_fflush_some: fd 9 flush 22 Dec 27 23:15:39 hbc postfix/smtp[2605]: vstream_buf_get_ready: fd 9 got 60 Dec 27 23:15:39 hbc postfix/smtp[2605]: private/tlsmgr: wanted attribute: status Dec 27 23:15:39 hbc postfix/smtp[2605]: input attribute name: status Dec 27 23:15:39 hbc postfix/smtp[2605]: input attribute value: 0 Dec 27 23:15:39 hbc postfix/smtp[2605]: private/tlsmgr: wanted attribute: seed Dec 27 23:15:39 hbc postfix/smtp[2605]: input attribute name: seed Dec 27 23:15:39 hbc postfix/smtp[2605]: input attribute value: Gvb7N21DayqKfDwTIIHM/2DY92tqdHFajB++bXjpXwEDec 27 23:15:39 hbc postfix/smtp[2605]: private/tlsmgr: wanted attribute: (list terminator) Dec 27 23:15:39 hbc postfix/smtp[2605]: input attribute name: (end) Dec 27 23:15:39 hbc postfix/smtp[2605]: > SMTP.gmail.com[173.194.79.108]:587:
EHLO hbc.hillcrest.org.nz Dec 27 23:15:39 hbc postfix/smtp[2605]: vstream_fflush_some: fd 15 flush 27
Dec 27 23:15:39 hbc postfix/smtp[2605]: vstream_buf_get_ready: fd 15 got 145
Dec 27 23:15:39 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.108]:587: 250-mx.google.com at your service, [121.75.4.39] Dec 27 23:15:39 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.108]:587: 250-SIZE 35882577 Dec 27 23:15:39 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.108]:587: 250-8BITMIME Dec 27 23:15:39 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.108]:587: 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 Dec 27 23:15:39 hbc postfix/smtp[2605]: < SMTP.gmail.com[173.194.79.108]:587: 250 ENHANCEDSTATUSCODES Dec 27 23:15:39 hbc postfix/smtp[2605]: server features: 0x102b size 35882577 Dec 27 23:15:39 hbc postfix/smtp[2605]: maps_find: SMTP_sasl_passwd: smtp.gmail.com: not found Dec 27 23:15:39 hbc postfix/smtp[2605]: maps_find: SMTP_sasl_passwd: hash:/etc/postfix/sasl_passwd(0,lock|fold_fix): SMTP.gmail.com:587 = @
gmail.com:
Dec 27 23:15:39 hbc postfix/smtp[2605]: SMTP_sasl_passwd_lookup: host `
smtp.gmail.com’ user `’ pass `’
Dec 27 23:15:39 hbc postfix/smtp[2605]: starting new SASL client Dec 27 23:15:39 hbc postfix/smtp[2605]: name_mask: noanonymous Dec 27 23:15:39 hbc postfix/smtp[2605]: SMTP_sasl_authenticate:
smtp.gmail.com[173.194.79.108]:587: SASL mechanisms LOGIN PLAIN XOAUTH
XOAUTH2
Dec 27 23:15:39 hbc postfix/smtp[2605]: warning: SASL authentication failure: No worthy mechs found Dec 27 23:15:39 hbc postfix/smtp[2605]: connect to subsystem private/defer Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr nrequest = 0
Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr flags = 0
Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr queue_id = 8DEB1410B3
Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr original_recipient clint.dilks@gmail.com Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr recipient clint.dilks@gmail.com Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr offset = 203
Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr dsn_orig_rcpt Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr notify_flags = 0
Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr status = 4.7.0
Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr diag_type = x-sasl Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr diag_text = no mechanism available Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr mta_type Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr mta_mname Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr action = delayed Dec 27 23:15:39 hbc postfix/smtp[2605]: send attr reason = SASL
authentication failed; cannot authenticate to server smtp.gmail.com[173.194.79.108]:
no mechanism available Dec 27 23:15:39 hbc postfix/smtp[2605]: vstream_fflush_some: fd 16 flush 373
Dec 27 23:15:40 hbc postfix/smtp[2605]: vstream_buf_get_ready: fd 16 got 10
Dec 27 23:15:40 hbc postfix/smtp[2605]: private/defer socket: wanted attribute: status Dec 27 23:15:40 hbc postfix/smtp[2605]: input attribute name: status Dec 27 23:15:40 hbc postfix/smtp[2605]: input attribute value: 0
Dec 27 23:15:40 hbc postfix/smtp[2605]: private/defer socket: wanted attribute: (list terminator)
Dec 27 23:15:40 hbc postfix/smtp[2605]: input attribute name: (end)
Dec 27 23:15:40 hbc postfix/smtp[2605]: 8DEB1410B3: to=< clint.dilks@gmail.com>, relay=smtp.gmail.com[173.194.79.108]:587, delay#, delays /0.04/3.3/0, dsn=4.7.0, status

14 thoughts on - Help Getting Postfix Relaying Via Gmail

  • Well, this:

    ‘Dec 27 23:15:38 hbc postfix/smtp[2605]: warning: SASL authentication failure: No worthy mechs found Dec 27 23:15:38 hbc postfix/smtp[2605]: 8DEB1410B3: SASL authentication failed; cannot authenticate to server SMTP.gmail.com[173.194.79.109]: no mechanism available’

    appears to be your problem. In my experience of Google, they do have some convoluted ways of authenticating stuff. I’d try, in the first instance, Googling (no pum intended) the above error message & see what it throws up.

    Sorry I can’t be more help.

    Cheers,

    Phil…

  • Hi already done this

    A number of Ubuntu related sites indicate its missing Libraries. But in this case doesn’t seem to be the problem.

    tried setting

    smtp_sasl_security_options = and SMTP_cname_overrides_servername=no
    (individually and together)

    changing relayhost so that it is [smtp.gmail.com]:587 seems to produce the following error

    status=bounced (host SMTP.gmail.com[74.125.141.109] said: 530-5.5.1
    Authentication Required. Learn more at 530 5.5.1
    http://support.google.com/mail/bin/answer.py?answer257
    gq10sm17693070pbc.54 (in reply to MAIL FROM command))

  • Hi,

    I have a working setup. “Eye-grep” differences from your configs:

    relayhost = [smtp.gmail.com]:587
    smtp_sasl_security_options = noanonymous, noplaintext

    # cat /etc/postfix/sasl_passwd
    [smtp.gmail.com]:587 :

    HTH, M

  • Hi, Currently

    # postconf -n | less 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 = 3
    debug_peer_list = SMTP.gmail.com html_directory = no inet_interfaces = localhost inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
    relayhost = [smtp.gmail.com]:587
    sample_directory = /usr/share/doc/postfix-2.6.6/samplesr sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop

  • 2012/12/27 Clint Dilks :

    and you didn’t follow any of instructions that I just posted? all sasl settings are missing from configuration.

  • Eero,

    How do you work around the issue of Google/Gmail rewriting your “From”
    email address to your gmail address when relaying via Gmail?

  • Sorry was doing this at 2am in the morning and didn’t realise I mis-copied

    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 = 3
    html_directory = no inet_interfaces = localhost inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
    relayhost = [smtp.gmail.com]:587
    sample_directory = /usr/share/doc/postfix-2.6.6/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_tls_mandatory_ciphers = high smtp_tls_mandatory_protocols = TLSv1
    smtp_tls_secure_cert_match = nexthop smtp_tls_security_level = secure smtp_use_tls = yes smtpd_sasl_path = SMTPd unknown_local_recipient_reject_code = 550

  • 2012/12/28 Clint Dilks :

    remember to postmap /etc/postfix/sasl_passwd and then restart the postfix. then provide log entries from postfix after trying to send mail..

LEAVE A COMMENT