Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


gmail_as_a_relay_on_linux_centos8

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
gmail_as_a_relay_on_linux_centos8 [2022/03/18 14:28] juckinsgmail_as_a_relay_on_linux_centos8 [2022/03/18 14:32] juckins
Line 13: Line 13:
     * The "Less Secure Apps" is not available in Gmail if your account is configured for 2-factor authentication     * The "Less Secure Apps" is not available in Gmail if your account is configured for 2-factor authentication
     * Everything should work OK.     * Everything should work OK.
 +
 +Perform the following steps as root:
 +  
 +  cd /etc/postfix
 +  cp main.cf main.cf.distro
 +  mkdir /etc/postfix/sasl
 +  cd /etc/postfix/sasl
 +  vi sasl_passwd
 +
 +Add this line:
 +
 +  [smtp.gmail.com]:587 [email protected]:password
 +
 +  postmap /etc/postfix/sasl/sasl_passwd
 +  chown root:root /etc/postfix/sasl/sasl_passwd /etc/postfix/sasl/sasl_passwd.db
 +  chmod 0600 /etc/postfix/sasl/sasl_passwd /etc/postfix/sasl/sasl_passwd.db
 +
 +  vi /etc/postfix/main.cf
 +
 +Comment out this line:
 +
 +  #smtp_tls_security_level = may
 +
 +Now wdd to the end of the main.cf file:
 +
 +  # Local Edits
 +  relayhost = [smtp.gmail.com]:587
 +  # Enable SASL authentication
 +  smtp_sasl_auth_enable = yes
 +  # Disallow methods that allow anonymous authentication
 +  smtp_sasl_security_options = noanonymous
 +  # Location of sasl_passwd
 +  smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
 +  # Enable STARTTLS encryption
 +  smtp_tls_security_level = encrypt
 +  # Location of CA certificates
 +  smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
 +
 +Restart postfix:
 +
 +  systemctl restart postfix
  
gmail_as_a_relay_on_linux_centos8.txt · Last modified: 2022/05/21 18:40 by juckins