{"id":277806,"date":"2016-04-06T23:17:03","date_gmt":"2016-04-06T19:17:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=277806"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=277806","title":{"rendered":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 sendmail \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u043e\u0447\u0442\u044b \u0447\u0435\u0440\u0435\u0437 gmail.com"},"content":{"rendered":"<p>       \u0414\u043e\u043b\u0433\u043e \u0438\u0441\u043a\u0430\u043b \u0432\u043d\u044f\u0442\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 sendmail, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0435\u0442\u0438, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0447\u0442\u0443 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043c\u0438\u0440. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 relay \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d smtp.gmail.com<\/p>\n<p>  \u041f\u0435\u0440\u0435\u043a\u043e\u043f\u0430\u043b \u0438 \u0438\u0441\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043a\u0443\u0447\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u0432 \u0441\u0435\u0442\u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0448\u0438\u043a\u043e\u043c.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0432\u0435\u043d\u0447\u0430\u043b\u0441\u044f \u0443\u0441\u043f\u0435\u0445\u043e\u043c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u0440\u0435\u043c\u044f. <br \/>   <a name=\"habracut\"><\/a><br \/>  \u0421\u0438\u0441\u0442\u0435\u043c\u0430: CentOS 6.3 (2.6.32-279.el6.x86_64).<br \/>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0443\u0436\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.  <\/p>\n<pre><code class=\"bash\">uym install sendmail sendmail-cf openssl cyrus-sasl cyrus-sasl-plain nano <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432.  <\/p>\n<pre><code class=\"bash\">mkdir \/etc\/mail\/certs chmod 700 \/etc\/mail\/certs  cd \/etc\/mail\/certs openssl dsaparam 1024 -out dsa1024 -out dsa1024.pem openssl req -x509 -nodes -days 3650 -newkey dsa:dsa1024.pem -out \/etc\/mail\/certs\/mycert.pem -keyout \/etc\/mail\/certs\/mykey.pem openssl req -x509 -new -days 3650 -key \/etc\/mail\/certs\/mykey.pem -out \/etc\/mail\/certs\/mycert.pem ln -s \/etc\/mail\/certs\/mycert.pem \/etc\/mail\/certs\/CAcert.pem chmod 600 \/etc\/mail\/certs\/* <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.  <\/p>\n<pre><code class=\"bash\">nano \/etc\/mail\/auth\/authinfo <\/code><\/pre>\n<p>  <\/p>\n<pre><code>AuthInfo:smtp.gmail.com &quot;U:root&quot; &quot;I:USERNAME@gmail.com&quot; &quot;P:PASSWORD&quot; AuthInfo: &quot;U:root&quot; &quot;I:USERNAME@gmail.com&quot; &quot;P:PASSWORD&quot; <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c.  <\/p>\n<pre><code>makemap hash -r \/etc\/mail\/auth\/authinfo &lt; \/etc\/mail\/auth\/authinfo <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 sendmail.mc \u043d\u0443\u0436\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e. (\u0412\u0430\u0436\u043d\u043e: \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e FEATURE)  <\/p>\n<pre><code>dnl # Smrp relay define(`CERT_DIR', `MAIL_SETTINGS_DIR`'certs') define(`confCACERT_PATH', `CERT_DIR') define(`confCACERT', `CERT_DIR\/CAcert.pem') define(`confSERVER_CERT', `CERT_DIR\/mycert.pem') define(`confSERVER_KEY', `CERT_DIR\/mykey.pem') define(`confCLIENT_CERT', `CERT_DIR\/mycert.pem') define(`confCLIENT_KEY', `CERT_DIR\/mykey.pem') dnl # dnl # gmail auth define(`SMART_HOST',`[smtp.gmail.com]')dnl define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl define(`confAUTH_OPTIONS', `A p')dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl FEATURE(`authinfo',`hash -o \/etc\/mail\/auth\/authinfo.db')dnl <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c sendmail \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u043f\u043e\u0447\u0442\u044b.  <\/p>\n<pre><code>make -C \/etc\/mail service sendmail restart sendmail -f USERNAME@gmail.com -v receiver@mail.domen Test . <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.  <\/p>\n<pre><code>mailq tail maillog <\/code><\/pre>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/281102\/\"> https:\/\/habrahabr.ru\/post\/281102\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0414\u043e\u043b\u0433\u043e \u0438\u0441\u043a\u0430\u043b \u0432\u043d\u044f\u0442\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 sendmail, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0435\u0442\u0438, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0447\u0442\u0443 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043c\u0438\u0440. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 relay \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d smtp.gmail.com<\/p>\n<p>  \u041f\u0435\u0440\u0435\u043a\u043e\u043f\u0430\u043b \u0438 \u0438\u0441\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043a\u0443\u0447\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u0432 \u0441\u0435\u0442\u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0448\u0438\u043a\u043e\u043c.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0432\u0435\u043d\u0447\u0430\u043b\u0441\u044f \u0443\u0441\u043f\u0435\u0445\u043e\u043c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u0440\u0435\u043c\u044f.    <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-277806","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/277806","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=277806"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/277806\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=277806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=277806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=277806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}