How to Relay Emails to Gmail: Difference between revisions
Jump to navigation
Jump to search
Jgutierrez6 (talk | contribs) No edit summary |
Jgutierrez6 (talk | contribs) No edit summary |
||
Line 41: | Line 41: | ||
smtp_tls_security_level = encrypt | smtp_tls_security_level = encrypt | ||
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt | smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt | ||
</source> | |||
# Set up authentication file for gmail | |||
#* <source> | |||
vim /etc/postfix/sasl_passwd | |||
//Paste this line and replace | |||
[smtp.gmail.com]:587 docking.email@gmail.com: | |||
</source> | </source> |
Revision as of 22:23, 1 September 2022
Introduction
This tutorial applies to RHEL 8 based operating systems (CentOS, Rocky Linux)
Two machines that send emails are:
- vav.combpio.ucsf.edu
- bksmailman.compbio.ucsf.edu
Relaying emails through gmail will make it more secure and trustworthy.
Instructions
- Create a gmail account OR Ask Khanh for docking.email@gmail.com for credentials.
- Disable pre-installed 'sendmail' package
rpm -q sendmail (Check for package) systemctl disbale sendmail --now (Disable package)
- Enable smtp in firewall
firewall-cmd --permanent --add-service=smtp
- Install Postfix and other dependencies
yum install postfix mailx cyrus-sasl cyrus-sasl-plain -y
- Configure Postfix
vim /etc/postfix/main.cf //Copy these lines and paste it at the bottom of the main.cf file relayhost = [smtp.gmail.com]:587 smtp_use_tls = yes smtp_sasl_auth_enable = yes smtp_sasl_security_options = noanonymous smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_tls_security_level = encrypt smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
- Set up authentication file for gmail
vim /etc/postfix/sasl_passwd //Paste this line and replace [smtp.gmail.com]:587 docking.email@gmail.com: