{"id":11221,"date":"2022-05-01T03:51:25","date_gmt":"2022-04-30T18:51:25","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=11221"},"modified":"2022-05-02T16:38:41","modified_gmt":"2022-05-02T07:38:41","slug":"ubuntu-20-04-lts-%e3%82%b5%e3%83%bc%e3%83%90%e6%a7%8b%e7%af%89-postfix-sasl%e8%aa%8d%e8%a8%bc","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=11221","title":{"rendered":"Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 &#8211; Postfix SASL\u8a8d\u8a3c"},"content":{"rendered":"<p>\u524d\u56de\u306e<a href=\"https:\/\/www.webcyou.com\/?p=11218\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Dovecot\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a>\u306e\u7d9a\u304d\u3067\u3059\u3002<\/p>\n<p>Postfix\u3067\u4f7f\u7528\u3067\u304d\u308bSASL\u5b9f\u88c5\u3068\u3057\u3066\u306fCyrus SASL\u3068Dovecot SASL\u306e2\u3064\u3068\u306a\u308a\u3001\u4eca\u56de\u306fdovecot\u3092\u7528\u3044\u3066SASL\u8a8d\u8a3c\u3092\u884c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h4>\u30e1\u30cb\u30e5\u30fc<\/h4>\n<ul>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11191\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 \u521d\u671f\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11197\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Nginx\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11205\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Let\u2019s Encrypt\u3067SSL\/TLS\u5316<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11211\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Postfix\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11218\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Dovecot\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11221\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Postfix SASL\u8a8d\u8a3c<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11230\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Postfix Let\u2019s Encrypt\u3067TLS\u5316<\/a><\/li>\n<li><a href=\"https:\/\/www.webcyou.com\/?p=11234\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 DKIM\u3001DMARC\u3092\u8a2d\u5b9a\u3059\u308b<\/a><\/li>\n<\/ul>\n<h4>Postfix SASL\u8a8d\u8a3c<\/h4>\n<p>\u8a8d\u8a3c\u6a5f\u80fd\u3092\u78ba\u8a8d<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ postconf -a<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">cyrus\r\ndovecot<\/pre>\n<h5>Postfix\u306e\u8a2d\u5b9a\u7de8\u96c6<\/h5>\n<p><strong>\/etc\/postfix\/main.cf<\/strong> \u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ sudo vim \/etc\/postfix\/main.cf<\/pre>\n<p>\u6700\u4e0b\u90e8\u306b\u8ffd\u52a0<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"># SMTP-AUTH\r\nsmtpd_sasl_auth_enable = yes\r\nsmtpd_sasl_type = dovecot\r\nsmtpd_sasl_path = private\/auth\r\nbroken_sasl_auth_clients = yes\r\nsmtpd_recipient_restrictions = \r\n    permit_mynetworks \r\n    permit_sasl_authenticated \r\n    reject_unauth_destination<\/pre>\n<p>Postfix\u306e\u8a2d\u5b9a\u78ba\u8a8d<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ postconf -n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">alias_database = hash:\/etc\/aliases\r\nalias_maps = hash:\/etc\/aliases\r\nappend_dot_mydomain = no\r\nbiff = no\r\nbroken_sasl_auth_clients = yes\r\ncompatibility_level = 2\r\nhome_mailbox = Maildir\/\r\ninet_interfaces = all\r\ninet_protocols = all\r\nmailbox_size_limit = 0\r\nmasquerade_domains = (\u30c9\u30e1\u30a4\u30f3\u540d)\r\nmydestination = $myhostname, (\u30c9\u30e1\u30a4\u30f3\u540d), localhost.localdomain, localhost\r\nmyhostname = mail.(\u30c9\u30e1\u30a4\u30f3\u540d)\r\nmynetworks = 127.0.0.0\/8 &#x5B;::ffff:127.0.0.0]\/104 &#x5B;::1]\/128\r\nmyorigin = \/etc\/mailname\r\nreadme_directory = no\r\nrecipient_delimiter = +\r\nsmtp_tls_CApath = \/etc\/ssl\/certs\r\nsmtp_tls_security_level = may\r\nsmtp_tls_session_cache_database = btree:${data_directory}\/smtp_scache\r\nsmtpd_banner = $myhostname ESMTP\r\nsmtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination\r\nsmtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination\r\nsmtpd_sasl_auth_enable = yes\r\nsmtpd_sasl_path = private\/auth\r\nsmtpd_sasl_type = dovecot\r\nsmtpd_tls_security_level = may\r\nvirtual_alias_maps = hash:\/etc\/postfix\/virtual<\/pre>\n<p>Postfix\u306e\u8a2d\u5b9a\u30c1\u30a7\u30c3\u30af<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ sudo postfix check<\/pre>\n<p>\u4ee5\u4e0b\u306e\u69d8\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u304c\u53d6\u308a\u6562\u3048\u305a\u554f\u984c\u306a\u3044<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">postfix\/postfix-script: warning: symlink leaves directory: \/etc\/postfix\/.\/makedefs.out<\/pre>\n<h4>Postfix\u306e\u30b5\u30d6\u30df\u30c3\u30b7\u30e7\u30f3\u30dd\u30fc\u30c8\u3092\u8a2d\u5b9a<\/h4>\n<p>\u8ff7\u60d1\u30e1\u30fc\u30eb\u5bfe\u7b56\u8a2d\u5b9a\uff08OP25B\uff09\u3092\u884c\u3046\u305f\u3081\u30b5\u30d6\u30df\u30c3\u30b7\u30e7\u30f3\u30dd\u30fc\u30c8\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><strong>\/etc\/postfix\/master.cf<\/strong> \u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ sudo vim \/etc\/postfix\/master.cf<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"># \u30b3\u30e1\u30f3\u30c8\u89e3\u9664 & \u5909\u66f4\r\nsubmission inet n       -       n       -       -       smtpd<\/pre>\n<p>\u5909\u66f4\u3057\u305f\u8a2d\u5b9a\u3092\u53cd\u6620<\/p>\n<p>Postfix\u3092\u518d\u8d77\u52d5\u3057\u8a2d\u5b9a\u5185\u5bb9\u3092\u53cd\u6620\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ sudo systemctl restart postfix<\/pre>\n<p>Postfix\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u304c Active \u3068\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ sudo systemctl status postfix\r\n\r\nActive: active (exited) since Sun 2022-04-17 16:06:04 UTC; 4s ago<\/pre>\n<p>netstat\u30b3\u30de\u30f3\u30c9\u3067\u30dd\u30fc\u30c8\u306e\u78ba\u8a8d\u3092\u884c\u3044\u307e\u3059\u3002587\u756a\u30dd\u30fc\u30c8\u304c\u6709\u52b9\u78ba\u8a8d<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ netstat -nat<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">Active Internet connections (servers and established)\r\nProto Recv-Q Send-Q Local Address           Foreign Address         State\r\ntcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN<\/pre>\n<p>\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306e\u63a5\u7d9a\u8a2d\u5b9a<\/p>\n<p>ufw\u30b3\u30de\u30f3\u30c9\u3067Postfix\u3068Dovecot\u306b\u5bfe\u3057\u3066\u306b\u5bfe\u3057\u3066\u306e\u901a\u4fe1\u3092\u6709\u52b9\u5316\u3057\u307e\u3059\u3002<\/p>\n<p>\u3059\u3067\u306bPostfix\u306f\u6709\u52b9\u5316\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u306e\u4ed6\u3092\u6709\u52b9\u5316\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ sudo ufw allow \"Postfix SMTPS\"\r\n$ sudo ufw allow \"Postfix Submission\"\r\n$ sudo ufw allow \"Dovecot IMAP\"\r\n$ sudo ufw allow \"Dovecot POP3\"\r\n$ sudo ufw allow \"Dovecot Secure IMAP\"\r\n$ sudo ufw allow \"Dovecot Secure POP3\"<\/pre>\n<h5>\u30e1\u30fc\u30eb\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30a2\u30d7\u30ea\u3067\u9001\u53d7\u4fe1\u30c6\u30b9\u30c8<\/h5>\n<p>\u30e1\u30fc\u30eb\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30a2\u30d7\u30ea <a href=\"https:\/\/www.thunderbird.net\/ja\/)\" target=\"_blank\" rel=\"noopener\">Thunderbird<\/a> \u3092\u5229\u7528\u3057\u3066\u78ba\u8a8d\u3092\u884c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306f\u3001webapp\u306e\u307e\u307e\u884c\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u30e1\u30fc\u30eb\u30c6\u30b9\u30c8\u7528\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306a\u3069\u4f5c\u6210\u3057\u3066\u30c6\u30b9\u30c8\u3057\u305f\u65b9\u304c\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-11222\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/thunderbird_1-2.png\" alt=\"\" width=\"422\" height=\"258\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/thunderbird_1-2.png 461w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/thunderbird_1-2-300x184.png 300w\" sizes=\"auto, (max-width: 422px) 100vw, 422px\" \/><\/p>\n<p>POP3\u3001IMAP\u3069\u3061\u3089\u3082\u4f7f\u7528\u3067\u304d\u308b\u69d8\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11223\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/thunderbird_2-2.png\" alt=\"\" width=\"412\" height=\"234\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/thunderbird_2-2.png 412w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/thunderbird_2-2-300x170.png 300w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-11224\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/thunderbird_3-2.png\" alt=\"\" width=\"420\" height=\"211\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/thunderbird_3-2.png 420w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/thunderbird_3-2-300x151.png 300w\" sizes=\"auto, (max-width: 420px) 100vw, 420px\" \/><\/p>\n<p>\u901a\u4fe1\u304c\u6697\u53f7\u5316\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u8b66\u544a\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u304c\u3001\u78ba\u8a8d\u306e\u305f\u3081\u4e00\u65e6\u627f\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u307e\u307e\u306e\u4f7f\u7528\u306f\u5b89\u5168\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u3059\u3050\u306b\u3053\u306e\u3042\u3068\u306eSSL\/TLS\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-11225\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/thunderbird_4.png\" alt=\"\" width=\"584\" height=\"276\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/thunderbird_4.png 730w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/thunderbird_4-300x142.png 300w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/p>\n<p>\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3001\u53d7\u4fe1\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u30dd\u30fc\u30c8\u756a\u53f7\u8a2d\u5b9a\u304c\u3046\u307e\u304f\u3044\u3063\u3066\u3044\u306a\u3044\u53ef\u80fd\u6027\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\uff08\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u5e73\u6587\u3068\u306a\u308a\u307e\u3059\u3002\uff09<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u9001\u53d7\u4fe1<\/th>\n<th>\u30dd\u30fc\u30c8\u756a\u53f7<\/th>\n<th>\u7528\u9014<\/th>\n<\/tr>\n<tr>\n<td>\u9001\u4fe1<\/td>\n<td>25<\/td>\n<td>smtp<\/td>\n<\/tr>\n<tr>\n<td>\u9001\u4fe1<\/td>\n<td>465<\/td>\n<td>smtp(SSL)<\/td>\n<\/tr>\n<tr>\n<td>\u9001\u4fe1<\/td>\n<td>587<\/td>\n<td>Submission\u30dd\u30fc\u30c8<\/td>\n<\/tr>\n<tr>\n<td>\u53d7\u4fe1<\/td>\n<td>110<\/td>\n<td>POP<\/td>\n<\/tr>\n<tr>\n<td>\u53d7\u4fe1<\/td>\n<td>995<\/td>\n<td>POP(SSL)<\/td>\n<\/tr>\n<tr>\n<td>\u53d7\u4fe1<\/td>\n<td>143<\/td>\n<td>IMAP<\/td>\n<\/tr>\n<tr>\n<td>\u53d7\u4fe1<\/td>\n<td>993<\/td>\n<td>\u00a0IMAP(SSL)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Gmail\u5b9b\u306b\u3082\u9001\u4fe1\u3057\u3066\u307f\u308b\u3068\u9001\u4fe1\u3067\u304d\u3066\u3044\u307e\u3059\u304c\u3001\u8ff7\u60d1\u30e1\u30fc\u30eb\u6271\u3044\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"alignnone  wp-image-11226\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/gmail.png\" alt=\"\" width=\"600\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/gmail.png 765w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2022\/05\/gmail-300x38.png 300w\" sizes=\"(max-width: 765px) 100vw, 765px\" \/><\/p>\n<p>Gmail\u306b\u8ff7\u60d1\u30e1\u30fc\u30eb\u6271\u3044\u3055\u308c\u305a\u3001\u66f4\u306b\u30bb\u30ad\u30e5\u30a2\u306b\u4f7f\u3048\u308b\u3088\u3046\u306b\u3001\u307e\u305a\u306fSSL\/TLS\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.webcyou.com\/?p=11230\">Ubuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Postfix Let\u2019s Encrypt\u3067TLS\u5316<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306eUbuntu 20.04 LTS \u30b5\u30fc\u30d0\u69cb\u7bc9 \u2013 Dovecot\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u7d9a\u304d\u3067\u3059\u3002 Postfix\u3067\u4f7f\u7528\u3067\u304d\u308bSASL\u5b9f\u88c5\u3068\u3057\u3066\u306fCyrus SASL\u3068Dovecot SASL\u306e2\u3064\u3068\u306a\u308a\u3001\u4eca\u56de\u306fdoveco [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":11192,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[248],"tags":[221,44,45,293],"class_list":{"0":"post-11221","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-ubuntu","8":"tag-linux","9":"tag-web","11":"tag-293"},"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/11221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11221"}],"version-history":[{"count":6,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/11221\/revisions"}],"predecessor-version":[{"id":11263,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/11221\/revisions\/11263"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/media\/11192"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}