How to solve authentication error in sendmail relay through gmail

12,615

Do you have the correct (gmail) username and password settings in client-info? If yes, is sendmail able to read this file? Have you built your new sendmail.cf after editing sendmail.mc? Have you restarted sendmail afterwards?

Share:
12,615

Related videos on Youtube

Arul
Author by

Arul

you are not have enough space to hold the data...he..he..he :D

Updated on September 18, 2022

Comments

  • Arul
    Arul over 1 year

    I followed the steps in http://www.linuxha.com/other/sendmail/gmail.html to setup gmail in send mail. But when I try to send mail I got the authentication failure message.

    —– Transcript of session follows —– … while talking to smtp.gmail.com:

    AUTH dialogue <<< 535-5.7.1 Username and Password not accepted. Learn more at <<>> MAIL From: SIZE=538 AUTH= <<< 530-5.5.1 Authentication Required. Learn more at <<< 530 5.5.1 http://mail.google.com/support/bin/answer.py?answer=14257 i7sm28108408qap.12 554 5.0.0 Service unavailable

    Here its my main part of my sendmail.mc

    FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
    FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
    FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl
    FEATURE(`no_default_msa',`dnl')dnl
    FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
    FEATURE(`blacklist_recipients')dnl
    FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl
    FEATURE(`always_add_domain')dnl
    FEATURE(`redirect')dnl
    
    EXPOSED_USER(`root')dnl
    FEATURE(`authinfo',`hash /etc/mail/authinfo')dnl
    
    LOCAL_DOMAIN(`cookie.uucp')dnl
    define(`SMART_HOST',`smtp.gmail.com')dnl
    define(`RELAY_MAILER_ARGS', `TCP $h 587')
    define(`ESMTP_MAILER_ARGS', `TCP $h 587')
    define(`confAUTH_OPTIONS', `A p')dnl
    
    TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
    define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
    
    define(`CERT_DIR', `MAIL_SETTINGS_DIR`'certs')dnl
    define(`confCACERT_PATH', `CERT_DIR')dnl
    define(`confCACERT', `CERT_DIR/CAcert.pem')dnl
    define(`confSERVER_CERT', `CERT_DIR/mycert.pem')dnl
    define(`confSERVER_KEY', `CERT_DIR/mykey.pem')dnl
    define(`confCLIENT_CERT', `CERT_DIR/mycert.pem')dnl
    define(`confCLIENT_KEY', `CERT_DIR/mykey.pem')dnl
    
    FEATURE(masquerade_envelope)dnl
    
    FEATURE(masquerade_entire_domain)dnl
    
    MASQUERADE_AS(`gmail.com') dnl
    
    • Tim
      Tim over 12 years
      That code above doesn't seem to have any authentication information, that is what the Gmail server is complaining about.
    • Arul
      Arul over 12 years
      @Tim /etc/mail/authinfo file have the gmail login information..
  • Arul
    Arul over 12 years
    Yes I have correct username and password in /etc/mail/authinfo. I can login with this info in browser. I build successfully sendmail.cf using "make all install restart" After done everything sendmail is successfully restarted.
  • adamo
    adamo over 12 years
    Permissions like I said. Is sendmail able to read the external files? Look for warnings in the log files.
  • Arul
    Arul over 12 years
    Yes It can read external file.. sendmail 14165 root 3u IPv4 517170 TCP *:smtp (LISTEN) Its started by root user.. -rw------- 1 root root 180 Dec 29 06:40 authinfo That authentication file have read and write access for root user
  • Arul
    Arul over 12 years
    Now is working.. A small typo in my password.. :( Thanks to all