Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


gmail_on_linux_with_ssmtp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
gmail_on_linux_with_ssmtp [2015/11/04 18:07] juckinsgmail_on_linux_with_ssmtp [2016/10/22 08:29] (current) juckins
Line 7: Line 7:
 [[http://www.terminally-incoherent.com/blog/2006/09/29/mutt-with-ssmtp/]] [[http://www.terminally-incoherent.com/blog/2006/09/29/mutt-with-ssmtp/]]
  
-Edit ~/.muttrc for each user as appropriate:+Edit ~/.muttrc for each user as appropriate (not that $HOSTNAME does not seem to be set with cron sending)
  
 <code> <code>
Line 47: Line 47:
 4 November 2015 4 November 2015
  
-Gmail stopped working.  Try a PHP or Perl solution?  Does it require SSMTP or MSMTP?+Gmail stopped working.  
  
 This did not work: https://productforums.google.com/forum/?hl=en#!topic/gmail/2tK2fR7yW-k;context-place=forum/gmail This did not work: https://productforums.google.com/forum/?hl=en#!topic/gmail/2tK2fR7yW-k;context-place=forum/gmail
  
-Try these links:\\+Try a PHP or Perl solution, but does it require SSMTP or MSMTP?
  
-https://www.digitalocean.com/community/tutorials/how-to-use-gmail-or-yahoo-with-php-mail-function \\ +Final answer was to configure [[gmail_as_a_relay_on_linux|Gmail as a Relay]]
-http://serverfault.com/questions/194376/how-to-send-email-with-my-centos-server \\ +
-http://rs20.mine.nu/w/2011/07/gmail-as-relay-host-in-postfix/ \\ +
- +
- +
-These directions [[http://mhawthorne.net/posts/postfix-configuring-gmail-as-relay.html|based on this page]] worked: \\ +
- +
-1. Make backup copy of /etc/postfix/main.cf +
- +
-2. Edit /etc/postfix/main.cf to have these settings: +
- +
-<code> +
-# sets gmail as relay +
-relayhost = [smtp.gmail.com]:587 +
- +
-#  use tls +
-smtp_use_tls=yes +
- +
-# use sasl when authenticating to foreign SMTP servers +
-smtp_sasl_auth_enable = yes  +
- +
-# path to password map file +
-smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd +
- +
-# list of CAs to trust when verifying server certificate +
-#smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt +
-# Below is provided by ca-certificates package (Mozilla CA root certificate bundle) +
-smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt +
- +
-# eliminates default security options which are incompatible with Gmail +
-smtp_sasl_security_options = +
- +
-# add debugging +
-debug_peer_list=smtp.gmail.com +
-debug_peer_level=3 +
-</code> +
- +
-2. Add your own Gmail credentials to /etc/postfix/sasl_passwd \\ +
-<code> +
-[smtp.gmail.com]:587  username:password +
-</code> +
- +
-3. Run the following as root: \\ +
-<code> +
-# postmap /etc/postfix/sasl_passwd +
-</code> +
- +
-4. Make sure the /etc/sasl_passwd* files are owned by the postfix user: \\ +
-<code> +
-# chown postfix sasl_passwd* +
-</code> +
- +
-5. Tighten permissions: \\ +
-<code> +
-# chmod 600 sasl_passwd sasl_passwd.db +
-</code> +
- +
-6. Restart postfix: \\ +
-<code> +
-# /etc/init.d/postfix reload +
-</code> +
-or +
-<code> +
-# service postfix restart +
-</code> +
- +
-7. Send a test message: \\ +
-<code> +
-echo 'It works' | mailx -s 'Test message' [email protected] +
-</code> +
- +
-8. Check mutt configuration for proper "From" settings.  +
gmail_on_linux_with_ssmtp.1446678459.txt.gz · Last modified: 2015/11/04 18:07 by juckins