How to Send an E-mail from CentOS 7

Автор: | 25.04.2024

How to Send an E-mail from CentOS 7

1. yum install -y postfix cyrus-sasl-plain mailx
2. nano /etc/postfix/main.cf
3. relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
4. nano /etc/postfix/sasl_passwd
5. [smtp.gmail.com]:587 youremail@gmail.com:yourpassword
6. chown root:root /etc/postfix/sasl_passwd
   chmod 600 /etc/postfix/sasl_passwd
   postmap /etc/postfix/sasl_passwd
7. systemctl restart postfix

Добавить комментарий