{"id":1180,"date":"2019-08-30T20:37:15","date_gmt":"2019-08-30T12:37:15","guid":{"rendered":"http:\/\/van-yzt.com\/?p=1180"},"modified":"2019-09-05T12:42:14","modified_gmt":"2019-09-05T04:42:14","slug":"linux%e4%bd%bf%e7%94%a8qq-smtp%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%8f%91%e9%80%81%e9%82%ae%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/huzi-baozi.com\/?p=1180","title":{"rendered":"Linux\u4f7f\u7528QQ SMTP\u670d\u52a1\u5668\u53d1\u9001\u90ae\u4ef6"},"content":{"rendered":"<p>\u7740\u5b9e\u641e\u4e86\u6211\u6574\u6574\u4e00\u5929\uff0c\u8270\u8f9b\u7684\u8fc7\u7a0b\u5c31\u4e0d\u8bf4\u4e86\uff0c\u76f4\u63a5\u8bf4\u4f7f\u7528\u548c\u914d\u7f6e\u3002<br \/>\n<strong>\u7279\u522b\u6ce8\u610f\uff1asmtp.qq.com\u7528\u4e8e\u666e\u901a\u7528\u6237\uff0cstmp.exmail.qq.com\u7528\u4e8e\u4f01\u4e1a\u7528\u6237<\/strong><\/p>\n<h2>\n\u65b9\u5f0f\u4e00<\/h2>\n<h3>\n\u5de5\u5177<\/h3>\n<ul>\n<li>\nssmtp<\/li>\n<li>\nmailutils\uff08\u53ef\u6709\u53ef\u65e0\u5427\uff09<\/li>\n<\/ul>\n<h3>\n\u914d\u7f6eSMTP<\/h3>\n<h4>\n\u914d\u7f6e\/etc\/ssmtp\/ssmtp.conf<\/h4>\n<pre><code class=\"language-shell\">root=van                        # \u540d\u5b57\uff0c\u4e0d\u91cd\u8981\nhostname=van                    # \u673a\u5668\u540d\uff0c\u4e0d\u91cd\u8981\nmailhub=smtp.exmail.qq.com:465  # QQ\u6709\u63d0\u4f9b\uff0c\u91cd\u8981\nrewriteDomain=qq.com            # \u8f6c\u53d1\u57df\u540d\uff0c\u91cd\u8981\nAuthUser=yuzetao@chafou.com     # \u4f60\u7684\u90ae\u4ef6\u5730\u5740\uff0c\u91cd\u8981\nAuthPass=xxxx                   # QQ\u7ed9\u7684\u6388\u6743\u7801\uff0c\u91cd\u8981\nFromLineOverride=YES            # \u53ef\u4ee5\u8986\u76d6From\u7b49header\uff0c\u91cd\u8981\uff08QQ\u4f1a\u6821\u9a8cFrom\u5b57\u6bb5\uff09\nUseTLS=YES                      # \u5f3a\u5236\u4f7f\u7528TLS\uff0c\u91cd\u8981\uff08QQ\u5f3a\u5236\uff09\n\n<\/code><\/pre>\n<h4>\n\u914d\u7f6e\/etc\/ssmtp\/revaliases<\/h4>\n<pre><code class=\"language-shell\">root:yuzetao@chafou.com:smtp.exmail.qq.com:465  # \u6539\u6210\u4f60\u7684\u90ae\u4ef6\u5730\u5740\uff0c\u91cd\u8981\uff08\u7528\u4e8e\u5339\u914d\u66ff\u6362\uff09\n<\/code><\/pre>\n<h2>\n\u4f7f\u7528mail\u53d1\u9001\u90ae\u4ef6<\/h2>\n<pre><code class=\"language-shell\">mail -a 'From: yuzetao@chafou.com(van_\u6c5f\u57ce\u5b50)' -s '\u8fd9\u662f\u4e00\u4e2a\u6700\u7ec8\u6d4b\u8bd5\u90ae\u4ef6' y344087491@gmail.com &lt; test_mail        # -a \u8bbe\u7f6eFrom\u5934\u975e\u5e38\u91cd\u8981\uff0c\u5426\u5219\u4f1a\u8986\u76d6\uff0c\u88abQQ\u62d2\u7edd\n<\/code><\/pre>\n<h3>\n\u76f8\u5173\u77e5\u8bc6<\/h3>\n<p><strong>\u7279\u522b\u6ce8\u610fheader<\/strong><\/p>\n<p>\u5982\uff1a<br \/>\nFrom\uff1a\u53d1\u9001\u8005\uff0c\u5982\u679c\u7528\u82f1\u6587\u62ec\u53f7\uff0c\u53ef\u4ee5\u5c55\u793a\u62ec\u53f7\u4e2d\u7684\u5185\u5bb9<br \/>\nTo\uff1a\u63a5\u53d7\u8005<br \/>\nCc\uff1a\u6284\u9001\u7ed9\u8c01<br \/>\nContent-Type\uff1a\u5c31\u548cHTTP\u534f\u8bae\u4e00\u6837\uff0c\u5982\u679c\u662ftext\/html\uff0c\u670d\u52a1\u5668\u4f1a\u6e32\u67d3<br \/>\n\u2026\u2026<\/p>\n<h2>\n\u65b9\u5f0f\u4e8c<\/h2>\n<h3>\n\u5de5\u5177<\/h3>\n<ul>\n<li>\npostifx<\/li>\n<li>\nmail(mailx)<\/li>\n<\/ul>\n<h3>\n\u914d\u7f6epostifx<\/h3>\n<p>postfix\u662f\u4e00\u4e2a\u90ae\u4ef6\u4f20\u8f93\u4ee3\u7406(MTA)\uff0c\u53ef\u4ee5\u7528\u5b83\u6765\u6536\u53d1\u90ae\u4ef6\uff0c\u8fd9\u91cc\u53ea\u662f\u7528\u505a\u63a5\u53d7mail\u5ba2\u6237\u7aef(MUA)\u7684\u90ae\u4ef6\uff0c\u6765\u8f6c\u53d1\u5230\u8fdc\u7aef\u7684SMTP\u670d\u52a1\u5668<\/p>\n<pre><code class=\"language-shell\">relayhost = smtp.exmail.qq.com:465              # \u5bf9\u65b9\u670d\u52a1\u5668\nsmtp_use_tls = yes                          # \u4f7f\u7528TLS\nsmtp_sasl_auth_enable = yes\nsmtp_tls_wrappermode = yes\nsmtp_tls_security_level = encrypt\nsmtp_sasl_security_options = noanonymous\nsmtp_sasl_password_maps = hash:\/private\/etc\/postfix\/sasl_passwd # \u7528\u6237\u540d\u5bc6\u7801\u76f8\u5173\nsmtp_generic_maps = hash:\/etc\/postfix\/generic   # \u8f6c\u53d1\u8bbe\u7f6e\uff08\u5bf9QQ\u5f88\u91cd\u8981\uff09\n\n<\/code><\/pre>\n<h3>\n\u914d\u7f6esasl_password<\/h3>\n<pre><code class=\"language-shell\">smtp.exmail.qq.com:465 yuzetao@chafou.com:&lt;\u6388\u6743\u7801&gt;\n<\/code><\/pre>\n<h3>\n\u914d\u7f6egenerice<\/h3>\n<pre><code class=\"language-shell\">van@vans-MacBook-Pro.local yuzetao@chafou.com   # \u66f4\u6539\u4e86From\u5934\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u7740\u5b9e\u641e\u4e86\u6211\u6574\u6574\u4e00\u5929\uff0c\u8270\u8f9b\u7684\u8fc7\u7a0b\u5c31\u4e0d\u8bf4\u4e86\uff0c\u76f4\u63a5\u8bf4\u4f7f\u7528\u548c\u914d\u7f6e\u3002 \u7279\u522b\u6ce8\u610f\uff1asmtp.qq.com\u7528\u4e8e\u666e\u901a\u7528\u6237\uff0cstmp.exmail.qq.com\u7528\u4e8e\u4f01\u4e1a\u7528\u6237 \u65b9\u5f0f\u4e00 \u5de5\u5177 ssmtp mailutils\uff08\u53ef\u6709\u53ef\u65e0\u5427\uff09 \u914d\u7f6eSMTP \u914d\u7f6e\/etc\/ssmtp\/ssmtp.conf root=van # \u540d\u5b57\uff0c\u4e0d\u91cd\u8981 hostname=van # \u673a\u5668\u540d\uff0c\u4e0d\u91cd\u8981 mailhub=smtp.exmail.qq.com:465 # QQ\u6709\u63d0\u4f9b\uff0c\u91cd\u8981 rewriteDomain=qq.com # \u8f6c\u53d1\u57df\u540d\uff0c\u91cd\u8981 AuthUser=yuzetao@chafou.com # \u4f60\u7684\u90ae\u4ef6\u5730\u5740\uff0c\u91cd\u8981 AuthPass=xxxx # QQ\u7ed9\u7684\u6388\u6743\u7801\uff0c\u91cd\u8981 FromLineOverride=YES # \u53ef\u4ee5\u8986\u76d6From\u7b49header\uff0c\u91cd\u8981\uff08QQ\u4f1a\u6821\u9a8cFrom\u5b57\u6bb5\uff09 UseTLS=YES # \u5f3a\u5236\u4f7f\u7528TLS\uff0c\u91cd\u8981\uff08QQ\u5f3a\u5236\uff09 \u914d\u7f6e\/etc\/ssmtp\/revaliases root:yuzetao@chafou.com:smtp.exmail.qq.com:465 # \u6539\u6210\u4f60\u7684\u90ae\u4ef6\u5730\u5740\uff0c\u91cd\u8981\uff08\u7528\u4e8e\u5339\u914d\u66ff\u6362\uff09 \u4f7f\u7528mail\u53d1\u9001\u90ae\u4ef6 mail -a &#8216;From: yuzetao@chafou.com(van_\u6c5f\u57ce\u5b50)&#8217; -s &#8216;\u8fd9\u662f\u4e00\u4e2a\u6700\u7ec8\u6d4b\u8bd5\u90ae\u4ef6&#8217; y344087491@gmail.com &lt; test_mail # -a \u8bbe\u7f6eFrom\u5934\u975e\u5e38\u91cd\u8981\uff0c\u5426\u5219\u4f1a\u8986\u76d6\uff0c\u88abQQ\u62d2\u7edd \u76f8\u5173\u77e5\u8bc6 \u7279\u522b\u6ce8\u610fheader \u5982\uff1a From\uff1a\u53d1\u9001\u8005\uff0c\u5982\u679c\u7528\u82f1\u6587\u62ec\u53f7\uff0c\u53ef\u4ee5\u5c55\u793a\u62ec\u53f7\u4e2d\u7684\u5185\u5bb9 To\uff1a\u63a5\u53d7\u8005 Cc\uff1a\u6284\u9001\u7ed9\u8c01 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/huzi-baozi.com\/?p=1180\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Linux\u4f7f\u7528QQ SMTP\u670d\u52a1\u5668\u53d1\u9001\u90ae\u4ef6&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1180","post","type-post","status-publish","format-standard","hentry","category-study"],"_links":{"self":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts\/1180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1180"}],"version-history":[{"count":5,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts\/1180\/revisions"}],"predecessor-version":[{"id":1185,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts\/1180\/revisions\/1185"}],"wp:attachment":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}