cdx

Wednesday, 13 November 2013

Send eMail SMTP Relay Gmail Google Apps



Configuration send email to use G-mail+Google apps the external SMTP server & have it authenticate properly.Yum install sendmail sendmail-cf 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 have restarted 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.


No comments:

Post a Comment

cdx