{"id":3227,"date":"2020-05-16T23:10:09","date_gmt":"2020-05-16T15:10:09","guid":{"rendered":"http:\/\/www.chenlianfu.com\/?p=3227"},"modified":"2023-09-29T17:36:41","modified_gmt":"2023-09-29T09:36:41","slug":"%e4%bd%bf%e7%94%a8aliyun%e4%ba%91%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%8f%91%e9%82%ae%e4%bb%b6","status":"publish","type":"post","link":"http:\/\/www.chenlianfu.com\/?p=3227","title":{"rendered":"\u4f7f\u7528Aliyun\u4e91\u670d\u52a1\u5668\u53d1\u90ae\u4ef6"},"content":{"rendered":"\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0bAliyun\u4e91\u670d\u52a1\u5668\u5bf9\u591625\u53f7\u7aef\u53e3\u88ab\u7981\u7528\u4e86\uff0c\u9700\u8981\u7533\u8bf7\u89e3\u5c01\uff0c\u4f46\u4e0d\u4e00\u5b9a\u6210\u529f\u3002\u6b64\u65f6\uff0c\u9700\u8981\u8003\u8651\u4f7f\u7528\u90ae\u7bb1\u7684IMAP\u670d\u52a1\u53d1\u9001\u90ae\u4ef6\u3002\u8fd9\u9700\u8981\u90ae\u7bb1\u670d\u52a1\u5668\u652f\u6301\u5e76\u542f\u7528IMAP\u670d\u52a1\u3002\u4ee5\u4e0b\u4f7f\u7528Aliyun\u670d\u52a1\u5668\u7ed9QQ\u90ae\u7bb1\u53d1\u9001\u90ae\u4ef6\u4e3a\u4f8b\uff1a<\/p>\n\n\n\n<h2>1. \u5f00\u542fQQ\u90ae\u7bb1\u7684IMAP\u670d\u52a1\u3002<\/h2>\n\n\n\n<p>\u767b\u5f55QQ\u90ae\u7bb1\u540e\uff0c\u5728\u8bbe\u7f6e\u2014\u2014\u5e10\u6237\u754c\u9762\u5f00\u542fIMAP\u670d\u52a1\u3002\u82e5\u662f\u5df2\u7ecf\u5f00\u542f\uff0c\u5219\u53ef\u4ee5\u70b9\u51fb\u5173\u95edIMAP\u529f\u80fd\u540e\u518d\u70b9\u51fb\u542f\u7528\uff0c\u6b64\u65f6\u9700\u8981\u4f7f\u7528\u5bc6\u4fdd\u624b\u673a\u53d1\u9001\u6307\u5b9a\u5185\u5bb9\u77ed\u4fe1\u5230\u6307\u5b9a\u53f7\u7801\uff0c\u5219\u83b7\u5f9716\u4e2a\u5b57\u7b26\u957f\u5ea6\u7684\u6388\u6743\u7801\uff0c\u540e\u7eed\u4f1a\u7528\u5230\u6b64\u6388\u6743\u7801\u3002<\/p>\n\n\n\n<p>\u53ef\u4ee5\u67e5\u770b<a href=\"https:\/\/service.mail.qq.com\/cgi-bin\/help?subtype=1&amp;&amp;id=28&amp;&amp;no=331\">IMAP\u76f8\u5173\u8bf4\u660e<\/a>\uff0c\u83b7\u53d6IMAP\u670d\u52a1\u7684\u53d1\u9001\u90ae\u4ef6\u670d\u52a1\u5668\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u53d1\u9001\u90ae\u4ef6\u670d\u52a1\u5668\uff1asmtp.qq.com\nSSL\u7aef\u53e3\u53f7\uff1a465\u6216587\n\u8d26\u6237\u540d\uff1a\u60a8\u7684QQ\u90ae\u7bb1\u8d26\u6237\u540d(chenllianfu@foxmail.com)<\/pre>\n\n\n\n<h2>2. \u8bbe\u7f6eSSL\u8bc1\u4e66<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># \u51c6\u5907\u4e00\u4e2a\u76ee\u5f55\uff0c\u7528\u4e8e\u5b58\u653e\u8bc1\u4e66\u4fe1\u606f\nmkdir ~\/.certs\ncd ~\/.certs\n\n# \u5411qq\u90ae\u7bb1\u8bf7\u6c42SSL\u8bc1\u4e66\ndate | openssl s_client -connect smtp.qq.com:465 | perl -e 'while (&lt;&gt;) { $keep = 1 if m\/BEGIN\/; print if $keep == 1; $keep = 0 if m\/END\/; }' &gt; smtp_qq.crt\n\n# \u5b89\u88c5\u8bc1\u4e66\u5bfc\u5165\u5de5\u5177\nyum install -y nss-tools\n\n# \u5c06\u8bc1\u4e66\u589e\u5230\u6570\u636e\u5e93\u4e2d\ncertutil -A -n \"GeoTrust SSL CA\" -t \"C,,\" -d .\/ -i .\/smtp_qq.crt\ncertutil -A -n \"GeoTrust Global CA\" -t \"C,,\" -d .\/ -i .\/smtp_qq.crt\ncertutil -A -n \"GeoTrust SSL CA - G3\" -t \"Pu,Pu,Pu\" -d .\/ -i .\/smtp_qq.crt \n\n# \u5217\u51fa\u76ee\u5f55\u4e2d\u6570\u636e\u5e93\u4e2d\u7684\u8bc1\u4e66\ncertutil -L -d .\/<\/code><\/pre>\n\n\n\n<h2>3. \u5bf9\u90ae\u4ef6\u53d1\u9001\u5ba2\u6237\u7aef\u8fdb\u884c\u914d\u7f6e<\/h2>\n\n\n\n<p>\u9996\u5148\uff0c\u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u90ae\u4ef6\u76f8\u5173\u8f6f\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf -y install postfix mailx s-nail<\/code><\/pre>\n\n\n\n<p>\u82e5\u662fCentOS7\u6216CentOS8\u7cfb\u7edf\uff0c\u5219\u4fee\u6539\u53d1\u9001\u90ae\u4ef6\u7684\u914d\u7f6e\u6587\u4ef6\/etc\/mail.rc\u5185\u5bb9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &lt;&lt; EOF >> \/etc\/mail.rc\nset ssl-verify=ignore                        # \u542f\u7528\u8bc1\u4e66\nset nss-config-dir=\/root\/.certs              # \u8bbe\u7f6e\u8bc1\u4e66\u6570\u636e\u5e93\u8def\u5f84\nset from=\"chenllianfu@foxmail.com\"           # \u90ae\u7bb1\u5168\u540d\nset smtp=\"smtps:\/\/smtp.qq.com:465\"           # \u53d1\u9001\u90ae\u4ef6\u670d\u52a1\u5668\u5730\u5740\nset smtp-auth-user=chenllianfu@foxmail.com   # \u90ae\u7bb1\u8d26\u6237\u540d\nset smtp-auth-password=xxxxxxxxxxxxxx        # \u90ae\u7bb1\u6388\u6743\u7801\uff08\u4e0d\u662f\u90ae\u7bb1\u767b\u5f55\u5bc6\u7801\uff09\nset smpt-auth=login                          # \u767b\u5f55SMPT\u670d\u52a1\u7528\u4e8e\u53d1\u9001\u90ae\u4ef6\nEOF<\/code><\/pre>\n\n\n\n<p>\u82e5\u662fRocky 9 Linux\u7cfb\u7edf\uff0c\u8f6f\u4ef6\u6362\u6210\u4e86s-nail\uff0c\u9700\u8981\u9700\u6539\u914d\u7f6e\u6587\u4ef6\/etc\/s-nail.rc\u5185\u5bb9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &lt;&lt; EOF >> \/etc\/s-nail.rc\nset v15-compat\nset smtp-auth=login\nset from=\"chenllianfu@foxmail.com\"\nset mta=\"smtps:\/\/910432211:xxx\u90ae\u7bb1\u6388\u6743\u7801xxx@smtp.qq.com:465\"\nEOF<\/code><\/pre>\n\n\n\n<p>\u5728Rocky 9 Linux\u7cfb\u7edf\u4e2d\u4e0d\u9700\u8981\u8bbe\u7f6e SSL\u8bc1\u4e66 \u4fe1\u606f\u3002<\/p>\n\n\n\n<h2>4. \u53d1\u9001\u90ae\u4ef6<\/h2>\n\n\n\n<p>\u6d4b\u8bd5\u90ae\u4ef6\u53d1\u9001\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>date | mail -s test chenllianfu@foxmail.com\ndate | nail -s test chenllianfu@foxmail.com<\/code><\/pre>\n\n\n\n<p>\u4f7f\u7528IMAP\u65b9\u6cd5\u53d1\u9001\u90ae\u4ef6\uff0c\u5176\u5b9e\u662f\u76f4\u63a5\u901a\u8fc7\u5bc6\u94a5\u8bc1\u4e66\u52a0\u5bc6\u4f20\u8f93\u6570\u636e\uff0c\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u8bbe\u7f6e\u7528\u6237\u540d\u548c\u6388\u6743\u7801\u767b\u5f55\u90ae\u4ef6\u670d\u52a1\u5668\uff0c\u7136\u540e\u76f4\u63a5\u4f7f\u7528\u90ae\u4ef6\u670d\u52a1\u5668\u8fdb\u884c\u90ae\u4ef6\u64cd\u4f5c\u3002\u6240\u4ee5\u6700\u540e\u64cd\u4f5c\u7684\u53d1\u4ef6\u4eba\u662fchenllianfu@foxmail.com\u7528\u6237\u81ea\u5df1\uff0c\u540c\u65f6\u4e5f\u5b9e\u73b0\u4e86Aliyun\u670d\u52a1\u5668\u548c\u90ae\u4ef6\u670d\u52a1\u5668\u7684\u8fde\u63a5\uff0c\u4ee5\u5229\u4e8e\u5c06Aliyun\u670d\u52a1\u5668\u7684\u6570\u636e\u901a\u8fc7\u90ae\u4ef6\u670d\u52a1\u5668\u53d1\u9001\u51fa\u53bb\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0bAliyun\u4e91\u670d\u52a1\u5668\u5bf9\u591625\u53f7\u7aef\u53e3\u88ab\u7981\u7528\u4e86\uff0c\u9700\u8981\u7533\u8bf7\u89e3\u5c01\uff0c\u4f46\u4e0d\u4e00\u5b9a\u6210\u529f &hellip; <a href=\"http:\/\/www.chenlianfu.com\/?p=3227\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/posts\/3227"}],"collection":[{"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3227"}],"version-history":[{"count":10,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/posts\/3227\/revisions"}],"predecessor-version":[{"id":3800,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/posts\/3227\/revisions\/3800"}],"wp:attachment":[{"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3227"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}