ruby-on-rails-3sendmailemailrelay

sendmail unable to send email through google using my google app id


I use sendmail to send emails from my ruby-on-rails app. I used this awesome guide http://network-13.com/thread/1718-Sendmail-smtp-relay-gmail-google-apps to set up sendmail and relay messages through gmail.

However I faced the following problem: whenever I use my gmail username in account-info file, emails are sent but when I replace my gmail username with my google app email (robot@MY_DOMAIN.com), I get the following error trying to send email:

r 4 05:21:51 DOMAIN sendmail[3985]: q245Lp49003985: Authentication-Warning: DOMAIN.org: ec2-user set sender to robot@DOMAIN.org using -f

Mar 4 05:21:52 DOMAIN sendmail[3985]: q245Lp49003985: from=robot@DOMAIN.org, size=711, class=0, nrcpts=1, msgid=<4f52fbefc16ee_598b2d28467799@DOMAIN.org.mail>, relay=ec2-user@localhost

Mar 4 05:21:52 DOMAIN sendmail[3988]: q245LqEQ003988: from=, size=969, class=0, nrcpts=1, msgid=<4f52fbefc16ee_598b2d28467799@DOMAIN.org.mail>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]

Mar 4 05:21:52 DOMAIN sendmail[3985]: q245Lp49003985: to=RECI_EMAIL, delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30711, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q245LqEQ003988 Message accepted for delivery)

Mar 4 05:21:52 DOMAIN sendmail[3990]: STARTTLS=client, relay=smtp.gmail.com, version=TLSv1/SSLv3, verify=FAIL, cipher=RC4-SHA, bits=128/128

Mar 4 05:21:52 DOMAIN sendmail[3990]: q245LqEQ003988: to=, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=120969, relay=smtp.gmail.com [74.125.115.108], dsn=5.0.0, stat=Service unavailable

Mar 4 05:21:52 DOMAIN sendmail[3990]: q245LqEQ003988: to=, delay=00:00:00, mailer=local, pri=120969, dsn=5.1.1, stat=User unknown

Mar 4 05:21:52 DOMAIN sendmail[3990]: q245LqEQ003988: q245LqEQ003990: postmaster notify: User unknown

Mar 4 05:21:52 DOMAIN sendmail[3990]: q245LqEQ003990: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32182, dsn=2.0.0, stat=Sent

Does anyone know where the problem comes from?


Solution

  • The problem according to me lies in the following logs

    Mar 4 05:21:52 DOMAIN sendmail[3990]: q245LqEQ003988: to=, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=120969, relay=smtp.gmail.com [74.125.115.108], dsn=5.0.0, stat=Service unavailable
    

    Its says service unavailable. For send mail to work your

    1. "DOMAIN.org" should be a valid email server
    2. It should be accessible from the host you are trying to use sendmail