{"id":4668,"date":"2025-07-20T12:03:49","date_gmt":"2025-07-20T03:03:49","guid":{"rendered":"https:\/\/eternalsphere.net\/echoes\/?p=4668"},"modified":"2026-06-06T10:07:17","modified_gmt":"2026-06-06T01:07:17","slug":"uaom1fxpcr4dkvo","status":"publish","type":"post","link":"https:\/\/eternalsphere.net\/echoes\/index.php\/2025\/07\/20\/uaom1fxpcr4dkvo\/","title":{"rendered":"\u5728 Proxmox VE \u4e2d\u914d\u7f6e Postfix \u4f7f\u7528\u81ea\u5efa SMTP \u767c\u9001\u901a\u77e5\u90f5\u4ef6\uff08\u652f\u63f4 SSL\u3001\u5bc4\u4ef6\u4eba\u6620\u5c04\uff09"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Proxmox VE\uff08PVE\uff09\u9810\u8a2d\u900f\u904e\u672c\u5730 Postfix \u5bc4\u9001\u901a\u77e5\u90f5\u4ef6\uff0c\u4f46\u82e5\u76f4\u63a5\u767c\u9001\uff0c\u5e38\u6703\u56e0\u70ba DNS \u8a2d\u5b9a\u4e0d\u5b8c\u6574\u3001\u5bc4\u4ef6\u4eba\u8eab\u4efd\u4e0d\u7b26\u7b49\u539f\u56e0\u88ab\u62d2\u6536\u3002\u9019\u7bc7\u6559\u5b78\u5c07\u8aaa\u660e\u5982\u4f55\u8b93 PVE \u7d93\u7531\u81ea\u6709 SMTP \u4f3a\u670d\u5668\uff08\u4f7f\u7528 SSL\uff09\u767c\u9001\u901a\u77e5\uff0c\u4e26\u6620\u5c04\u5bc4\u4ef6\u4eba\u70ba\u5408\u6cd5\u5e33\u865f\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83e\uddfe \u524d\u63d0\u74b0\u5883\uff08\u5df2\u812b\u654f\uff09<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u9805\u76ee<\/th><th>\u7bc4\u4f8b\uff08\u812b\u654f\uff09<\/th><\/tr><\/thead><tbody><tr><td>PVE \u4e3b\u6a5f IP<\/td><td><code>192.168.X.X<\/code><\/td><\/tr><tr><td>PVE \u4e3b\u6a5f\u540d<\/td><td><code>pve.internal.domain<\/code><\/td><\/tr><tr><td>SMTP \u4f3a\u670d\u5668<\/td><td><code>smtp.external-mail.net<\/code><\/td><\/tr><tr><td>SMTP \u57e0\u53e3<\/td><td><code>NNNN<\/code>\uff08SSL \u9023\u7dda\uff09<\/td><\/tr><tr><td>\u767c\u4ef6\u4fe1\u7bb1\uff08\u767b\u5165\u5e33\u865f\uff09<\/td><td><code>notify@external-mail.net<\/code><\/td><\/tr><tr><td>\u5bc6\u78bc<\/td><td><code>&lt;your-smtp-password&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">1\ufe0f\u20e3 \u5b89\u88dd\u5fc5\u8981\u5957\u4ef6<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<br>apt install -y libsasl2-modules mailutils<br><\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><code>libsasl2-modules<\/code>\uff1a\u8b93 Postfix \u652f\u63f4 SMTP \u8a8d\u8b49<br><code>mailutils<\/code>\uff1a\u63d0\u4f9b <code>mail<\/code> \u6e2c\u8a66\u6307\u4ee4<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">2\ufe0f\u20e3 \u8a2d\u5b9a <code>\/etc\/postfix\/main.cf<\/code><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u7de8\u8f2f\u5668\u6253\u958b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>nano \/etc\/postfix\/main.cf<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u52a0\u5165\u6216\u4fee\u6539\u4ee5\u4e0b\u5167\u5bb9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>myhostname = mail.external-mail.net<br><br>relayhost = [smtp.external-mail.net]:NNNN<br><br>smtp_use_tls = yes<br>smtp_tls_wrappermode = yes<br>smtp_tls_security_level = encrypt<br><br>smtp_sasl_auth_enable = yes<br>smtp_sasl_password_maps = hash:\/etc\/postfix\/sasl_passwd<br>smtp_sasl_security_options = noanonymous<br>smtp_sasl_tls_security_options = noanonymous<br><br>smtp_generic_maps = hash:\/etc\/postfix\/generic<br>smtputf8_enable = no<br><br>inet_interfaces = loopback-only<br>mynetworks = 127.0.0.0\/8<br>recipient_delimiter = +<br>compatibility_level = 2<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">3\ufe0f\u20e3 \u8a2d\u5b9a\u767b\u5165\u6191\u8b49\u6a94 <code>\/etc\/postfix\/sasl_passwd<\/code><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cat &lt;&lt;EOF &gt; \/etc\/postfix\/sasl_passwd<br>[smtp.external-mail.net]:NNNN notify@external-mail.net:&lt;your-smtp-password&gt;<br>EOF<br><br>chmod 600 \/etc\/postfix\/sasl_passwd<br>postmap \/etc\/postfix\/sasl_passwd<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">4\ufe0f\u20e3 \u8a2d\u5b9a\u5bc4\u4ef6\u4eba\u6620\u5c04 <code>\/etc\/postfix\/generic<\/code><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cat &lt;&lt;EOF &gt; \/etc\/postfix\/generic<br>root                   notify@external-mail.net<br>@pve.internal.domain   notify@external-mail.net<br>EOF<br><br>postmap \/etc\/postfix\/generic<br><\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u5c07\u6240\u6709\u5f9e <code>root<\/code> \u6216\u672c\u5730\u4e3b\u6a5f\u767c\u51fa\u7684\u4fe1\u4ef6\u5bc4\u4ef6\u4eba\u90fd\u8f49\u70ba\u5408\u6cd5 SMTP \u5e33\u865f\u3002<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">5\ufe0f\u20e3 \u91cd\u555f Postfix<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart postfix<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">6\ufe0f\u20e3 \u6e2c\u8a66\u767c\u4fe1<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>echo \"This is a test email from PVE.\" | mail -s \"SMTP Test\" your@email<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u65e5\u8a8c\u78ba\u8a8d\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>tail -n 30 \/var\/log\/mail.log<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u61c9\u8a72\u770b\u5230 <code>status=sent<\/code> \u5b57\u6a23\uff0c\u4e14\u5bc4\u4ef6\u4eba\u70ba <code>notify@external-mail.net<\/code>\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udccc \u5e38\u898b\u932f\u8aa4\u8207\u89e3\u6c7a<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u932f\u8aa4\u8a0a\u606f<\/th><th>\u89e3\u91cb<\/th><th>\u89e3\u6cd5<\/th><\/tr><\/thead><tbody><tr><td><code>SASL authentication failed<\/code><\/td><td>\u8a8d\u8b49\u5931\u6557<\/td><td>\u78ba\u8a8d\u5e33\u865f\u5bc6\u78bc\u6b63\u78ba\uff0c\u5b89\u88dd libsasl2-modules<\/td><\/tr><tr><td><code>no worthy mechs found<\/code><\/td><td>\u7f3a\u5c11\u8a8d\u8b49\u6a5f\u5236\u6a21\u7d44<\/td><td>\u5b89\u88dd <code>libsasl2-modules<\/code><\/td><\/tr><tr><td><code>Sender address rejected<\/code><\/td><td>\u5bc4\u4ef6\u4eba\u8207\u767b\u5165\u5e33\u865f\u4e0d\u7b26<\/td><td>\u8a2d\u5b9a <code>smtp_generic_maps<\/code> \u6620\u5c04<\/td><\/tr><tr><td><code>SMTPUTF8 is required...<\/code><\/td><td>SMTP \u4e0d\u652f\u63f4 UTF8 \u64f4\u5c55<\/td><td>\u52a0\u5165 <code>smtputf8_enable = no<\/code><\/td><\/tr><tr><td><code>.db<\/code> \u6a94\u6848\u4e0d\u5b58\u5728<\/td><td>\u5fd8\u8a18\u8f49\u63db\u8868\u683c<\/td><td>\u57f7\u884c <code>postmap<\/code> \u5efa\u7acb <code>.db<\/code> \u6a94\u6848<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udce6 \u5099\u4efd SMTP \u8a2d\u5b9a\uff08\u5efa\u8b70\uff09<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>tar czvf pve-smtp-config.tar.gz \\<br>\/etc\/postfix\/main.cf \\<br>\/etc\/postfix\/sasl_passwd* \\<br>\/etc\/postfix\/generic*<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u7d50\u8a9e<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b8c\u6210\u8a2d\u5b9a\u5f8c\uff0c\u4f60\u7684 PVE \u7cfb\u7d71\u5c07\u80fd\u5920\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u900f\u904e SSL \u8207\u5916\u90e8 SMTP \u5b89\u5168\u767c\u4fe1<\/li>\n\n\n\n<li>\u4f7f\u7528\u5408\u6cd5\u5e33\u865f\u4f5c\u70ba\u5bc4\u4ef6\u4eba\uff0c\u901a\u904e\u9a57\u8b49<\/li>\n\n\n\n<li>\u6210\u529f\u5bc4\u51fa\u901a\u77e5\uff0c\u5982\u5099\u4efd\u3001\u932f\u8aa4\u8b66\u544a\u7b49<\/li>\n\n\n\n<li>\u4e0d\u9700\u4fee\u6539\u4e3b\u6a5f\u540d\u8207 hosts\uff0c\u914d\u7f6e\u66f4\u7c21\u6f54<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Proxmox VE\uff08PVE\uff09\u9810\u8a2d\u900f\u904e\u672c\u5730 Postfix \u5bc4\u9001\u901a\u77e5\u90f5\u4ef6\uff0c\u4f46\u82e5\u76f4\u63a5\u767c\u9001\uff0c\u5e38\u6703\u56e0\u70ba DNS \u8a2d\u5b9a\u4e0d\u5b8c\u6574\u3001\u5bc4\u4ef6\u4eba\u8eab\u4efd\u4e0d\u7b26\u7b49\u539f\u56e0\u88ab\u62d2\u6536\u3002\u9019\u7bc7\u6559\u5b78\u5c07\u8aaa\u660e\u5982\u4f55\u8b93 PVE \u7d93\u7531\u81ea\u6709 SMTP \u4f3a\u670d\u5668\uff08\u4f7f\u7528 SSL\uff09\u767c\u9001\u901a\u77e5\uff0c\u4e26\u6620\u5c04\u5bc4\u4ef6\u4eba\u70ba\u5408\u6cd5\u5e33\u865f\u3002 \ud83e\uddfe \u524d\u63d0\u74b0\u5883\uff08\u5df2\u812b\u654f\uff09 \u9805\u76ee \u7bc4\u4f8b\uff08\u812b\u654f\uff09 PVE \u4e3b\u6a5f IP 192.168.X.X PVE \u4e3b\u6a5f\u540d pve.internal.domain SMTP \u4f3a\u670d\u5668 smtp.external-mail.net SMTP \u57e0\u53e3 NNNN\uff08SSL \u9023\u7dda\uff09 \u767c\u4ef6\u4fe1\u7bb1\uff08\u767b\u5165\u5e33\u865f\uff09 notify@external-mail.net \u5bc6\u78bc &lt;your-smtp-password&gt; 1\ufe0f\u20e3 \u5b89\u88dd\u5fc5\u8981\u5957\u4ef6 apt updateapt install -y libsasl2-modules mailutils libsasl2-modules\uff1a\u8b93 Postfix \u652f\u63f4 SMTP \u8a8d\u8b49mailutils\uff1a\u63d0\u4f9b mail \u6e2c\u8a66\u6307\u4ee4 2\ufe0f\u20e3 \u8a2d\u5b9a &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[208],"tags":[],"class_list":["post-4668","post","type-post","status-publish","format-standard","hentry","category-e18eiwuv0h3s4gg"],"_links":{"self":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/comments?post=4668"}],"version-history":[{"count":1,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4668\/revisions"}],"predecessor-version":[{"id":4669,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4668\/revisions\/4669"}],"wp:attachment":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/media?parent=4668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/categories?post=4668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/tags?post=4668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}