{"id":6803,"date":"2023-03-09T17:10:42","date_gmt":"2023-03-09T08:10:42","guid":{"rendered":"https:\/\/www.lancard.com\/blog\/?p=6803"},"modified":"2025-03-12T11:23:57","modified_gmt":"2025-03-12T02:23:57","slug":"dovecot-shared-folder","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2023\/03\/09\/dovecot-shared-folder\/","title":{"rendered":"Dovecot\u3067\u5171\u6709\u30d5\u30a9\u30eb\u30c0"},"content":{"rendered":"\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\nDovecot\u3067\u3001\u4ed6\u4eba\u3068\u540c\u3058\u30e1\u30fc\u30eb\u30d5\u30a9\u30eb\u30c0\u3092\u5171\u6709\u3059\u308b\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3059\u3002<br>\u30e6\u30fc\u30b6\u306e\u3044\u306a\u3044\u30d5\u30a9\u30eb\u30c0\u3092\u5168\u54e1\u3067\u5171\u6709\u3059\u308b\u30b1\u30fc\u30b9\u3068\u3001\u500b\u4eba\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u8ab0\u304b\u306b\u5171\u6709\u3059\u308b\u30b1\u30fc\u30b9\u306e\uff12\u3064\u3092\u8a2d\u5b9a\u3057\u3066\u307f\u307e\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n\n<!--more-->\n\n\n\n\n<h2 class=\"has-large-font-size wp-block-heading\">1. \u30d1\u30d6\u30ea\u30c3\u30af\u5171\u6709\u306e\u30b1\u30fc\u30b9<\/h2>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n\u3053\u3061\u3089\u306f\u30e6\u30fc\u30b6\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u4ed6\u30e6\u30fc\u30b6\u306b\u898b\u305b\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u5168\u54e1\u304c\u898b\u308c\u308b\u3088\u3046\u306a\u5171\u6709\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n\u307e\u305a\u306f\u3001\u8ab0\u3067\u3082\u30e1\u30fc\u30eb\u3092\u7f6e\u3044\u305f\u308a\u524a\u9664\u3057\u305f\u308a\u51fa\u6765\u308b\u6700\u5c0f\u9650\u306e\u69cb\u6210\u3092\u4f5c\u3063\u3066\u898b\u307e\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>conf.d\/10-mail.conf<\/li>\n<\/ul>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code># default\u5074\u306fseparator\u3092\u8ffd\u52a0\u3059\u308b\u3060\u3051\nnamespace inbox {\n  separator = \/\n  # ...\n}\n# add public\nnamespace {\n  type = public\n  # should use the same separator for all\n  separator = \/\n  prefix = Public\/\n  location = maildir:\/var\/mail\/public\n  subscriptions = no\n}<\/code><\/pre>\n\n\n\n\npublic\u7528\u30d5\u30a9\u30eb\u30c0\u3092mkdir\u3057\u307e\u3059\u3002\u3064\u3044\u3067\u306btest\u30d5\u30a9\u30eb\u30c0\u3082\u4f5c\u6210\u3002\n\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir \/var\/mail\/public\/\nmkdir \/var\/mail\/public\/.test\nchown -R vmb.vmb \/var\/mail\/public<\/code><\/pre>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n\u3053\u308c\u3067dovecot\u30ea\u30ed\u30fc\u30c9\u5f8c\u3001RoundCube\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3001\u8a2d\u5b9a\uff1e\u30d5\u30a9\u30eb\u30c0\u3092\u898b\u308b\u3068Public\/test\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"482\" height=\"153\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-1.png\" alt=\"\" class=\"wp-image-6804\" srcset=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-1.png 482w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-1-400x127.png 400w\" sizes=\"auto, (max-width: 482px) 100vw, 482px\" \/><\/a><\/figure>\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n\u203bPublic\u81ea\u4f53\u306b\u30e1\u30fc\u30eb\u306f\u7f6e\u3051\u307e\u305b\u3093\u306e\u3067\u3001\u305d\u306e\u4e0b\u306b\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u308a\u7f6e\u304d\u307e\u3059\u3002\u8ab0\u304b\u304c\u30e1\u30fc\u30eb\u3092\u7f6e\u3051\u3070\u898b\u308c\u308b\u3057\u3001\u524a\u9664\u3059\u308c\u3070\u6d88\u3048\u308b\u3057\u3001\u95b2\u89a7\u3059\u308c\u3070\u5168\u54e1\u304c\u95b2\u89a7\u6e08\u3068\u306a\u308a\u307e\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\">1-1. \u4e00\u822c\u30e6\u30fc\u30b6\u306f\u95b2\u89a7\u306e\u307f\u53ef\u80fd\u306b\u3059\u308b<\/h2>\n\n\n\n\u6b21\u306b\u30e6\u30fc\u30b6\u306f\u95b2\u89a7\u306e\u307f\u3067\u3001\u7ba1\u7406\u8005\u3092\u4e00\u4eba\u8a2d\u5b9a\u3057\u3066\u305d\u306e\u30e6\u30fc\u30b6\u306b\u30e1\u30fc\u30eb\u3092\u7f6e\u3044\u305f\u308a\u3059\u308b\u6a29\u9650\u3092\u4e0e\u3048\u308b\u3088\u3046\u306bACL\u3092\u8a2d\u5b9a\u3057\u3066\u307f\u307e\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>conf.d\/10-mail.conf<\/li>\n<\/ul>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code>mail_plugins = $mail_plugins acl<\/code><\/pre>\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>conf.d\/90-acl.conf<\/li>\n<\/ul>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code>plugin {\n  acl = vfile:\/etc\/dovecot\/global-acls:cache_secs=300\n  # (v2.2.31+)\n  #acl_globals_only = yes\n}<\/code><\/pre>\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>\/etc\/dovecot\/global-acls<\/li>\n<\/ul>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code>Public\/* anyone lrs\nPublic user=aikawa@virtual.localdomain lrswtipekxa\nPublic\/* user=aikawa@virtual.localdomain lrswtipekxa<\/code><\/pre>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n\u3053\u308c\u3067Public\u4e0b\u306e\u30d5\u30a9\u30eb\u30c0\u306f\u3001\u8ab0\u3067\u3082\u95b2\u89a7\u53ef\u80fd\u3001aikawa@virtual.localdomain\u304c\u7ba1\u7406\u8005\u3068\u3057\u3066\u30d5\u30a9\u30eb\u30c0\u306e\u4f5c\u6210\u3084\u30e1\u30fc\u30eb\u3092\u8a2d\u7f6e\u3057\u305f\u308a\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br>acl_globals_only\u306f\u4eca\u56de\u8a2d\u5b9a\u3057\u307e\u305b\u3093\u306e\u3067\u3001\u30e6\u30fc\u30b6\u306e\u30d5\u30a9\u30eb\u30c0\u3054\u3068\u306bdovecot-acl\u8a2d\u7f6e\u3082\u53ef\u80fd\u3067\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n\u3064\u3044\u3067\u306b\u3001\u95b2\u89a7\u306b\u3064\u3044\u3066\u500b\u4eba\u3054\u3068\u306b\u65e2\u8aad\u30fb\u672a\u8aad\u3092\u5207\u308a\u66ff\u3048\u3089\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br>conf.d\/10-mail.conf \u306enamespace{type=public}\u306elocation\u306b\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br>\u203bDovecot 2.3\u4ee5\u964d\u306fINDEXPVT\u3092\u8a2d\u5b9a\u3059\u308b\u4e8b\u3067\u3001\u305d\u3053\u306b\u95b2\u89a7\u30d5\u30e9\u30b0\u306e\u7ba1\u7406\u30d5\u30a1\u30a4\u30eb\u3092\u8a2d\u7f6e\u51fa\u6765\u307e\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code>  location = maildir:\/var\/mail\/public:CONTROL=~\/Maildir\/public:INDEXPVT=~\/Maildir\/public<\/code><\/pre>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<h2 class=\"has-medium-font-size wp-block-heading\">1-2. RoundCube\u306eACL\u30d7\u30e9\u30b0\u30a4\u30f3<\/h2>\n\n\n\nRoundCube\u3067\u3082acl\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u6709\u52b9\u306b\u3057\u3066\u307f\u307e\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>conf.d\/20-imap.conf<\/li>\n<\/ul>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code>protocol imap {\n mail_plugins = $mail_plugins imap_acl\n}<\/code><\/pre>\n\n\n\n\nRoundCube\u5074\u306eroundcube\/config\/config.inc.php\u3067acl\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\n\n\n\n\n<pre class=\"wp-block-code\"><code>$config&#91;'plugins'] = &#91;'acl'];<\/code><\/pre>\n\n\n\n\n\u518d\u5ea6\u30ed\u30b0\u30a4\u30f3\u3057\u76f4\u3057\u3066\u3001\u8a2d\u5b9a\uff1e\u30d5\u30a9\u30eb\u30c0\u3067Public\u3092\u898b\u308b\u3068\u3001\u4e00\u822c\u30e6\u30fc\u30b6\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"328\" height=\"278\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-2.png\" alt=\"\" class=\"wp-image-6805\"\/><\/a><\/figure>\n\n\n\n\u7ba1\u7406\u8005aikawa@virtual.localdomain\u3067\u306f\u3001\u6a29\u9650\u306e\u7de8\u96c6\u3068\u30d5\u30a9\u30eb\u30c0\u306e\u4f5c\u6210\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"243\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-4-602x243.png\" alt=\"\" class=\"wp-image-6807\" srcset=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-4-602x243.png 602w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-4-400x161.png 400w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-4.png 714w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/a><\/figure>\n\n\n\nPublic\/test\u30d5\u30a9\u30eb\u30c0\u306fglobal\u3067\u8a2d\u5b9a\u3057\u305f\u5185\u5bb9\u304c\u53cd\u6620\u3055\u308c\u3066\u3044\u307e\u3059\u3002\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"415\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-6-602x415.png\" alt=\"\" class=\"wp-image-6809\" srcset=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-6-602x415.png 602w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-6-400x276.png 400w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-6.png 701w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/a><\/figure>\n\n\n\n\n<h2 class=\"has-large-font-size wp-block-heading\">2. \u30e6\u30fc\u30b6\u9593\u306e\u30e1\u30fc\u30eb\u5171\u6709<\/h2>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n\u3053\u3061\u3089\u306f\u30e6\u30fc\u30b6\u9593\u3067\u3001\u6307\u5b9a\u30e6\u30fc\u30b6\u306e\u30e1\u30fc\u30eb\u3092\u95b2\u89a7\u53ef\u80fd\u306b\u3057\u3066\u307f\u307e\u3059\u3002<br>\uff08\u30e6\u30fc\u30b6\u9593\u306e\u65b9\u306f\u30d5\u30a1\u30a4\u30eb\u306e\u66f8\u304d\u65b9\u3068\u304b\u8a18\u8f09\u306e\u7121\u3044\u6240\u304c\u591a\u304f\u3066\u3001\u8abf\u3079\u3066\u884c\u304f\u306e\u304c\u9762\u5012\u3067\u3057\u305f\u3002Public\u306e\u65b9\u304c\u4f7f\u3044\u3084\u3059\u3044\u3057\u697d\u3060\u3057\u3001\u307b\u307c\u4f7f\u308f\u306a\u3044\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\uff09\n<\/div>\n<\/div>\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>conf.d\/10-mail.conf<\/li>\n<\/ul>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code># default\u5074\u306fseparator\u3092\u8ffd\u52a0\u3059\u308b\u3060\u3051\nnamespace inbox {\n  separator = \/\n  # ...\n}\n# add shared\nnamespace {\n  type = shared\n  separator = \/\n  prefix = shared\/%%n\/\n  location = maildir:%%h\/Maildir:INDEX=~\/Maildir\/shared\/%%n:INDEXPVT=~\/Maildir\/shared\/%%n\n  subscriptions = no\n  list = children\n}\n# virtual mailbox owner\nmail_access_groups = vmb<\/code><\/pre>\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>conf.d\/20-imap.conf<\/li>\n<\/ul>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code>protocol imap {\n mail_plugins = $mail_plugins imap_acl\n}<\/code><\/pre>\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>conf.d\/90-acl.conf<\/li>\n<\/ul>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code>plugin {\n  acl = vfile:\/etc\/dovecot\/global-acls:cache_secs=300\n}\nplugin {\n  # vmb can access\n  acl_shared_dict = file:\/var\/mail\/shared\/shared-mailboxes\n}<\/code><\/pre>\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>\/etc\/dovecot\/global-acls<\/li>\n<\/ul>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code>shared\/* anyone lrs<\/code><\/pre>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\nacl_shared_dict \u306e\u30d5\u30a1\u30a4\u30eb \/var\/mail\/shared\/shared-mailboxes \u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir \/var\/mail\/shared\ntouch \/var\/mail\/shared\/shared-mailboxes\nchown -R vmb.vmb \/var\/mail\/shared<\/code><\/pre>\n\n\n\n\u3053\u306e\u6642\u70b9\u3067\u3001\u5404\u30e6\u30fc\u30b6\u306eMaildir\/subscriptions\u306bshared\/username \u3092\u8ffd\u52a0\u3059\u308b\u4e8b\u3067\u95b2\u89a7\u51fa\u6765\u308b\u306e\u3067\u3059\u304c\u3001\u30d5\u30a9\u30eb\u30c0\u30fc\u4e00\u89a7\u306b\u306f\u51fa\u305a\u3001\u307b\u307c\u5b9f\u8cea\u95b2\u89a7\u304c\u4e0d\u53ef\u80fd\u306a\u305f\u3081\u3001\u8ffd\u52a0\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>\/var\/mail\/shared\/shared-mailboxes<\/li>\n<\/ul>\n\n\n\n\n1\u8a2d\u5b9a\u306b\u3064\u304d2\u884c\u69cb\u6210\u3067\u30011\u884c\u76ee\u306f\u30e6\u30fc\u30b6\u30012\u884c\u76ee\u306f\u30d5\u30e9\u30b0\u3092\u8a18\u8f09\u3059\u308b\u3088\u3046\u3067\u3059\u3002<br>\u30e6\u30fc\u30b6\u500b\u5225\u306b\u95b2\u89a7\u3055\u305b\u308b\u5834\u5408\u3001shared\/shared-boxes\/user\/$to\/$from \u306e\u5f62\u5f0f\u3067\u8a18\u8f09\u3057\u307e\u3059\u3002<br>2\u884c\u76ee\u306f1\u56fa\u5b9a\u306e\u3088\u3046\u3067\u3059\u304c\u3001\u5272\u3068\u4ed6\u306e\u6587\u5b57\u5217\u3067\u3082\u6709\u52b9\u30d5\u30e9\u30b0\u6271\u3044\u306b\u306a\u308b\u3088\u3046\u3067\u3059\u3002\n\n\n\n\n<pre class=\"wp-block-code\"><code>shared\/shared-boxes\/user\/user1@virtual.localdomain\/aikawa@virtual.localdomain\n1<\/code><\/pre>\n\n\n\n\n\u4e0a\u8a18\u3067\u306faikawa@virtual.localdomain\u306e\u30d5\u30a9\u30eb\u30c0\u3092user1@virtual.localdomain\u304c\u95b2\u89a7\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"291\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-7.png\" alt=\"\" class=\"wp-image-6824\" srcset=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-7.png 474w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-7-400x246.png 400w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/a><\/figure>\n\n\n\n\u3042\u308b\u30e6\u30fc\u30b6\u3092\u5168\u54e1\u306b\u95b2\u89a7\u3055\u305b\u308b\u5834\u5408\u3001shared\/shared-boxes\/anyone\/$from \u306e\u5f62\u5f0f\u3067\u8a18\u8f09\u3057\u307e\u3059\u3002\n\n\n\n\n<pre class=\"wp-block-code\"><code>shared\/shared-boxes\/user\/user1@virtual.localdomain\/aikawa@virtual.localdomain\n1\nshared\/shared-boxes\/anyone\/test@virtual.localdomain\n1<\/code><\/pre>\n\n\n\n\n\u3053\u308c\u3067\u5168\u54e1\u304ctest@virtual.localdomain\u3092\u95b2\u89a7\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<br>user1@virtual.localdomain\u304b\u3089\u898b\u305f\u5834\u5408\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-8.png\"><img loading=\"lazy\" decoding=\"async\" width=\"473\" height=\"353\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-8.png\" alt=\"\" class=\"wp-image-6825\" srcset=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-8.png 473w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-8-400x299.png 400w\" sizes=\"auto, (max-width: 473px) 100vw, 473px\" \/><\/a><\/figure>\n\n\n\n\u4ed6\u306e\u30e6\u30fc\u30b6\uff08test@virtual.localdomain\u4ee5\u5916\uff09\u304b\u3089\u898b\u305f\u5834\u5408\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-10.png\"><img loading=\"lazy\" decoding=\"async\" width=\"480\" height=\"322\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-10.png\" alt=\"\" class=\"wp-image-6827\" srcset=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-10.png 480w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2023\/03\/image-10-400x268.png 400w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/a><\/figure>\n\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\">2-1. SQL\u3067\u7ba1\u7406\u3059\u308b<\/h2>\n\n\n\n\n\u5171\u6709\u3059\u308b\u30e6\u30fc\u30b6\u3092\u30d5\u30a1\u30a4\u30eb\u3067\u306a\u304fSQL\u3067\u7ba1\u7406\u3057\u3066\u307f\u307e\u3059\u3002\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>conf.d\/90-acl.conf<\/li>\n<\/ul>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code>plugin {\n  acl_shared_dict = proxy::acl\n}\ndict {\n  acl = pgsql:\/usr\/local\/etc\/dovecot\/dovecot-dict-shared-sql.conf.ext\n}<\/code><\/pre>\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>\/usr\/local\/etc\/dovecot\/dovecot-dict-shared.sql.conf.ext<\/li>\n<\/ul>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code>connect = host=localhost user=mail password=testpass dbname=mail\nmap {\n  pattern = shared\/shared-boxes\/user\/$to\/$from\n  table = user_shares\n  value_field = dummy\n  fields {\n    from_user = $from\n    to_user = $to\n  }\n}\nmap {\n  pattern = shared\/shared-boxes\/anyone\/$from\n  table = anyone_shares\n  value_field = dummy\n  fields {\n    from_user = $from\n  }\n}<\/code><\/pre>\n\n\n\n\n\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\n\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE user_shares (\n  from_user varchar(100) not null,\n  to_user varchar(100) not null,\n  dummy char(1) DEFAULT '1',    -- always '1' currently\n  primary key (from_user, to_user)\n);\nCOMMENT ON TABLE user_shares IS 'User from_user shares folders to user to_user.';\nCREATE INDEX to_user ON user_shares (to_user); -- because we always search for to_user\nCREATE TABLE anyone_shares (\n  from_user varchar(100) not null,\n  dummy char(1) DEFAULT '1',    -- always '1' currently\n  primary key (from_user)\n);\nCOMMENT ON TABLE anyone_shares IS 'User from_user shares folders to anyone.';<\/code><\/pre>\n\n\n\n\n\u5148\u307b\u3069\u306e\u30d5\u30a1\u30a4\u30eb\u3068\u540c\u3058\u8a2d\u5b9a\u306e\u5834\u5408\u3001INSERT\u306f\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002\n\n\n\n\n<pre class=\"wp-block-code\"><code>INSERT INTO user_shares(from_user, to_user) VALUES('aikawa@virtual.localdomain', 'user1@virtual.localdomain');\nINSERT INTO anyone_shares(from_user) VALUES('test@virtual.localdomain');<\/code><\/pre>\n\n\n\n\n\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F6803&amp;t=Dovecot%E3%81%A7%E5%85%B1%E6%9C%89%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80&amp;s=100&amp;p[url]=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F6803&amp;p[images][0]=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-content%2Fuploads%2F2023%2F03%2Fimage-1.png&amp;p[title]=Dovecot%E3%81%A7%E5%85%B1%E6%9C%89%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F6803&amp;text=Dovecot%E3%81%A7%E5%85%B1%E6%9C%89%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&amp;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F6803&amp;title=Dovecot%E3%81%A7%E5%85%B1%E6%9C%89%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&amp;v=3&amp;t=Dovecot%E3%81%A7%E5%85%B1%E6%9C%89%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80&amp;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F6803\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=Dovecot%E3%81%A7%E5%85%B1%E6%9C%89%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80&amp;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F6803\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>Dovecot\u3067\u3001\u4ed6\u4eba\u3068\u540c\u3058\u30e1\u30fc\u30eb\u30d5\u30a9\u30eb\u30c0\u3092\u5171\u6709\u3059\u308b\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3059\u3002\u30e6\u30fc\u30b6\u306e\u3044\u306a\u3044\u30d5\u30a9\u30eb\u30c0\u3092\u5168\u54e1\u3067\u5171\u6709\u3059\u308b\u30b1\u30fc\u30b9\u3068\u3001\u500b\u4eba\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u8ab0\u304b\u306b\u5171\u6709\u3059\u308b\u30b1\u30fc\u30b9\u306e\uff12\u3064\u3092\u8a2d\u5b9a\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6803","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/6803","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=6803"}],"version-history":[{"count":58,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/6803\/revisions"}],"predecessor-version":[{"id":6871,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/6803\/revisions\/6871"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=6803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=6803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=6803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}