{"id":1105,"date":"2021-08-12T14:42:45","date_gmt":"2021-08-12T06:42:45","guid":{"rendered":"http:\/\/www.dxQerp.com\/?p=1105"},"modified":"2024-02-03T17:43:24","modified_gmt":"2024-02-03T09:43:24","slug":"how-to-install-postfix-dovecot-mail-server-on-centos-8","status":"publish","type":"post","link":"http:\/\/www.dxQerp.com\/?p=1105","title":{"rendered":"How to install PostFix\/Dovecot Mail Server on CentOS  8"},"content":{"rendered":"<h3><strong>postfix<\/strong> <strong>\u7684\u5b89\u88dd<\/strong><\/h3>\r\n<!-- \/wp:post-content -->\r\n\r\n<!-- wp:paragraph -->\r\n<p>\u5b89\u88dd\u5b83, \u6211\u5011\u5c07\u4f7f\u7528 dnf . \u4f46\u8981\u505a\u5230\u9019\u4e00\u9ede\uff0c\u5fc5 \u9808\u5728\u7cfb\u7d71\u4e0a\u555f\u7528 <strong>\u8a02\u95b1\u7ba1\u7406\u5b58\u5132\u5eab<\/strong> \u624d\u80fd\u8a2a\u554f\u6211\u5011\u5c07\u5b89\u88dd\u7684\u8edf\u4ef6\u6e90\u3002<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:code -->\r\n<pre class=\"wp-block-code\"><code>dnf install postfix<\/code><\/pre>\r\n<!-- \/wp:code -->\r\n\r\n<!-- wp:heading {\"level\":3} -->\r\n<h3><strong>\u555f\u7528\u548c\u555f\u52d5 systemd \u670d\u52d9\u4e2d\u5fc3<\/strong><\/h3>\r\n<!-- \/wp:heading -->\r\n\r\n<!-- wp:code -->\r\n<pre class=\"wp-block-code\"><code>netstat -lnpt | grep master\u00a0 \u00a0# <strong>\u7aef\u53e3\u67e5\u770b<\/strong>\r\nfirewall-cmd --permanent --zone=public --add-service=smtp\r\nfirewall-cmd --reload\r\n\r\nsystemctl enable --now postfix<\/code><\/pre>\r\n<!-- \/wp:code -->\r\n\r\n<!-- wp:heading {\"level\":3} -->\r\n<h3><strong>postfix<\/strong> <strong>\u76f8\u95dc\u8a2d\u5b9a\u00a0 \/etc\/postfix\/main.cf (\u4e3b\u6587\u4ef6)<\/strong><\/h3>\r\n<!-- \/wp:heading -->\r\n\r\n<!-- wp:code -->\r\n<pre class=\"wp-block-code\"><code># <strong>\u4f7f\u7528 postconf \u547d\u4ee4\u6765\u914d\u7f6e<\/strong> \u9001\u5230 \/etc\/postfix\/main.cf\r\npostconf -e 'mydomain = dxQerp.com'\r\npostconf -e 'myhostname = mail.dxQerp.com'\r\npostconf -e 'myorigin = $mydomain'\r\npostconf -e 'inet_interfaces = all'\r\npostconf -e 'mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain'\r\npostconf -e 'mynetworks = 192.168.17.0\/24'\r\npostconf -e 'home_mailbox = Maildir\/'\u00a0 # \u8bbe\u7f6e\u90ae\u7bb1\u8def\u5f84<\/code><\/pre>\r\n<!-- \/wp:code -->\r\n\r\n<!-- wp:paragraph -->\r\n<p><strong>\u53c3\u6578\u76f8\u540c &#8216;\u503c&#8217; \u4e0d\u540c \u4f9d\u64da \u6700\u5f8c\u7684 &#8216;\u503c&#8217; \u70ba\u4e3b<\/strong> \u4e0a\u8868\u7684\u8a2d\u5b9a\u610f\u7fa9\u662f\uff1a\u5340\u57df\u7db2\u8def\u5167\u7684 MUA <strong>\u4e0d\u9700\u8981\u8a8d\u8b49<\/strong>\u4e5f\u80fd\u5920\u9032\u884c relay \uff0c\u800c\u975e\u5340\u7db2\u5167\u7684\u5176\u4ed6\u4f86\u6e90\u624d\u9700\u8981\u9032\u884c<strong> SMTP \u8a8d\u8b49<\/strong>\u4e4b\u610f<\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:code -->\r\n<pre class=\"wp-block-code\"><code><strong>postfix reload <\/strong> #  <strong>\u91cd\u65b0\u8b80\u5165\u8a2d\u5b9a\u6a94<\/strong>\uff0c\u4e5f\u5c31\u662f \/etc\/postfix\/main.cf<\/code><\/pre>\r\n<!-- \/wp:code -->\r\n\r\n<!-- wp:code -->\r\n<pre class=\"wp-block-code\"><code>postfix check\u00a0 #  \u6aa2\u67e5 postfix \u76f8\u95dc\u7684\u6a94\u6848\u3001\u6b0a\u9650\u7b49\u662f\u5426\u6b63\u78ba\uff01\r\npostfix start\u00a0 #\u00a0\u958b\u59cb postfix \u7684\u57f7\u884c !\r\npostfix stop\u00a0  #\u00a0\u95dc\u9589 postfix !\r\npostfix flush\u00a0 #\u00a0\u5f37\u5236\u5c07\u76ee\u524d\u6b63\u5728\u90f5\u4ef6\u4f47\u5217\u7684\u90f5\u4ef6\u5bc4\u51fa\uff01<\/code><\/pre>\r\n<!-- \/wp:code -->\r\n\r\n<!-- wp:code -->\r\n<pre class=\"wp-block-code\"><code>postconf -d -df # \u9ed8\u8a8d\u53c3\u6578\u8a2d\u7f6e\u800c\u4e0d\u662f\u5be6\u969b\u8a2d\u7f6e\r\npostconf -n -nf # \u50c5\u986f\u5f0f\u540d\u7a31=\u503c \u7684\u914d\u7f6e\u53c3\u6578,\u6307\u5b9a -nf \u70ba\u4eba\u985e\u6298\u758a\u9577\u7dda\u53ef\u8b80\u6027\uff08Postfix 2.9 \u53ca\u66f4\u9ad8\u7248\u672c\uff09\u3002\r\npostconf -a\u00a0 \u00a0 # \u6aa2\u67e5 Postfix \u662f\u5426\u652f\u6301 Dovecot SASL (SASL support in the SMTP server)\r\npostconf -A\u00a0 \u00a0 # \u67e5\u8a62 SASL support in the SMTP+LMTP client<\/code><\/pre>\r\n<!-- \/wp:code -->\r\n\r\n<!-- wp:heading {\"level\":3} -->\r\n<h3>\u6e2c\u8a66 telnet localhost smtp<\/h3>\r\n<!-- \/wp:heading -->\r\n\r\n<!-- wp:separator --><hr class=\"wp-block-separator\" \/><!-- \/wp:separator -->\r\n\r\n<!-- wp:heading {\"level\":3} -->\r\n<h3><strong>\u5b89\u88dd <\/strong> Dovecot<\/h3>\r\n<!-- \/wp:heading -->\r\n\r\n<!-- wp:paragraph -->\r\n<p><strong>dnf install dovecot<\/strong><\/p>\r\n<!-- \/wp:paragraph -->\r\n\r\n<!-- wp:code -->\r\n<pre class=\"wp-block-code\"><code>systemctl start  dovecot\r\nsystemctl restart dovecot\r\nsystemctl enable dovecot\r\nfirewall-cmd --permanent --zone=public --add-service=pop3\r\nfirewall-cmd --permanent --zone=public --add-service=imap\r\nnetstat -anpt | grep dovecot\r\nnetstat -lntp | grep dovecot\r\nfirewall-cmd --reload <\/code><\/pre>\r\n<!-- \/wp:code -->\r\n\r\n<!-- wp:heading {\"level\":3} -->\r\n<h3><strong>Dovecot<\/strong> \u76f8\u95dc\u8a2d\u5b9a<\/h3>\r\n<!-- \/wp:heading -->\r\n\r\n<!-- wp:code -->\r\n<pre class=\"wp-block-code\"><code>\/etc\/dovecot\/conf.d\/10-auth.conf\r\ndisable_plaintext_auth = no # \u4f7f\u7528\u660e\u6587\u9a57\u8b49 \r\n\/etc\/dovecot\/conf.d\/10-ssl.conf\r\nssl=no            # \u4e0d\u8981\u6c42 SSL<\/code><\/pre>\r\n<!-- \/wp:code -->\r\n\r\n<!-- wp:heading {\"level\":3} -->\r\n<h3><strong>THE END<\/strong><\/h3>","protected":false},"excerpt":{"rendered":"<p>postfix \u7684\u5b89\u88dd \u5b89\u88dd\u5b83, \u6211\u5011\u5c07\u4f7f\u7528 dnf . \u4f46\u8981\u505a\u5230\u9019\u4e00\u9ede\uff0c\u5fc5 \u9808\u5728\u7cfb\u7d71\u4e0a\u555f\u7528 \u8a02\u95b1\u7ba1\u7406\u5b58\u5132\u5eab  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[27],"tags":[],"class_list":["post-1105","post","type-post","status-publish","format-standard","hentry","category-postfix"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts\/1105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1105"}],"version-history":[{"count":3,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts\/1105\/revisions"}],"predecessor-version":[{"id":1260,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts\/1105\/revisions\/1260"}],"wp:attachment":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1105"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}