I spent the better part of 2 days trying to configure sendmail to use gmail/google apps as the external smtp server and have it authenticate properly.
In the end to get it working I uninstalled sendmail, completely deleted the /etc/mail directory then reinstalled sendmail
yum install sendmail sendmail-cf
I then followed these instructions
cd /etc/mail
hostname -f > genericsdomain
touch genericstable
makemap -r hash genericstable.db < genericstable
mv sendmail.mc sendmail.mc.original
wget http://pbxinaflash.net/source/sendmail/sendmail.mc.gmail
# If the above file is no longer available I've uploaded a mirror here
# wget http://network-13.com/sendmail.mc.gmail
cp sendmail.mc.gmail sendmail.mc
mkdir -p auth
chmod 700 auth
cd auth
nano client-info
AuthInfo:smtp.gmail.com "U:smmsp" "I:user_id" "P:password" "M:PLAIN"
AuthInfo:smtp.gmail.com:587 "U:smmsp" "I:user_id" "P:password" "M:PLAIN"
# Replace user_id with your gmail username without @gmail.com
# If you're using google apps then enter your full email address user@yourdomain.com
# Replace password with your own gmail/google apps password
# Save your changes (Ctrl-X, Y, then Enter)
chmod 600 client-info
makemap -r hash client-info.db < client-info
cd ..
make
service sendmail restart
After you've restarted the sendmail service you can test it using the following command
echo "Test" | mail user@domain.com
Changing user@domain.com to the address you want to send the test email to. If it works you should receive an email with a blank subject and the word "Test" as the message body.
For anyone else that stumbles on this thread trying to get sendmail to route through google apps...
The need in the haystack for my Debian config was to install the following packages:
apt-get install sendmail (-base, -bin, -cf, -mda, -utils) apt-get install sasl2-2 apt-get install libsasl2-2
That last one is the needle in the haystack. Without installing libsasl2-2, sendmail can't supply the plain text auth that google apps requires, and you'll get a "AUTH=client, available mechanisms do not fulfill requirements" error every time you attempt to send mail.
makemap hash /etc/mail/authinfo < /etc/mail/authinfo makemap: /etc/mail/authinfo: line 2: no RHS for LHS " root@pbx:/usr/share/ssl/certs $