Skip navigation

I need to be able to relay mail over SMTP from a sendmail instance on Fedora, through Google Mail servers. This is how I did it.

(Make sure you have the m4, sendmail, and sendmail-cf package installed.)

In the client auth config (/etc/mail/auth/client-info):

AuthInfo:smtp.gmail.com "U:root" "I:myusername@gmail.com" "P:password" "M:PLAIN"
AuthInfo:smtp.gmail.com:587 "U:root" "I:myusername@gmail.com" "P:password" "M:PLAIN"

Create the client info database file:

sudo makemap -r hash client-info.db
sudo chmod 600 /etc/mail/auth/client-info
sudo chmod 600 /etc/mail/auth/client-info.db

UPDATE: The above stopped working for me as of Fedora 19, the following is what I had to use to update the client-info.db:

cd /etc/mail/auth
sudo makemap -v hash client-info.db < client-info
sudo chmod 600 /etc/mail/auth/client-info
sudo chmod 600 /etc/mail/auth/client-info.db

The M4 configuration:

Feature	FEATURE(`authinfo',`hash /etc/mail/auth/client-info.db')dnl	
Define	define(`SMART_HOST',`smtp.gmail.com')dnl	
Define	define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl	
Define	define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl	
Define	define(`CERT_DIR', `/etc/mail/ssl')dnl	
Define	define(`confCACERT_PATH', `CERT_DIR')dnl	
Define	define(`confCACERT', `CERT_DIR/ca-bundle.crt')dnl	
Define	define(`confCRL', `CERT_DIR/ca-bundle.crt')dnl	
Define	define(`confSERVER_CERT', `CERT_DIR/sendmail.pem')dnl	
Define	define(`confSERVER_KEY', `CERT_DIR/sendmail.pem')dnl	
Define	define(`confCLIENT_CERT', `CERT_DIR/sendmail.pem')dnl	
Define	define(`confCLIENT_KEY', `CERT_DIR/sendmail.pem')dnl	
Define	define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN') TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl

Rebuild the config:

m4 sendmail.mc > sendmail.cf

If you run into SELinux denials, check your sendmail flags with:
sestatus -b | grep -i sendmail
If you see 'http_can_sendmail' is off, issue setsebool -P httpd_can_sendmail 1

12 Trackbacks/Pingbacks

  1. By website here on 19 Sep 2020 at 10:38 pm

    … [Trackback]

    […] Read More on that Topic: jackson-brain.com/configuring-sendmail-to-use-google-gmail-and-google-apps-mail-relay/ […]

  2. By pinewswire on 19 Sep 2020 at 10:46 pm

    … [Trackback]

    […] Info to that Topic: jackson-brain.com/configuring-sendmail-to-use-google-gmail-and-google-apps-mail-relay/ […]

  3. By Bitcoin Loophole Review on 19 Sep 2020 at 11:02 pm

    … [Trackback]

    […] Find More Info here on that Topic: jackson-brain.com/configuring-sendmail-to-use-google-gmail-and-google-apps-mail-relay/ […]

  4. By 링크사이트 on 20 Sep 2020 at 12:02 am

    … [Trackback]

    […] Find More on that Topic: jackson-brain.com/configuring-sendmail-to-use-google-gmail-and-google-apps-mail-relay/ […]

  5. By eatverts on 20 Sep 2020 at 12:12 am

    … [Trackback]

    […] Information to that Topic: jackson-brain.com/configuring-sendmail-to-use-google-gmail-and-google-apps-mail-relay/ […]

  6. … [Trackback]

    […] Read More on that Topic: jackson-brain.com/configuring-sendmail-to-use-google-gmail-and-google-apps-mail-relay/ […]

  7. By Governance Risk Compliance System on 22 Sep 2020 at 8:22 pm

    … [Trackback]

    […] Read More on to that Topic: jackson-brain.com/configuring-sendmail-to-use-google-gmail-and-google-apps-mail-relay/ […]

  8. … [Trackback]

    […] There you will find 91040 more Info to that Topic: jackson-brain.com/configuring-sendmail-to-use-google-gmail-and-google-apps-mail-relay/ […]

  9. … [Trackback]

    […] There you can find 3449 additional Info on that Topic: jackson-brain.com/configuring-sendmail-to-use-google-gmail-and-google-apps-mail-relay/ […]

  10. By Blazing Trader on 24 Sep 2020 at 4:46 pm

    … [Trackback]

    […] There you will find 68912 more Information on that Topic: jackson-brain.com/configuring-sendmail-to-use-google-gmail-and-google-apps-mail-relay/ […]

  11. By Codeine for sale without prescription usa on 25 Sep 2020 at 12:31 am

    … [Trackback]

    […] Read More here to that Topic: jackson-brain.com/configuring-sendmail-to-use-google-gmail-and-google-apps-mail-relay/ […]

  12. By Immediate Edge on 26 Sep 2020 at 4:58 pm

    … [Trackback]

    […] Info on that Topic: jackson-brain.com/configuring-sendmail-to-use-google-gmail-and-google-apps-mail-relay/ […]

Leave a Reply