Thursday, May 19, 2011

Make sendmail to use gmail MTA

[amit@thebuggzbox ~]$ sudo yum install ssmtp
[amit@thebuggzbox ~]$ sudo bash -c 'cat > /etc/ssmtp/ssmtp.conf'
AuthUser=yourgmailid@gmail.com
AuthPass=yourgmailpassword
FromLineOverride=YES
UseSTARTTLS=YES
mailhub=smtp.gmail.com:587 (press ctrl+d here)
[amit@thebuggzbox ~]$ sudo service sendmail stop
[amit@thebuggzbox ~]$ sudo chkconfig sendmail off
[amit@thebuggzbox ~]$ sudo mv /usr/sbin/sendmail ~
[amit@thebuggzbox ~]$ sudo ln -s /usr/sbin/ssmtp /usr/sbin/sendmail
[amit@thebuggzbox ~]$ echo "this is sample test mail" | mail -s "test mail" thebuggz@gmail.com
[amit@thebuggzbox ~]$

[Hope you dont need any explanation from my side though i am open if any]

3 comments:

  1. you post is interesting, i have been unable to get sendmail to work, your method is a patch but does work. Why have you gone this method?

    ReplyDelete
  2. Have you tried to configure senmail and give up? your post works, but not with my mediawiki (yet)... its a patch around sendmail authentication.. no?

    ReplyDelete
  3. I am not sure ..what forced me to use this .. but i can try using same method mediawiki emails. will try it on weekend

    ReplyDelete