{"id":50,"date":"2016-08-31T15:44:39","date_gmt":"2016-08-31T13:44:39","guid":{"rendered":"http:\/\/developer.ps\/?p=50"},"modified":"2026-09-22T20:52:17","modified_gmt":"2026-09-22T18:52:17","slug":"install-ssmtp-on-centos-7","status":"publish","type":"post","link":"https:\/\/developer.ps\/index.php\/2016\/08\/31\/install-ssmtp-on-centos-7\/","title":{"rendered":"Install SSMTP on Centos 7"},"content":{"rendered":"<p>Add the repo if it&#8217;s not added:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">yum install epel-release -y<\/pre>\n<p><strong>Install:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">yum -y install ssmtp\n\n(yum install mailx) if not installed<\/pre>\n<p><strong>Configure:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">alternatives --config mta<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">There are 2 programs which provide 'mta'.\n\n  Selection    Command\n-----------------------------------------------\n*+ 1           \/usr\/sbin\/sendmail.postfix\n   2           \/usr\/sbin\/sendmail.ssmtp\n\nEnter to keep the current selection[+], or type selection number:<\/pre>\n<p>2<\/p>\n<p><strong>Disable postfix (or sendmail):<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl stop postfix\n\nsystemctl disable postfix<\/pre>\n<p><strong>Edit SSMTP config file: (\/etc\/ssmtp\/ssmtp.conf)<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">root=postmaster\nTLS_CA_File=\/etc\/ssl\/certs\/ca-bundle.crt #check your certificate path\nmailhub=smtp.gmail.com:587   # SMTP server for Gmail\nHostname=localhost\nUseTLS=YES\nUseSTARTTLS=Yes\nFromLineOverride=YES #TO CHANGE FROM EMAIL\nRoot=ROOT@EMAIL # Redirect root email\nAuthUser=EMAIL@gmail.com\nAuthPass=PASSWORD\nAuthMethod=LOGIN\nRewriteDomain=gmail.com<\/pre>\n<p><strong>Test:<\/strong><\/p>\n<div class=\"codecolorer-container text blackboard\">\n<div class=\"text codecolorer\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">echo \"TEST EMAIL\" | mail -s \"SSMTP IS WORKING\" TEST@gmail.com<\/pre>\n<\/div>\n<\/div>\n<p>Probably we&#8217;ll get this error:<\/p>\n<p>send-mail: Authorization failed (534 5.7.14\u00a0 https:\/\/support.google.com\/mail\/answer\/78754 r142sm8267633wme.10 &#8211; gsmtp)<\/p>\n<p>and Maybe an email to your gmail account with the title: <strong>Review blocked sign-in attempt<\/strong>. This is because you have to authorize the App. To do so follow this link: https:\/\/support.google.com\/accounts\/answer\/6010255<\/p>\n<p>Update:<\/p>\n<p>Seems there is problem with SSMTP and passwords containing special characters such as &#8220;#,$,*&#8230;&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Add the repo if it&#8217;s not added: yum install epel-release -y Install: yum -y install ssmtp (yum install mailx) if not installed Configure: alternatives &#8211;config [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,13],"tags":[],"class_list":["post-50","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux"],"_links":{"self":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/comments?post=50"}],"version-history":[{"count":13,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts\/50\/revisions"}],"predecessor-version":[{"id":209,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/posts\/50\/revisions\/209"}],"wp:attachment":[{"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/media?parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/categories?post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.ps\/index.php\/wp-json\/wp\/v2\/tags?post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}