{"id":2691,"date":"2025-08-29T12:02:53","date_gmt":"2025-08-29T04:02:53","guid":{"rendered":"https:\/\/www.myvoipapp.com\/blogs\/yxh\/?p=2691"},"modified":"2025-08-29T14:52:12","modified_gmt":"2025-08-29T06:52:12","slug":"postfix-dovecot-%e9%85%8d%e7%bd%ae%e7%9a%84%e4%b8%80%e4%ba%9b%e4%bf%ae%e6%94%b9","status":"publish","type":"post","link":"https:\/\/www.myvoipapp.com\/blogs\/yxh\/2025\/08\/29\/postfix-dovecot-%e9%85%8d%e7%bd%ae%e7%9a%84%e4%b8%80%e4%ba%9b%e4%bf%ae%e6%94%b9\/","title":{"rendered":"Postfix \/ Dovecot \u914d\u7f6e\u7684\u4e00\u4e9b\u4fee\u6539"},"content":{"rendered":"\n<p>email \u5927\u6982\u662f\u81ea\u4e92\u8054\u7f51\u6d2a\u8352\u65f6\u4ee3\u5c31\u7559\u5b58\u4e0b\u6765\u7684\u6280\u672f\uff0c\u6709\u7740\u539a\u91cd\u7684\u5386\u53f2\u6c89\u6dc0\uff0c\u56de\u5473\u4e14\u8ba9\u4eba\u56f0\u60d1\u3002\u4e92\u8054\u7f51\u6280\u672f\u5f80\u5f80\u7c97\u7cd9\u3001\u7b80\u964b\uff0c\u50cf\u6709\u70b9\u6f0f\u6c34\u7684\u74f6\uff0c\u80fd\u7528\uff0c\u4f46\u5c31\u662f\u54ea\u54ea\u603b\u6709\u70b9\u4e0d\u5bf9\u3002\u800c email \u66f4\u50cf\u662f\u6f0f\u6c34\u7684\u9576\u91d1\u5927\u74e6\u7f50\uff0c\u66f4\u6f0f\u6c34\u3001\u66f4\u5b9e\u7528\u3001\u66f4\u5f02\u57df\u98ce\u60c5\u3002\u76f8\u6bd4\u5176\u4ed6\u4e92\u8054\u7f51\u670d\u52a1\uff0c\u4f8b\u5982web\uff0c\u914d\u7f6e email \u603b\u662f\u8ba9\u4eba\u6218\u6218\u5162\u5162\uff0c\u9700\u8981\u7406\u89e3\u6781\u4e3a\u7e41\u7410\u7684\u6982\u5ff5\u3001\u5728\u4e0d\u540c\u7684\u914d\u7f6e\u6587\u4ef6\u5de6\u53f3\u6a2a\u8df3\uff0c\u7136\u800c\u8fc7\u4e86\u4e00\u6bb5\u65f6\u95f4\u540e\uff0c\u4f60\u4f1a\u53d1\u73b0\uff0c\u539f\u6765\u914d\u7f6e\u8fd8\u6ca1\u5b8c\uff0c\u8fd8\u6709\u5730\u65b9\u80fd\u4f18\u5316\uff0c\u8d85\u6709\u7cbe\u96d5\u7ec6\u7422\u7684\u6837\u5b50\u3002<\/p>\n\n\n\n<p>\u6700\u8fd1\u6211\u5c31\u96d5\u7422\u4e86\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p>\u4e8b\u60c5\u5176\u5b9e\u548c\u6211\u4eec\u7684 email \u672c\u8eab\u6ca1\u6709\u5173\u7cfb\uff0c\u548c IPv6 \u7684\u5730\u5740\u8303\u56f4\u6709\u5173\u3002\u6570\u636e\u4e2d\u5fc3\u670d\u52a1\u5546\u7ed9\u6211\u4eec\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6bd4\u8f83\u5927\u8303\u56f4\u7684 IPv6 \u5730\u5740\u7fa4\uff0c\u7136\u800c\u4e0d\u5e78\u7684\u662f\u5176\u4ed6\u4e00\u4e9b\u7528\u6237\u4e5f\u5728\u8fd9\u4e2a\u5730\u5740\u7fa4\u5185\u3002\u6211\u4eec\u901a\u8fc7\u81ea\u5df1\u7684 IPv6 \u5730\u5740\u53d1\u9001 email \u65f6\uff0c\u7531\u4e8e\u53cd\u5783\u573e\u673a\u6784\u5df2\u7ecf\u5c06\u8fd9\u4e2a\u5730\u5740\u7fa4\u62c9\u9ed1\u4e86\uff0c\u5bfc\u81f4\u6211\u4eec\u7684 email \u65e0\u6cd5\u9001\u8fbe\u5230\u5ba2\u6237\u3002\u8fd9\u662f\u5178\u578b\u7684\u300c\u6b83\u53ca\u6c60\u9c7c\u300d\uff0c\u6211\u4eec\u8fdb\u884c\u4e86\u7533\u8bc9\uff08\u62c9\u9ed1\u4e00\u4e2a\u5927\u8303\u56f4\u7684 IPv6 \u5730\u5740\u7fa4\u663e\u7136\u8fc7\u4e8e\u7c97\u66b4\u3001\u5b8c\u5168\u4e0d\u5408\u7406\uff09\uff0c\u5e76\u5411\u6570\u636e\u4e2d\u5fc3\u53cd\u9988\u60c5\u51b5\uff08\u5e0c\u671b\u80fd\u67e5\u67e5\u662f\u8c01\u5728\u53d1\u5783\u573e\u90ae\u4ef6\uff09\u3002\u53cd\u5783\u573e\u90ae\u4ef6\u673a\u6784\u4e0d\u7406\u4f1a\u6211\u4eec\uff08\u6709\u4e86SPF\u3001DKIM\u7b49\u6280\u672f\u90fd\u4e0d\u80fd\u8ba9\u5b83\u4eec\u66f4\u7cbe\u786e\u3001\u66f4\u7406\u667a\u70b9\uff09\uff0c\u800c\u6570\u636e\u4e2d\u5fc3\u53ea\u662f\u8868\u793a\u53ef\u4ee5\u5c06\u6211\u4eec\u5212\u5230\u53e6\u4e00\u4e2a\u5c0f\u70b9\u7684 IPv6 \u5730\u5740\u7fa4\u2026\u2026<\/p>\n\n\n\n<p>\u4e92\u8054\u7f51\u5c31\u662f\u8fd9\u4e48\u8361\u6c14\u56de\u80a0\uff0c\u5230\u5904\u6f0f\u6c34\uff0c\u5230\u5904\u6253\u8865\u4e01\uff0c\u5230\u5904\u90fd\u662f\u8349\u53f0\u73ed\u5b50\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u56de\u5934\u91cd\u65b0\u601d\u8003\uff0c\u5c06 email \u7cfb\u7edf\u9650\u5236\u5728 IPv4 \u5730\u5740\u663e\u7136\u662f\u4e2a\u7b80\u5355\u6709\u6548\u7684\u89e3\u51b3\u65b9\u6848\u3002IPv4 \u7684\u4e3b\u8981\u7f3a\u70b9\u662f\u5730\u5740\u592a\u5c11\uff0c\u4f46\u5728\u8fd9\u4e2a\u95ee\u9898\u4e0a\u53cd\u800c\u662f\u4f18\u70b9\uff0c\u4f30\u8ba1\u6ca1\u6709\u54ea\u5bb6\u53cd\u5783\u573e\u90ae\u4ef6\u673a\u6784\u4f1a\u75af\u5230\u62c9\u9ed1\u4e00\u5927\u6bb5 IPv4 \u5730\u5740\u3002<\/p>\n\n\n\n<p>\u65b9\u6848\u6709\u4e86\uff0c\u6539\u8d77\u6765\u5012\u662f\u4e0d\u592a\u590d\u6742\u3002\u7b2c\u4e00\u6b65\u4fee\u6539 DNS \u7684 MX \u8bb0\u5f55\u7ed1\u5b9a IPv4 \u5730\u5740\u3002\u8fdb DNS \u670d\u52a1\u5546\u7684\u9762\u677f\u91cc\u6539\u6539\u5c31\u53ef\u4ee5\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e8c\u6b65\u4fee\u6539 Postfix \u4ee5\u53ca Dovecot \u7684\u914d\u7f6e\u3002Postfix \u7ba1\u7406\u90ae\u4ef6\u7684\u53d1\u9001\u548c\u63a5\u6536\uff0c\u800c Dovecot \u7ba1\u7406\u4e2a\u4eba\u7684\u90ae\u7bb1\uff0c\u5927\u81f4\u529f\u80fd\u5c31\u662f\u8fd9\u6837\uff0c\u5b83\u4eec\u5171\u540c\u7ec4\u6210\u6574\u4e2a email \u7cfb\u7edf\u3002<\/p>\n\n\n\n<p>\uff081\uff09\u4fee\u6539 Dovecot<\/p>\n\n\n\n<p>\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539 <em>\/etc\/dovecot\/dovecot.conf <\/em>\u6587\u4ef6\uff0c\u4f46\u8fd9\u6837\u4e0d\u592a\u597d\uff0c \u5982\u679c\u5c06\u6765\u7cfb\u7edf\u5347\u7ea7\uff0c\u53ef\u80fd\u8fd8\u8981\u6ce8\u610f\u4fdd\u7559\u914d\u7f6e\u4e0d\u88ab\u8986\u76d6\uff0c\u56e0\u6b64\u5efa\u8bae\u5c06\u81ea\u5df1\u7684\u914d\u7f6e\u5b58\u653e\u5728 <em>\/etc\/dovecot\/conf.d\/<\/em> \u76ee\u5f55\u4e0b\u3002\u4f8b\u5982\uff0c\u5728\u8be5\u76ee\u5f55\u4e0b\u521b\u5efa <em>99-myvoipapp.conf<\/em> \u6587\u4ef6\uff0c\u5e76\u8bbe\u7f6e\u4ee5\u4e0b\u5185\u5bb9\u7ed1\u5b9a IPv4 \u5730\u5740\uff08\u672c\u673a\u7684\u5b9e\u9645\u5730\u5740\uff0c\u8fd9\u91cc\u5047\u8bbe\u662f 1.1.1.1\uff09\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">listen = 1.1.1.1<\/pre>\n\n\n\n<p>\uff082\uff09\u4fee\u6539 Postfix<\/p>\n\n\n\n<p>Postfix \u4e0d\u50cf Dovecot \u90a3\u6837\u63d0\u4f9b\u81ea\u5b9a\u4e49\u914d\u7f6e\u7684\u5b58\u653e\u76ee\u5f55\uff0c\u56e0\u6b64\u53ea\u80fd\u4fee\u6539 <em>\/etc\/postfix\/main.cf<\/em> \u6587\u4ef6\uff0c\u4fee\u6539 <em>inet_interfaces<\/em> \u9879\u7ed1\u5b9a IPv4 \u5730\u5740\uff08\u672c\u673a\u7684\u5b9e\u9645\u5730\u5740\uff0c\u8fd9\u91cc\u5047\u8bbe\u662f 1.1.1.1\uff09\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">inet_interfaces = 1.1.1.1<\/pre>\n\n\n\n<p>\uff083\uff09\u542f\u7528 SMTPS<\/p>\n\n\n\n<p>\u5b8c\u6210\u4e0a\u8ff0\u4e24\u6b65\u64cd\u4f5c\u540e\uff0cemail \u7cfb\u7edf\u7ed1\u5b9a\u4e86 IPv4 \u5730\u5740\uff0c\u91cd\u542f Postfix \u4ee5\u53ca Dovecot \u5c31\u53ef\u4ee5\u4e86\u3002Debian \u7cfb\u7edf\u9ed8\u8ba4\u914d\u7f6e\u6ca1\u6709\u542f\u52a8 SMTPS\uff0c\u53ea\u542f\u52a8\u4e86SMTP\u3002\u5efa\u7acb TCP \u8fde\u63a5\u540e\uff0c\u5ba2\u6237\u7aef\u6536\u5230 STARTTLS \u547d\u4ee4\u624d\u542f\u7528 TLS \u52a0\u5bc6\u4f20\u8f93\u8fc7\u7a0b\uff0c\u8fd9\u6837\u53ef\u4ee5\u517c\u5bb9\u5316\u77f3\u7ea7\u7684 email \u5ba2\u6237\u7aef\uff0c\u4f46\u76ee\u524d\u4e3b\u6d41\u7684 email \u5ba2\u6237\u7aef\uff08\u5305\u62ec\u6211\u4eec\u6b63\u5728\u4f7f\u7528\u7684\u5ba2\u6237\u7aef\uff09\u90fd\u652f\u6301 SMTPS\uff0c\u5b8c\u5168\u53ef\u4ee5\u4e00\u5f00\u59cb\u5c31\u76f4\u63a5\u5efa\u7acb TLS \u8fde\u63a5\u3002<\/p>\n\n\n\n<p>\u4fee\u6539 <em>\/etc\/postfix\/master.cf<\/em> \u6587\u4ef6\uff0c\u5c06\u4ee5\u4e0b\u5185\u5bb9\u7684\u6ce8\u91ca\u53bb\u6389\u5373\u53ef\u542f\u52a8 SMTPS\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">smtps     inet  n       -       -       -       -       smtpd<br>  -o syslog_name=postfix\/smtps<br>  -o smtpd_tls_wrappermode=yes<br>  -o smtpd_sasl_auth_enable=yes<br>  -o smtpd_reject_unlisted_recipient=no<br>  -o smtpd_client_restrictions=$mua_client_restrictions<br>  -o smtpd_helo_restrictions=$mua_helo_restrictions<br>  -o smtpd_sender_restrictions=$mua_sender_restrictions<br>  -o smtpd_recipient_restrictions=<br>  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject<br>  -o milter_macro_daemon_name=ORIGINATING <\/pre>\n\n\n\n<p>\uff084\uff09\u76f8\u5173\u547d\u4ee4<\/p>\n\n\n\n<p>\u5b8c\u6210\u914d\u7f6e\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u662f\u5426\u6b63\u786e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo postfix check<br>sudo dovecot -n<\/pre>\n\n\n\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u91cd\u542f Postfix \u548c Dovecot\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl restart postfix<br>sudo systemctl restart dovecot<\/pre>\n\n\n\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5 Postfix \u548c Dovecot \u7684\u7aef\u53e3\u5360\u7528\u60c5\u51b5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo netstat -tlnp | grep dovecot<br>sudo netstat -tlnp | grep tcp | grep :25<br>sudo netstat -tlnp | grep tcp | grep :465<\/pre>\n\n\n\n<p>SMTP \u9ed8\u8ba4\u91c7\u7528 TCP 25 \u7aef\u53e3\uff0c\u800c SMTPS \u9ed8\u8ba4\u91c7\u7528 TCP 465 \u7aef\u53e3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>email \u5927\u6982\u662f\u81ea\u4e92\u8054\u7f51\u6d2a\u8352\u65f6\u4ee3\u5c31\u7559\u5b58\u4e0b\u6765\u7684\u6280\u672f\uff0c\u6709\u7740\u539a\u91cd\u7684\u5386\u53f2\u6c89\u6dc0\uff0c\u56de\u5473\u4e14\u8ba9\u4eba\u56f0\u60d1\u3002\u4e92\u8054\u7f51\u6280\u672f\u5f80\u5f80\u7c97\u7cd9\u3001\u7b80\u964b\uff0c\u50cf\u6709\u70b9\u6f0f\u6c34\u7684\u74f6\uff0c\u80fd\u7528\uff0c\u4f46\u5c31\u662f\u54ea\u54ea\u603b\u6709\u70b9\u4e0d\u5bf9\u3002\u800c&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.myvoipapp.com\/blogs\/yxh\/2025\/08\/29\/postfix-dovecot-%e9%85%8d%e7%bd%ae%e7%9a%84%e4%b8%80%e4%ba%9b%e4%bf%ae%e6%94%b9\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[922,268,267,270,920,921,266],"class_list":["post-2691","post","type-post","status-publish","format-standard","hentry","category-53","tag-dkim","tag-dovecot","tag-postfix","tag-smtp","tag-smtps","tag-spf","tag-tls"],"_links":{"self":[{"href":"https:\/\/www.myvoipapp.com\/blogs\/yxh\/wp-json\/wp\/v2\/posts\/2691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.myvoipapp.com\/blogs\/yxh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myvoipapp.com\/blogs\/yxh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myvoipapp.com\/blogs\/yxh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myvoipapp.com\/blogs\/yxh\/wp-json\/wp\/v2\/comments?post=2691"}],"version-history":[{"count":8,"href":"https:\/\/www.myvoipapp.com\/blogs\/yxh\/wp-json\/wp\/v2\/posts\/2691\/revisions"}],"predecessor-version":[{"id":2699,"href":"https:\/\/www.myvoipapp.com\/blogs\/yxh\/wp-json\/wp\/v2\/posts\/2691\/revisions\/2699"}],"wp:attachment":[{"href":"https:\/\/www.myvoipapp.com\/blogs\/yxh\/wp-json\/wp\/v2\/media?parent=2691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myvoipapp.com\/blogs\/yxh\/wp-json\/wp\/v2\/categories?post=2691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myvoipapp.com\/blogs\/yxh\/wp-json\/wp\/v2\/tags?post=2691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}