Configure sendmail to work with Gmail smtp relay
Ok this one was really a thinker. I spent at least 5 hours to get this to work and finally I was able to use Sendmail to relay through my Gmail account.
A little background:
I have a Linux VPS with CentOS installed. The only email MTA is the default Sendmail. Everything else is pretty much the standard CentOS 4 installation. I don’t intend to use this box as a mail server or any other type of email processor. What I was trying to do is to add some basic capability to send out email from the box using my existing email accounts hosted in Gmail. And I didn’t want to install any additional software such as Postfix for this.
That being said, let me continue to take you down the path that I have gone through, without the stumbling blocks.
My approach was basically: problem -> Google for solutions -> trouble shoot -> Google again. So I found a lot of useful content on the web during the process.
1. Check sendmail
Since gmail uses TLS, you will need to make sure your sendmail is compiled with TLS (for encryption) and SASL (for authentication). This is the command to use to check it:
/usr/sbin/sendmail -d0.1 -bv root
In my case, sendmail does have the necessary compilation flags so I was good. If yours doesn’t, you’ll need to re-compile sendmail and update the binary that is used to start the sendmail service, which is not covered here.
2. Upgrading Cyrus SASL
If your SASL installation doesn’t have the “plain” and “login” lib you will have authentication problem with Gmail. You can see why when you get to the sendmail configuration in the later steps. The common error in the /var/log/maillog is this:
AUTH=client, available mechanisms do not fulfill requirements
It was a vague error and I was so frustrated with it at one point I was ready to give up. However, this article about setting up Postfix with Gmail casted some light and helped me figured out the cause.
The problem is that SASL doesn’t have all the necessary plugins. The “login” and “plain” are the plugins necessary to talk to Gmail smtp. So I had to upgrade SASL to fix the problem. Here is what I did:
$ wget http://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.21.tar.gz
$ tar -xzf cyrus-sasl-2.1.21.tar.gz
$ cd cyrus-sasl-2.1.21
$ ./configure
$ make
$ make install$ mv /usr/lib/sasl2 /usr/lib/sasl2.orig
$ ln -s /usr/local/lib/sasl2 /usr/lib/sasl2
Since I just switched out the old sasl2 lib without recompiling sendmail, I was concerned sendmail would poop during runtime. Luckily that didn’t happen. Dynamic lib rocks!
3. Generate SSL certificate
I made a directory called certs under /etc/mail. Here are the commands that I used to generate the SSL certificates.
openssl req -new -x509 -keyout cakey.pem -out cacert.pem -days 3650
openssl req -nodes -new -x509 -keyout sendmail.pem -out sendmail.pem -days 3650
Notice I made the certificates good for almost 10 years. I didn’t needed the cacert.pem to be exact.
I also copied /usr/share/ssl/ca-bundle.crt to /ect/mail/certs and included it in the sendmail configuration file. Other wise you’ll see some error like this:
unable to get local issuer certificate
The reason is that the ca bundle file has the Gmail certificate issuer. Although I read it somewhere that email still goes out with this error. Nonetheless, we don’t need to see this if we can fix it.
4. Configure sendmail
With the preparations above we are ready to configure sendmail. I found this tutorial very useful in terms of getting the correct sendmail configurations.
In summary, I have the /etc/mail/auth/client-info looks like this:
AuthInfo:smtp.gmail.com “U:root” “I:username@gmail.com” “P:password” “M:PLAIN”
AuthInfo:smtp.gmail.com:587 “U:root” “I:username@gmail.com” “P:password” “M:PLAIN”
If you use Gmail hosted email with your own domain name, you will have username@hostname.tld in there.
Make sure run:
$ makemap -r hash client-info.db < client-info
and chmod 600 on client info files.
Essential lines in my sendmail.mc
FEATURE(`authinfo’,`hash /etc/mail/auth/client-info.db’)dnl
define(`SMART_HOST’,`smtp.gmail.com’)dnl
define(`RELAY_MAILER_ARGS’, `TCP $h 587′)
define(`ESMTP_MAILER_ARGS’, `TCP $h 587′)define(`CERT_DIR’, `/etc/mail/certs’)
define(`confCACERT_PATH’, `CERT_DIR’)
define(`confCACERT’, `CERT_DIR/ca-bundle.crt’)
define(`confCRL’, `CERT_DIR/ca-bundle.crt’)
define(`confSERVER_CERT’, `CERT_DIR/sendmail.pem’)
define(`confSERVER_KEY’, `CERT_DIR/sendmail.pem’)
define(`confCLIENT_CERT’, `CERT_DIR/sendmail.pem’)
define(`confCLIENT_KEY’, `CERT_DIR/sendmail.pem’)define(`confAUTH_MECHANISMS’, `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)
The certificate files are generated/copied from the previous step. I’m no sendmail expert so the configuration lines may not be perfect. But it works. Let me know if you have better settings.
One tip I found very useful is to use the debugging feature. You can set a high log level in the sendmail.mc to see at which step sendmail choked and for what reason.
Also, make sure run “make” or m4 every time you touch the sendmail.mc.
m4 sendmail.mc > sendmail.cf
So that’s pretty much it. I restart the sendmail service and out goes my email.
UPDATE:
Recently I installed Sendmail on a brand new VPS and had hard time get the authentication working. It turned out saslauthd was not running. So a note for new system is to make sure saslauthd has to be up and running (better use chkconfig to make sure it starts up at run level 3) in order to get Sendmail authentication working. This may help resolve some issues in the comments.
Well written, easy to understand directions. Bravo!
May I make a suggestion that you change $ ./configure to $ ./configure –enable -login
to make sure the login mechanism is included in the library?
Thanks for the great helpful article!
Comment by Bill — January 25, 2009 @ 8:06 pm
Wow, thanks! I was just about going to give up on my similar setup. What drove me nuts is that I had this setup working on a Centos5 box, but on Centos4 I would get the “available mechanisms do not fulfill requirements” error. After reading your post I found out why: Centos4 does not intstall all the SASL plugins by default, but Centos5 does.
So the solution is even simpler: just “sudo yum install cyrus-sasl-plain”. No need to recompile!
Comment by Stanis — March 30, 2009 @ 1:09 pm
This is a great article. It worked on my VM Redhat linux 9.0.
easy to the point steps.
Comment by Rahul — April 12, 2009 @ 4:37 am
Thanks for this article, it helped me a lot to set up sendmail using gmail smtp
It is maybe obvious, but if someone get the error, he may wonder about :
- If you copy and past the lines to insert in sendmail.mc , be carefull about the quotes ! You may have to retype them, otherwise getting an error like “ERROR: end of file in string” when executing sendmailconfig
- also for an unexplained reason, I had at some point to create an empty access.new.db , otherwise, sendmailconfig complained, then I had to run : ’sudo touch access.new.db && sudo chmod 666 access.new.db && sudo touch access’ , in /etc/mail/
Then it worked like a charm ! Thanks !
Comment by Cali — June 12, 2009 @ 5:03 am
Thank’s a lot, it helped me so much!.
Just to help some newbies (like me), Dont leave any spaces (blanks) before the commands in sendmail.mc, nor leave empty lines in sendmail.mc it will compile ok, but when you restart sendmail it will say something like this:
554 5.0.0 /etc/mail/sendmail.cf: line 39: unknown configuration line ”
”
Regards
Chanete
Comment by Chanete — July 7, 2009 @ 7:25 am
AuthInfo:smtp.gmail.com “U:root” “I:username@gmail.com” “P:password” “M:PLAIN”
AuthInfo:smtp.gmail.com:587 “U:root” “I:username@gmail.com” “P:password” “M:PLAIN”
didn’t work for me. Change “M:PLAIN” to “M:LOGIN PLAIN” and it works!!
Comment by Aaron — August 3, 2009 @ 1:43 pm
Very useful guide indeed. I’ve come a logn way with this guide and the gmail server gets verified.
Log msg: STARTTLS=client, relay=smtp.gmail.com, version=TLSv1/SSLv3, verify=OK, cipher=RC4-MD5, bits=128/128
However then I get the following error:
n72Amt1m030791: AUTH=client, available mechanisms do not fulfill requirements
AUTH=client, relay=smtp.gmail.com, temporary failure, connection abort
Any idea what might be causing this error? It’s driving me nuts for several days now
Thanks in advance,
Robert
Comment by Robert — August 4, 2009 @ 3:08 pm
Sorry, forgot to mention that I’ve already upgraded the SASL package as described above.
Comment by Robert — August 4, 2009 @ 3:27 pm
Hi Robert, I’m still suspecting it has something to do with SASLv2 lib. Do you see SASLv2 in the output if you run this command:
sendmail -d0.1 -bv root
Comment by 1.618 — August 5, 2009 @ 2:48 pm
I’m getting the following in my mail logs (Service Unavailable) – does anyone have any idea what I’ve done wrong? Thanks so much!!
Aug 11 21:38:54 LBCLTWEB001 sendmail[7231]: n7BLcsDr007231: from=apache, size=2711, class=0, nrcpts=1, msgid=, relay=apache@localhost
Aug 11 21:38:54 LBCLTWEB001 sendmail[7232]: n7BLcsEJ007232: from=, size=2948, class=0, nrcpts=1, msgid=, proto=ESMTP, daemon=MTA, relay=LBCLTWEB001.domainname.com [127.0.0.1]
Aug 11 21:38:54 LBCLTWEB001 sendmail[7231]: n7BLcsDr007231: to=jasondharper@gmail.com, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32711, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n7BLcsEJ007232 Message accepted for delivery)
Aug 11 21:38:55 LBCLTWEB001 sendmail[7234]: STARTTLS=client: file /etc/mail/certs/sendmail.pem unsafe: Group readable file
Aug 11 21:38:55 LBCLTWEB001 sendmail[7234]: STARTTLS=client, relay=smtp.gmail.com, version=TLSv1/SSLv3, verify=OK, cipher=RC4-MD5, bits=128/128
Aug 11 21:38:56 LBCLTWEB001 sendmail[7234]: n7BLcsEJ007232: to=, ctladdr= (48/48), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=122948, relay=smtp.gmail.com [209.85.201.111], dsn=5.0.0, stat=Service unavailable
Aug 11 21:38:56 LBCLTWEB001 sendmail[7234]: n7BLcsEJ007232: n7BLcuEJ007234: DSN: Service unavailable
Aug 11 21:38:56 LBCLTWEB001 sendmail[7234]: n7BLcuEJ007234: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=34209, dsn=2.0.0, stat=Sent
Comment by Jason — August 11, 2009 @ 4:42 pm
Jason, do you have these lines in sendmail.mc?
define(`RELAY_MAILER_ARGS’, `TCP $h 587′)
define(`ESMTP_MAILER_ARGS’, `TCP $h 587′)
It seems you were not connecting to the right ip/port.
Comment by ren — August 12, 2009 @ 9:52 am
[...] for a long time now and needed to configure my server to relay mail through it. Here’s a nice article that walks you through exactly what needs to be done to configure your sendmail MTA to relay [...]
Pingback by Configuring Sendmail to relay through Gmail SMTP « The AppGirl Blog — August 18, 2009 @ 4:41 pm
configured in this article and it still it is not working.
Sep 19 10:41:26 myatt sendmail[24293]: STARTTLS=client, relay=gmail-smtp-msa.l.google.com., version=TLSv1/SSLv3, verify=OK, cipher=RC4-MD5, bits=128/128
Sep 19 10:41:27 myatt sendmail[24293]: n8JHfQma024291: to=, ctladdr= (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120355, relay=gmail-smtp-msa.l.google.com. [72.14.247.111], dsn=5.0.0, stat=Service unavailable
Sep 19 10:41:27 myatt sendmail[24293]: n8JHfQma024291: n8JHfRma024293: DSN: Service unavailable
Sep 19 10:41:27 myatt sendmail[24293]: n8JHfRma024293: to=myattto@gmail.com , delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31588, relay=gmail-smtp-msa.l.google.com., dsn=5.0.0, stat=Service unavailable
Sep 19 10:41:27 myatt sendmail[24293]: n8JHfRma024293: n8JHfRmb024293: return to sender: Service unavailable
Sep 19 10:41:27 myatt sendmail[24293]: n8JHfRmb024293: to=myattto@gmail.com , delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32612, relay=gmail-smtp-msa.l.google.com., dsn=5.0.0, stat=Service unavailable
Sep 19 10:41:27 myatt sendmail[24293]: n8JHfRma024293: Losing ./qfn8JHfRma024293: savemail panic
Sep 19 10:41:27 myatt sendmail[24293]: n8JHfRma024293: SYSERR(root): savemail: cannot save rejected email anywhere
thambi
Comment by Thambi — September 19, 2009 @ 12:52 pm
Thanks a lot for your article!
I’ve had a similar problem and i’ve found here a great help.
My solution:
I need smtp+authentification (on port 587) to send mail via my ISP
and i’m using mailertable because some domains have to be transported by uucp.
So I added in my sendmail.mc
=================================================================
define(`confAUTH_MECHANISMS’, `PLAIN’)dnl
FEATURE(`authinfo’,`hash -o /etc/mail/authinfo.db’)dnl
dnl #———————————————–Default Mailer setup——
dnl #
MAILER_DEFINITIONS
MAILER(`local’)dnl
MAILER(`smtp’)dnl
MAILER(`uucp’)dnl # — Denis BRAUSSEN –
dnl #——————————————–DEDICATED MAILER DEFINITION (SMTP + AUTHINFO PORT 587) —————————
dnl #
dnl # THIS MAILER WILL BE USED IN MAILERTABLE
dnl #
dnl # CHANGED: ORIGINAL MAILER FLAG F=mDFMuXa0 TO F=mDFMuXae9 (look for “confCON_EXPENSIVE” in cf.README.gz supplied with sendmail)
dnl #
define(`ALTSMTP_PORT’,`587′)
Maltsmtp, P=[IPC], F=mDFMuXae9, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=TCP $h ALTSMTP_PORT
dnl #
dnl #
=================================================================
Then i created a /etc/mail/authinfo (rw- — — root:smmsp) filled with this line:
AuthInfo:smtp-auth.sfr.fr “I:UsEr” “P:PaSsWoRd” “R:smtp-auth.sfr.fr” “M:PLAIN”
(to create the database do: # makemap hash /etc/mail/authinfo < /etc/mail/authinfo )
and in my /etc/mail/mailertable i have this line:
#——————————
. altsmtp:smtp-auth.sfr.fr
#——————————
Finally, do *NOT* forget to install libsasl2-modules !
And all is working fine on my debian 5.03 (lenny)
Hope this helps,
regards,
Denis BRAUSSEN
Comment by Denis BRAUSSEN — October 27, 2009 @ 6:31 pm
[root@localhost mail]# m4 ./sendmail.mc > ./sendmail.cf
m4:./sendmail.mc:149: Warning: excess arguments to builtin `define’ ignored
m4:./sendmail.mc:149: cannot open `/usr/share/sendmail-cf/feature/’authinfo’.m4′: No such file or directory
m4:./sendmail.mc:150: ERROR: end of file in string
I am getting these error messages and don’t know what is wrong.
The line 149 refers to ” FEATURE(’authinfo’,'hash /etc/mail/auth/client-info.db’)dnl ”
There is the file, /usr/share/sendmail-cf/feature/authinfo.m4 (without quotation marks), but it says no such file.
Comment by Rod Rook — November 4, 2009 @ 10:14 pm
The best guaide. All I need!!! Thanks
Comment by kisloid — November 26, 2009 @ 4:28 pm
Hello
I have the following message in var/mail/maillog:
Nov 30 12:52:17 demo sendmail[18466]: alias database /etc/aliases rebuilt by root
Nov 30 12:52:17 demo sendmail[18466]: /etc/aliases: 76 aliases, longest 10 bytes, 765 bytes total
Nov 30 12:52:17 demo sendmail[18471]: starting daemon (8.13.8): SMTP+queueing@01:00:00
Nov 30 12:52:17 demo sendmail[18471]: STARTTLS=server: file /etc/mail/certs/sendmail.pem unsafe: No such file or directory
Nov 30 12:52:18 demo sm-msp-queue[18479]: starting daemon (8.13.8): queueing@01:00:00
Nov 30 12:52:30 demo sendmail[18484]: nAUEqUP3018484: from=root, size=64, class=0, nrcpts=1, msgid=, relay=root@localhost
Nov 30 12:52:30 demo sendmail[18485]: nAUEqUPW018485: from=, size=365, class=0, nrcpts=1, msgid=, proto=ESMTP, daemon=MTA, relay=demo [127.0.0.1]
Nov 30 12:52:31 demo sendmail[18484]: nAUEqUP3018484: to=agusberre@hotmail.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30064, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (nAUEqUPW018485 Message accepted for delivery)
Nov 30 12:52:54 demo sendmail[18489]: STARTTLS=client: file /etc/mail/certs/sendmail.pem unsafe: No such file or directory
Nov 30 12:52:54 demo sendmail[18489]: STARTTLS=client: file /etc/mail/certs/sendmail.pem unsafe: No such file or directory
Nov 30 12:52:54 demo sendmail[18489]: STARTTLS=client: file /etc/mail/certs/ca-bundle.crt unsafe: No such file or directory
Nov 30 12:52:54 demo sendmail[18489]: STARTTLS=client: file /etc/mail/certs/ca-bundle.crt unsafe: No such file or directory
Nov 30 12:52:54 demo sendmail[18489]: STARTTLS=client, error: load verify locs /etc/mail/certs, /etc/mail/certs/ca-bundle.crt failed: 0
Anybody can help?
Thanks!
Comment by Agustina — November 30, 2009 @ 9:59 am
Thank you! I’ve been working on and off for a week trying to get sendmail SMTPH AUTH relaying to work – this finally got things working. Great post.
Comment by Martin Gerner — March 17, 2010 @ 6:08 am
By the way, some more specific comments: this worked fine on a Debian VM. As noted previously, take extra care if copy-pasting statements from the webpage – quotation marks have a tendency to get scrambled up.
Comment by Martin Gerner — March 17, 2010 @ 6:09 am
[...] which relay on gmail to sendmail i.e i want use sendmail via gmail i did some changes following http://www.phinesolutions.com/sendma…lay-howto.html but am getting May 20 18:26:13 sparrow sendmail[7156]: o4KCuD1R007156: from=<root@sparrow>, [...]
Pingback by sendmail with gmail urgent — May 20, 2010 @ 8:09 am
[...] http://www.phinesolutions.com/sendma…lay-howto.html [...]
Pingback by sendmail with gmail urgent - xBlurb — May 20, 2010 @ 8:46 am
When?I send a mail, I always getting the following error: Server Unavailable in /var/log/syslog.
I can not send a mail. Please Help me.?
###
I made a client-info in /etc/mail/auth
AuthInfo:smptp.gmail.com “U:root” “I:myname@gmail.com” “P:XXXXX” “M:LOGIN PLAIN XOAUTH”
AuthInfo:smptp.gmail.com:587 “U:root” “I:myname@gmail.com” “P:XXXXXX” “M:LOGIN PLAIN XOAUTH”
###
I wrote the sendmail.mc :
/*—————————————————–*/
VERSIONID(`$Id: generic-solaris.mc,v 8.13 2001/06/27 21:46:30 gshapiro Exp $’)
OSTYPE(solaris2)dnl
DOMAIN(generic)dnl
FEATURE(`authinfo’,`hash /etc/mail/auth/client-info.db’)dnl
define(`SMART_HOST’,`smtp.gmail.com’)dnl
define(`RELAY_MAILER_ARGS’,`TCP $h 587′)
define(`ESMTP_MAILER_ARGS’,`TCP $h 587′)
define(`CERT_DIR’, `/etc/mail/certs’)
define(`confCACERT_PATH’, `CERT_DIR’)
define(`confCACERT’, `CERT_DIR/ca-bundle.crt’)
define(`confCRL’, `CERT_DIR/ca-bundle.crt’)
define(`confSERVER_CERT’, `CERT_DIR/sendmail.pem’)
define(`confSERVER_KEY’, `CERT_DIR/sendmail.pem’)
define(`confCLIENT_CERT’, `CERT_DIR/sendmail.pem’)
define(`confCLIENT_KEY’, `CERT_DIR/sendmail.pem’)
define(`confAUTH_MECHANISMS’, `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)
MAILER(local)dnl
MAILER(smtp)dnl
/*———————————————–*/
####
So I try a test, I can not sent a mail out !!
#/usr/ucb/mail -v myname@gmail
Subject: Test a mail
What is This?
.
????
# myname@gmail.com… Connecting to [127.0.0.1] via relay…
220 scdgrp.co.jp ESMTP Sendmail 2009 cw8.14.4/8.14.4; Wed, 16 Jun 2010 13:14:03 +0900 (JST)
>>> EHLO scdgrp.co.jp
250-scdgrp.co.jp Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
250-STARTTLS
250-DELIVERBY
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> STARTTLS
220 2.0.0 Ready to start TLS
>>> EHLO scdgrp.co.jp
250-scdgrp.co.jp Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
250-DELIVERBY
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From: SIZE=76 AUTH=iacsdb@scdgrp.co.jp
250 2.1.0 … Sender ok
>>> RCPT To:
>>> DATA
250 2.1.5 … Recipient ok
354 Enter mail, end with “.” on a line by itself
>>> .
050 … Connecting to smtp.gmail.com port 587 via relay…
050 220 mx.google.com ESMTP a23sm76650385wam.2
050 >>> EHLO scdgrp.co.jp
050 250-mx.google.com at your service, [211.126.195.194]
050 250-SIZE 35651584
050 250-8BITMIME
050 250-STARTTLS
050 250 ENHANCEDSTATUSCODES
050 >>> STARTTLS
050 220 2.0.0 Ready to start TLS
050 >>> EHLO scdgrp.co.jp
050 250-mx.google.com at your service, [211.126.195.194]
050 250-SIZE 35651584
050 250-8BITMIME
050 250-AUTH LOGIN PLAIN XOAUTH
050 250 ENHANCEDSTATUSCODES
050 >>> MAIL From: SIZE=348 AUTH= ??Always empty!!
050 530-5.5.1 Authentication Required. Learn more at
050 530 5.5.1 http://mail.google.com/support/bin/answer.py?answer=14257 a23sm76650385wam.2
050 … forward: /export/home/itoki/iacsdb/.forward.scdgrp+: Group writable directory
050 … forward: /export/home/itoki/iacsdb/.forward+: Group writable directory
050 … forward: /export/home/itoki/iacsdb/.forward.scdgrp: Group writable directory
050 … forward: /export/home/itoki/iacsdb/.forward: Group writable directory
050 … Connecting to local…
050 … Sent
250 2.0.0 o5G4E3Gu000266 Message accepted for delivery
myname@gmail.com… Sent (o5G4E3Gu000266 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 scdgrp.co.jp closing connection
### /var/log/syslog . I am getting the following :Server Unavailable !!
Jun 16 13:14:03 IACS_SRV sendmail[266]: [ID 801593 mail.info] o5G4E3Gu000266: from=, size=348, class=0, nrcpts=1, msgid=, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Jun 16 13:14:04 IACS_SRV sendmail[266]: [ID 702911 mail.info] STARTTLS=client, relay=smtp.gmail.com, version=TLSv1/SSLv3, verify=FAIL, cipher=RC4-MD5, bits=128/128
Jun 16 13:14:05 IACS_SRV sendmail[266]: [ID 801593 mail.info] o5G4E3Gu000266: to=, ctladdr= (5101/500), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=30348, relay=smtp.gmail.com [74.125.53.109], dsn=5.0.0, stat=Service unavailable
Jun 16 13:14:05 IACS_SRV sendmail[266]: [ID 801593 mail.warning] o5G4E3Gu000266: forward /export/home/itoki/iacsdb/.forward.scdgrp+: Group writable directory
Jun 16 13:14:05 IACS_SRV sendmail[266]: [ID 801593 mail.warning] o5G4E3Gu000266: forward /export/home/itoki/iacsdb/.forward+: Group writable directory
Jun 16 13:14:05 IACS_SRV sendmail[266]: [ID 801593 mail.warning] o5G4E3Gu000266: forward /export/home/itoki/iacsdb/.forward.scdgrp: Group writable directory
Jun 16 13:14:05 IACS_SRV sendmail[266]: [ID 801593 mail.warning] o5G4E3Gu000266: forward /export/home/itoki/iacsdb/.forward: Group writable directory
Jun 16 13:14:05 IACS_SRV sendmail[266]: [ID 801593 mail.info] o5G4E3Gu000266: o5G4E3Gv000266: DSN: Service unavailable
Jun 16 13:14:05 IACS_SRV sendmail[266]: [ID 801593 mail.info] o5G4E3Gv000266: to=, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31372, dsn=2.0.0, stat=Sent
Jun 16 13:14:05 IACS_SRV sendmail[265]: [ID 801593 mail.info] o5G4E358000265: to=zhang60@gmail.com, ctladdr=iacsdb (5101/500), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=30076, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o5G4E3Gu000266 Message accepted for delivery)
Comment by Zhang60 — June 15, 2010 @ 11:28 pm
I am sorry ,I made a big mistake in client-info,
AuthInfo:smptp.gmail.com “U:root” “I:myname@gmail.com” “P:XXXXX” “M:LOGIN PLAIN XOAUTH”
not smptp , is smtp .
Now sendmail is OK.
Comment by Zhang60 — June 16, 2010 @ 1:14 am
I get the error same to Jason:
Jun 30 01:21:20 SVR040-04 sendmail[30286]: o5TILKWi030286: from=, size=347, class=0, nrcpts=1, msgid=, proto=ESMTP, daemon=MTA, relay=SVR040-763.localdomain [127.0.0.1]
Jun 30 01:21:20 SVR040-04 sendmail[30285]: o5TILKI2030285: to=x, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30043, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o5TILKWi030286 Message accepted for delivery)
Jun 30 01:21:22 SVR040-04 sendmail[30288]: STARTTLS=client, relay=smtp.gmail.com, version=TLSv1/SSLv3, verify=OK, cipher=RC4-MD5, bits=128/128
Jun 30 01:21:23 SVR040-04 sendmail[30288]: o5TILKWi030286: to=x, ctladdr= (0/0), delay=00:00:03, xdelay=00:00:03, mailer=relay, pri=120347, relay=smtp.gmail.com [74.125.53.109], dsn=5.0.0, stat=Service unavailable
Jun 30 01:21:23 SVR040-04 sendmail[30288]: o5TILKWi030286: o5TILNWh030288: DSN: Service unavailable
Jun 30 01:21:23 SVR040-04 sendmail[30288]: o5TILNWh030288: to=, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31674, dsn=2.0.0, stat=Sent
and I got no email. Can anyone help me?
Comment by huyente — June 29, 2010 @ 1:23 pm
Problem solved.
I have to disable local delivery to get mails in Gmail inbox instead of /var/spool/mail/root, follow Pawel’s post: http://serverfault.com/questions/65365/disable-local-delivery-in-sendmail
Comment by huyente — June 30, 2010 @ 1:11 am
Great article!saved me lots of times!
@Rod_Rook you must have the sendmail-cf library missing, use yum or apt-get install sendmail-cf and your problem will be solved.
Comment by Emad Al-Shihabi — July 15, 2010 @ 1:31 pm