Configure Linux Sendmail to send external mail (redhat6)

Source: Internet
Author: User

1. Create a Sendmail Certificate
 
CD/etc/SSL/certs/MakeSendmail. pem
2. Add authinfo to/etc/mail/access.
 
Authinfo: smtp.gmail.com "u: Root" I: User@gmail.com "P: Password" M: Plain "authinfo: smtp.gmail.com:587"U: Root" "I: User@gmail.com" "P: Password" "M: Plain"
Generate Database
 
Makemap-r hash/etc/mail/access. DB </etc/mail/Access

 

3. Configure smarthost to edit/etc/mail/sendmail. MC and add
Feature ('authinfo '  , 'Hash/etc/mail/access. DB  '  ) Dnldefine ('smart _ host '  , 'Smtp .gmail.com  '  ) Dnldefine ('relay _ mailer_args  '  , 'Tcp $ H 587  '  ) Define ('esmtp _ mailer_args  '  , 'Tcp $ H 587  '  ) Define ('cert _ DIR  '  , '/Etc/SSL/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 '  ) 
Write to sendmail. cf
 
M4 sendmail. MC> sendmail. cf

 

4. Restart the sendmail service.
 
Service Sendmail restart
Reference address:

Http://appgirl.net/blog/2009/configuring-sendmail-to-relay-through-gmail-smtp/

Http://tech.bluesmoon.info/2008/03/gmail-smtp-with-sendmail.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.