{"id":75,"date":"2019-11-03T19:48:56","date_gmt":"2019-11-03T12:48:56","guid":{"rendered":"http:\/\/naitinoi.com\/?p=75"},"modified":"2019-11-03T19:59:51","modified_gmt":"2019-11-03T12:59:51","slug":"configure-a-postfix-relay-through-gmail-on-centos","status":"publish","type":"post","link":"https:\/\/omtel.ltd\/index.php\/2019\/11\/03\/configure-a-postfix-relay-through-gmail-on-centos\/","title":{"rendered":"Configure a Postfix Relay through Gmail on CentOS"},"content":{"rendered":"<p>[root@fs ~]# yum -y install postfix cyrus-sasl-plain mailx<br \/>\n[root@fs ~]# ee \/etc\/postfix\/main.cf<br \/>\n####### RELAY GMAIL ######<br \/>\nrelayhost = [smtp.gmail.com]:587<br \/>\nsmtp_use_tls = yes<br \/>\nsmtp_sasl_auth_enable = yes<br \/>\nsmtp_sasl_password_maps = hash:\/etc\/postfix\/sasl_passwd<br \/>\nsmtp_tls_CAfile = \/etc\/ssl\/certs\/ca-bundle.crt<br \/>\nsmtp_sasl_security_options = noanonymous<br \/>\nsmtp_sasl_tls_security_options = noanonymous<\/p>\n<p>[root@fs ~]# ee \/etc\/postfix\/sasl_passwd<br \/>\n[smtp.gmail.com]:587 bots@naitinoi.com:sana2455xxxx<\/p>\n<p>[root@fs ~]# postmap \/etc\/postfix\/sasl_passwd<br \/>\n[root@fs ~]# chown root:postfix \/etc\/postfix\/sasl_passwd*<br \/>\n[root@fs ~]# chmod 640 \/etc\/postfix\/sasl_passwd*<br \/>\n[root@fs ~]# service postfix restart<br \/>\nShutting down postfix:                                     [FAILED]<br \/>\nStarting postfix:                                          [  OK  ]<br \/>\n[root@fs ~]# echo &#8220;This is a test.&#8221; | mail -s &#8220;test message&#8221; mail@some.co.th<\/p>\n<p>[root@fs ~]# ee \/etc\/aliases<br \/>\nroot:  \t       testuser@naitinoi.com<br \/>\n[root@fs ~]# newaliases<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[root@fs ~]# yum -y install postfix cyrus-sasl-plain ma [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-75","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/omtel.ltd\/index.php\/wp-json\/wp\/v2\/posts\/75","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/omtel.ltd\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/omtel.ltd\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/omtel.ltd\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/omtel.ltd\/index.php\/wp-json\/wp\/v2\/comments?post=75"}],"version-history":[{"count":1,"href":"https:\/\/omtel.ltd\/index.php\/wp-json\/wp\/v2\/posts\/75\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/omtel.ltd\/index.php\/wp-json\/wp\/v2\/posts\/75\/revisions\/76"}],"wp:attachment":[{"href":"https:\/\/omtel.ltd\/index.php\/wp-json\/wp\/v2\/media?parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/omtel.ltd\/index.php\/wp-json\/wp\/v2\/categories?post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/omtel.ltd\/index.php\/wp-json\/wp\/v2\/tags?post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}