Posted On April 1, 2019

Set Up Mail Relay Server with CentOS

kimconnect 0 comments
blog.KimConnect.com >> Linux >> Set Up Mail Relay Server with CentOS
Notes from 2011...

Method 1: Set this relay server to use another server as a relay
yum remove sendmail
yum -y install postfix cyrus-sasl-plain mailx vim
systemctl restart postfix
systemctl enable postfix
vim /etc/postfix/main.cf
---------
relayhost = smtp.gmail.com:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
---------
vim /etc/postfix/sasl_passwd
---------
smtp.gmail.com:587 [email protected]:PASSWORD
---------
postmap /etc/postfix/sasl_passwd
chown root:postfix /etc/postfix/sasl_passwd*
chmod 640 /etc/postfix/sasl_passwd*
systemctl reload postfix
chkconfig --level 2345 postfix on


Test:
echo "This is a test." | mail -s "test message" [email protected]


Troubleshoot:
tail -f /var/log/maillog


Method 2: Set this machine as a relay server itself
vim /etc/postfix/main.cf
---------
myhostname = srvi-relay01.kimconnect.net
mydomain = kimconnect.net
mynetworks = 192.168.900.0/24, 10000.1000.1000.0/16, 127.0.0.0/8
---------
vim /etc/postfix/sasl_passwd
---------
smtp.gmail.com [email protected]:PASSWORD
---------

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Problem: NextCloud Would Not Start Due to Versioning Variance

This issue has occurred when NextCloud has been upgraded after deployment. Its source docker container…

How to Upgrade Kubernetes Ingress Nginx Deployed via Helm

# How to upgrade ingress-nginx: helm upgrade --reuse-values ingress-nginx ingress-nginx/ingress-nginx -n ingress-nginx # Sample output of a failure scenario: brucelee@k8-controller:~$ helm…

An Issue with RSA Key On CentOS 8

Error message seen by checking SSH Daemon status: [root@linux1 testadmin]# service sshd statusRedirecting to /bin/systemctl…