{"id":1997,"date":"2021-01-13T22:42:29","date_gmt":"2021-01-13T13:42:29","guid":{"rendered":"https:\/\/www.kinryo.net\/?p=1997"},"modified":"2024-02-26T15:24:58","modified_gmt":"2024-02-26T06:24:58","slug":"%ef%bc%92%ef%bc%9adovecot%e3%81%ae%e8%a8%ad%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/www.kinryo.net\/?p=1997","title":{"rendered":"\uff12\uff1adovecot\u306e\u8a2d\u5b9a"},"content":{"rendered":"\r\n<p class=\"wp-block-paragraph\">dovecot\u306e\u8a8d\u8a3c\u306fmysql(mariadb)\u3092\u4f7f\u3044\u307e\u3059\u3001SSL\u306fletsencrypt\u3092\u4f7f\u7528\u3001\u30ed\u30b0\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306email.log\u3067\u306f\u7121\u304fdovecot.log\u306b\u3059\u308b\u3002imap\u3068pop3\u306e\u8a2d\u5b9a\u304c\u5165\u3063\u3066\u3044\u308b\u304c\u3001pop3\u306f\u30d5\u30a1\u30a4\u30e4\u30fc\u30a6\u30a9\u30fc\u30eb\u3067\u7981\u6b62\u3057\u3066\u3044\u307e\u3059\u3002SMTP\u8a8d\u8a3c\u3082dovecot\u5074\u3067\u3084\u308a\u307e\u3059\u3002<br \/>\u30e1\u30fc\u30eb\u306e\u4fdd\u5b58\u5834\u6240\u306b\u306f\u65b0\u898f\u306b\u4f5c\u3063\u305f50GB\u306e\u9818\u57df\u3067\u3042\u308b \/Mail \u306b\u30c9\u30e1\u30a4\u30f3\uff0f\u30e6\u30fc\u30b6\u30fc\u540d\uff08\u30e1\u30a2\u30c9\u306e\uff20\u3088\u308a\u524d\u306e\u90e8\u5206\uff09\u3068\u3057\u3066\u4fdd\u5b58\u3001\u3053\u3053\u3092\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u306f\u65b0\u898f\u306bvmail\u3068\u3044\u3046\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3057\u3001\u5176UID\u3001GID\u309210000\u3068\u3057\u3001\u3053\u306e\u30e6\u30fc\u30b6\u30fc\u3067\u30e1\u30fc\u30eb\u306e\u4fdd\u5b58\u306a\u3069\u3092\u3059\u308b\u3002<br \/>dovecot\u306f\u3001\/etc\/dovecot\/local.conf \u3092\u4f5c\u308b\u4e8b\u3067\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<br \/>\u307e\u305a\u306flocal.conf\u3092\u6709\u52b9\u306b\u3059\u308b\u70ba\u306b \/etc\/dovecot.conf \u306e\u6700\u5f8c\u306b<span style=\"color: #008000;\"> !include_try local.conf<\/span> \u3092\u66f8\u304d\u5165\u308c\u307e\u3059\u3002\u6b21\u306b \/etc\/dovecot\/conf.d\/10-auth.conf \u3092\u5909\u66f4<br \/><span style=\"color: #008000;\">#<span style=\"color: #ff6600;\">!include auth-system.conf.ext<\/span><\/span> \u5148\u982d\u306b#\u3092\u5165\u308c\u3066\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\uff08\u3053\u308c\u306f\u30b7\u30b9\u30c6\u30e0\u306e\u30ed\u30b0\u30a4\u30f3\u3092\u4f7f\u3046\u5834\u5408\u306a\u306e\u3067\u4eca\u56de\u306f\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\uff09<br \/><span style=\"color: #ff6600;\">!include auth-sql.conf.ext <span style=\"color: #333333;\">\u306e\u5148\u982d\u306e#\u3092\u524a\u9664\u3057\u6709\u52b9\u5316\u3002<br \/>\u6b21\u306b\u3001local.conf\u3092\u4f5c\u6210<br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">gedit \/etc\/dovecot\/local.conf<br \/><\/span><\/span><\/span><span style=\"color: #000080;\">protocols = imap pop3<\/span><br \/><span style=\"color: #000080;\">listen = *<\/span><br \/><span style=\"color: #000080;\">login_greeting = ready.<\/span><br \/><span style=\"color: #000080;\">syslog_facility = local5<\/span><br \/><span style=\"color: #000080;\">log_path = \/var\/log\/dovecot.log<\/span><br \/><span style=\"color: #000080;\">ssl = yes<\/span><br \/><span style=\"color: #000080;\">ssl_cert = &lt;\/etc\/letsencrypt\/live\/mail.kinryo.net\/fullchain.pem<\/span><br \/><span style=\"color: #000080;\">ssl_key = &lt;\/etc\/letsencrypt\/live\/mail.kinryo.net\/privkey.pem<\/span><br \/><span style=\"color: #000080;\">mail_location = maildir:\/Mail\/%d\/%n<\/span><br \/><span style=\"color: #000080;\">first_valid_uid = 10000<\/span><br \/><span style=\"color: #000080;\">first_valid_gid = 10000<\/span><br \/><span style=\"color: #000080;\">mail_uid = 10000<\/span><br \/><span style=\"color: #000080;\">mail_gid = 10000<\/span><br \/><span style=\"color: #000080;\">#auth_mechanisms = plain<\/span><br \/><span style=\"color: #000080;\">auth_mechanisms = plain login cram-md5<\/span><br \/><span style=\"color: #000080;\">service auth {<\/span><br \/><span style=\"color: #000080;\">\u00a0\u00a0\u00a0\u00a0 unix_listener \/var\/spool\/postfix\/private\/auth {<\/span><br \/><span style=\"color: #000080;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mode = 0660<\/span><br \/><span style=\"color: #000080;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 user = postfix<\/span><br \/><span style=\"color: #000080;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 group = postfix<\/span><br \/><span style=\"color: #000080;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><br \/><span style=\"color: #000080;\">}<\/span><br \/><span style=\"color: #000080;\">#protocol imap {<\/span><br \/><span style=\"color: #000080;\">#\u00a0 \u00a0\u00a0 mail_plugins = quota imap_quota<\/span><br \/><span style=\"color: #000080;\">#}<\/span><br \/><span style=\"color: #000080;\">#protocol pop3 {<\/span><br \/><span style=\"color: #000080;\">#\u00a0\u00a0\u00a0\u00a0 mail_plugins = quota<\/span><br \/><span style=\"color: #000080;\">#}<\/span><br \/><span style=\"color: #000080;\">#auth_verbose = yes<\/span><br \/><span style=\"color: #000080;\">#auth_debug = yes<\/span><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">quota\u306f\u73fe\u6642\u70b9\u3067\u306f\u672a\u4f7f\u7528\uff08\u5c06\u6765\u306e\u70ba\uff09\u3001\u6700\u5f8c\u306eauth\u304b\u3089\u59cb\u307e\u308b\u4e8c\u884c\u306f\u30c7\u30d0\u30c3\u30b0\u3092\u3059\u308b\u3068\u304d\u306b\u6709\u52b9\u306b\u3059\u308b\u3002\u30c9\u30e1\u30a4\u30f3\u3084\u30e6\u30fc\u30b6\u30fc\u306e\u4f5c\u6210\u306fpostfixadmin\u304b\u3089\u884c\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u969b\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u6697\u53f7\u5316\u3092\u540c\u3058\u306b\u3059\u308b\u305f\u3081\u306b\u3001auth_mechanisms = plain login cram-md5 \u3092\u5165\u308c\u3066\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u306fcram-md5 \u3060\u3051\u3067\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u672a\u691c\u8a3c\u3067\u3059\u3002\u307e\u305f\u3001postfixadmin\u5074\u306e\u6697\u53f7\u5316\u3092cram-md5\u306b\u3059\u308b\u305f\u3081\u306b\u3001postfixadmin\u306e\u4e0b\u306b\u3042\u308b config.inc.php\u306b<br \/><span style=\"color: #ff6600;\">\/\/$CONF[&#8216;encrypt&#8217;] = &#8216;md5crypt&#8217;;<\/span> \u306e\u4e0b\u306b<br \/><span style=\"color: #008000;\">$CONF[&#8216;encrypt&#8217;] = &#8216;dovecot:CRAM-MD5&#8217;;<\/span> \u3092\u8a18\u5165\u3057\u4fdd\u5b58\u3002\u3053\u308c\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u6697\u53f7\u5316\u304ccram-md5\u306b\u306a\u308b\u3002\u6b21\u306bmysql(mariadb)\u95a2\u9023\u306e\u8a2d\u5b9a<br \/><span style=\"color: #ff6600;\">#<\/span><span style=\"color: #008000;\"> gedit \/etc\/dovecot\/dovecot-sql.conf.ext<br \/><span style=\"color: #0000ff;\">driver = mysql<\/span><br \/><\/span><span style=\"color: #0000ff;\"> connect = host=localhost dbname=postfix user=postfix password=xxxxxxx default_pass_scheme = CRAM-MD5<br \/><\/span><span style=\"color: #008000;\"><span style=\"color: #0000ff;\"> user_query = select concat(&#8216;\/Mail\/&#8217;, maildir) as home, 10000 as uid, 10000 as gid FROM mailbox WHERE username = &#8216;%u&#8217; AND active = &#8216;1&#8217;;<\/span><br \/><span style=\"color: #0000ff;\"> password_query = SELECT password FROM mailbox WHERE username = &#8216;%u&#8217; AND active = &#8216;1&#8217;;<\/span><\/span><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u6b21\u306fpostfixadmin\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a\u30023\uff1apostfixadmin\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a\u3092\u53c2\u7167<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>dovecot\u306e\u8a8d\u8a3c\u306fmysql(mariadb)\u3092\u4f7f\u3044\u307e\u3059\u3001SSL\u306fletsencrypt\u3092\u4f7f\u7528\u3001\u30ed\u30b0\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306email.log\u3067\u306f\u7121\u304fdovecot.log\u306b\u3059\u308b\u3002imap\u3068pop3\u306e\u8a2d\u5b9a\u304c\u5165\u3063\u3066\u3044\u308b\u304c\u3001pop3 &hellip; <a href=\"https:\/\/www.kinryo.net\/?p=1997\">\u7d9a\u304d\u3092\u8aad\u3080 <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":{"_acf_changed":false,"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"common","vkexunit_cta_each_option":"","footnotes":""},"categories":[21],"tags":[],"class_list":["post-1997","post","type-post","status-publish","format-standard","hentry","category-21"],"acf":[],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/1997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1997"}],"version-history":[{"count":41,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/1997\/revisions"}],"predecessor-version":[{"id":3914,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/1997\/revisions\/3914"}],"wp:attachment":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}