{"id":3578,"date":"2014-09-21T23:48:35","date_gmt":"2014-09-21T15:48:35","guid":{"rendered":"http:\/\/rmohan.com\/?p=3578"},"modified":"2014-09-21T23:48:35","modified_gmt":"2014-09-21T15:48:35","slug":"smtp-relay-server-with-rhel","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=3578","title":{"rendered":"SMTP relay server with RHEL"},"content":{"rendered":"<p>I prefer to use corporate mail <span id=\"IL_AD1\" class=\"IL_AD\">server for<\/span> mail relay mails from Linux box.<\/p>\n<p>While <a href=\"http:\/\/www.linuxreaders.com\/2009\/04\/19\/nagios-installation\/\" target=\"_blank\">settingup Nagios <\/a>for my <span id=\"IL_AD2\" class=\"IL_AD\">friend and<\/span> as he insisted using <span id=\"IL_AD3\" class=\"IL_AD\">Gmail<\/span> to send Nagios alters I found <a href=\"http:\/\/bookmarks.honewatson.com\/2008\/04\/20\/postfix-gmail-smtp-relay\/#comment-1154\" target=\"_blank\">interesting post<\/a>.<\/p>\n<p><strong>Install dependencies.<\/strong><\/p>\n<blockquote><p>yum -y install openssl-perl<\/p><\/blockquote>\n<p>If \/etc\/pki\/CA\/private\/cakey.pem does not exists<\/p>\n<blockquote><p>\/etc\/pki\/tls\/misc\/CA.pl -newca<\/p><\/blockquote>\n<p>That will create the cakey.pem file in \/etc\/pki\/CA\/private<\/p>\n<p>Then edit the file \/etc\/pki\/tls\/openssl.cnf and set<\/p>\n<p>dir = \/etc\/pki\/CA<\/p>\n<p><strong>Generate CSR <\/strong>(in \/etc\/postfix\/certs)<\/p>\n<blockquote><p>openssl genrsa -out itchy.key 1024<br \/>\nopenssl req -new -key itchy.key -out itchy.csr<br \/>\nopenssl ca -out itchy.pem -infiles itchy.csr<\/p><\/blockquote>\n<p><strong>Postfix Configuration<\/strong><\/p>\n<blockquote><p>relayhost = [smtp.gmail.com]:587<\/p>\n<p>#auth<br \/>\nsmtp_sasl_auth_enable=yes<br \/>\nsmtp_sasl_password_maps = hash:\/etc\/postfix\/sasl_passwd<\/p>\n<p>#tls<br \/>\nsmtp_use_tls = yes<br \/>\nsmtp_sasl_security_options = noanonymous<br \/>\nsmtp_sasl_tls_security_options = noanonymous<br \/>\nsmtp_tls_note_starttls_offer = yes<br \/>\ntls_random_source = dev:\/dev\/urandom<br \/>\nsmtp_tls_scert_verifydepth = 5<br \/>\nsmtp_tls_key_file=\/etc\/postfix\/certs\/itchy.key<br \/>\nsmtp_tls_cert_file=\/etc\/postfix\/certs\/itchy.pem<br \/>\nsmtpd_tls_ask_ccert = yes<br \/>\nsmtpd_tls_req_ccert =no<br \/>\nsmtp_tls_enforce_peername = no<\/p><\/blockquote>\n<p><strong>cat \/etc\/postfix\/sasl_passwd<\/strong><\/p>\n<p>gmail-smtp.l.google.com user@gmail.com:password<br \/>\nsmtp.gmail.com user@gmail.com:password<\/p>\n<blockquote><p>postmap \/etc\/postfix\/sasl_passwd<\/p>\n<p>\/etc\/init.d\/postfix reload<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I prefer to use corporate mail server for mail relay mails from Linux box.<\/p>\n<p>While settingup Nagios for my friend and as he insisted using Gmail to send Nagios alters I found interesting post.<\/p>\n<p>Install dependencies.<\/p>\n<p>yum -y install openssl-perl<\/p>\n<p>If \/etc\/pki\/CA\/private\/cakey.pem does not exists<\/p>\n<p>\/etc\/pki\/tls\/misc\/CA.pl -newca<\/p>\n<p>That will create the cakey.pem file in \/etc\/pki\/CA\/private<\/p>\n<p> [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3578"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3578"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3578\/revisions"}],"predecessor-version":[{"id":3579,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3578\/revisions\/3579"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}