Typo in en_US/howto/public.folder.md.

This commit is contained in:
Zhang Huangbin 2016-03-03 12:50:25 +08:00
parent 2615a8cdec
commit 98416d36b9
3 changed files with 86 additions and 74 deletions

View File

@ -7,7 +7,7 @@ what you need to do is:
* enable the setting for public folder * enable the setting for public folder
* choose a preferred directory as public folder * choose a preferred directory as public folder
* create ACL file to control the access * set proper ACL rules to control the access
In this tutorial, we will show you how to share a public folder named `TestFolder`. In this tutorial, we will show you how to share a public folder named `TestFolder`.
@ -72,27 +72,31 @@ Important notes:
Now let's create required folder and our first shared folder `TestFolder`. Now let's create required folder and our first shared folder `TestFolder`.
> __Attention__: there's a dot in folder name while creating it, it's
> `.TestFolder`, not `TestFolder`. All folders with a prefixed dot will be
> considered as an IMAP folder by Dovecot with iRedMail default settings.
``` ```
mkdir -p /var/vmail/public/.TestFolder mkdir -p /var/vmail/public/.TestFolder
chown -R vmail:vmail /var/vmail/public chown -R vmail:vmail /var/vmail/public
chmod -R 0700 /var/vmail/public chmod -R 0700 /var/vmail/public
``` ```
> Note that there are no `cur/`, `new/` or `tmp/` directories directly under !!! note "Notes"
> the `/var/mail/public/`, because the `Public/` namespace isn't a mailbox
> itself. (If you create them manually, it does become a selectable mailbox.) * There's a dot in folder name while creating it, it's `.TestFolder`, not
`TestFolder`. All folders with a prefixed dot will be considered as an
IMAP folder by Dovecot with iRedMail default settings.
* There are no `cur/`, `new/` or `tmp/` directories directly under the
`/var/mail/public/` folder, because the `Public/` namespace isn't a
mailbox itself. If you create them manually, it does become a selectable
mailbox.
With steps above, if you login to webmail (or other IMAP client) as any mail With steps above, if you login to webmail (or other IMAP client) as any mail
user hosted on same server, there's no visible public folder at all -- this is user hosted on same server, there's no visible public folder at all -- this is
correct, because no one has permission to access this folder. correct, because no one has permission to access this folder right now.
## Manage Access Control with `doveadm` ## Manage Access Control with `doveadm`
Before we set any permission, let's check the access control of this public folder: Before we set any permission, let's check the access control of this public
folder first with command `doveadm acl get`:
``` ```
doveadm acl get -A "Public/TestFolder" doveadm acl get -A "Public/TestFolder"
@ -104,15 +108,15 @@ You can see output like below, no access control at all:
Username ID Global Rights Username ID Global Rights
``` ```
* With shell command below, we grant `lookup`, `read`, `write`, `insert`, With shell command below, we grant `lookup`, `read`, `write`, `insert`,
`delete` and `create` (sub-directory) permissions to user `delete` and `create` (sub-directory) permissions to user
`postmaster@test.com` (again, this user is hosted on same server): `postmaster@test.com` (again, this user is hosted on same server):
``` ```
doveadm acl set -A "Public/TestFolder" "user=postmaster@test.com" lookup read write insert delete create doveadm acl set -A "Public/TestFolder" "user=postmaster@test.com" lookup read write insert delete create
``` ```
Check the ACl with `doveadm` now: Check the ACl with `doveadm` again:
``` ```
# doveadm acl get -A "Public/TestFolder" # doveadm acl get -A "Public/TestFolder"
@ -123,8 +127,8 @@ postmaster@a.cn user=postmaster@test.com create delete insert lookup read
If you now login to webmail (or other IMAP client) as user `postmaster@test.com`, If you now login to webmail (or other IMAP client) as user `postmaster@test.com`,
you can see a new folder `TestFolder`. you can see a new folder `TestFolder`.
* With shell command below, we grant all users hosted on same server `lookup`, With shell command below, we grant all users hosted on same server `lookup`,
and `read` permissions: and `read` permissions:
``` ```
doveadm acl set -A "Public/TestFolder" "anyone" lookup read doveadm acl set -A "Public/TestFolder" "anyone" lookup read
@ -142,24 +146,25 @@ postmaster@a.cn user=postmaster@test.com create delete insert lookup read
If you login to webmail (or other IMAP client) as any user hosted on same If you login to webmail (or other IMAP client) as any user hosted on same
server, you can see a new folder `TestFolder`. server, you can see a new folder `TestFolder`.
* With shell command below we delete access control for user `postmaster@test.com`: With shell command below we delete access control for user `postmaster@test.com`:
``` ```
doveadm acl delete -A "Public/TestFolder" "user=postmaster@test.com" doveadm acl delete -A "Public/TestFolder" "user=postmaster@test.com"
``` ```
For more details about `doveadm` acl control, please read its [manual page](#references). For more details about ACL control, please read Dovecot tutorials mentioned in
[References](#references) below.
## Manage Access Control manually ## Manage Access Control manually
> Notes: !!! note
>
> * if you're running Dovecot-2, it's recommended to manage ACL with `doveadm` * if you're running Dovecot-2, it's recommended to manage ACL with `doveadm`
> command. command.
> * Dovecot will create file `/var/vmail/public/dovecot-acl-list` automatically, * Dovecot will create file `/var/vmail/public/dovecot-acl-list` automatically,
> it lists all mailboxes that have `l` rights assigned. If you manually it lists all mailboxes that have `l` rights assigned. If you manually
> add/edit `dovecot-acl` files, you may need to delete the `dovecot-acl-list` add/edit `dovecot-acl` files, you may need to delete the `dovecot-acl-list`
> to get the mailboxes visible. to get the mailboxes visible.
Access permission is controlled in file `dovecot-acl` under each shared folder, Access permission is controlled in file `dovecot-acl` under each shared folder,
let's create it before showing you some examples: let's create it before showing you some examples:
@ -170,18 +175,20 @@ chown vmail:vmail /var/vmail/public/.TestFolder/dovecot-acl
chmod 0700 /var/vmail/public/.TestFolder/dovecot-acl chmod 0700 /var/vmail/public/.TestFolder/dovecot-acl
``` ```
* With shell command below, we grant `lookup` (l), `read` (r), `write` (w), With shell command below, we grant `lookup` (l), `read` (r), `write` (w),
`insert` (i), `delete` (x) and `create sub-directory` (k) permissions to user `insert` (i), `delete` (x) and `create sub-directory` (k) permissions to user
`postmaster@test.com` (again, this user is hosted on same server): `postmaster@test.com` (again, this user is hosted on same server):
``` ```
echo 'user=postmaster@test.com lrwixk' >> /var/vmail/public/.TestFolder/dovecot-acl echo 'user=postmaster@test.com lrwixk' >> /var/vmail/public/.TestFolder/dovecot-acl
``` ```
* With shell command below, we grant all users `lookup` (l) and `read` (r) With shell command below, we grant all users `lookup` (l) and `read` (r)
permissions: permissions:
> Note: it requires setting `acl_anyone = allow` in Dovecot config file. !!! note "Reminder"
It requires Dovecot setting `acl_anyone = allow` in `dovecot.conf`.
``` ```
echo 'anyone lr' >> /var/vmail/public/.TestFolder/dovecot-acl echo 'anyone lr' >> /var/vmail/public/.TestFolder/dovecot-acl

View File

@ -19,6 +19,12 @@ h2 { font-size: 36px; padding-top: 24px;}
h3 { font-size: 24px; } h3 { font-size: 24px; }
h4 { font-size: 21px; } h4 { font-size: 21px; }
h5 { font-size: 18px; } h5 { font-size: 18px; }
h2 code { font-size: 36px; }
h3 code { font-size: 24px; }
h4 code { font-size: 21px; }
h5 code { font-size: 18px; }
a { a {
color: #0099ff; color: #0099ff;
margin: 0; margin: 0;

View File

@ -26,7 +26,7 @@ what you need to do is:</p>
<ul> <ul>
<li>enable the setting for public folder</li> <li>enable the setting for public folder</li>
<li>choose a preferred directory as public folder</li> <li>choose a preferred directory as public folder</li>
<li>create ACL file to control the access</li> <li>set proper ACL rules to control the access</li>
</ul> </ul>
<p>In this tutorial, we will show you how to share a public folder named <code>TestFolder</code>.</p> <p>In this tutorial, we will show you how to share a public folder named <code>TestFolder</code>.</p>
<h2 id="enable-public-folder-in-dovecot">Enable public folder in Dovecot</h2> <h2 id="enable-public-folder-in-dovecot">Enable public folder in Dovecot</h2>
@ -81,26 +81,33 @@ please also remove the comment mark in below line in <code>dovecot.conf</code>:<
with permission <code>0700</code>.</li> with permission <code>0700</code>.</li>
</ul> </ul>
<p>Now let's create required folder and our first shared folder <code>TestFolder</code>.</p> <p>Now let's create required folder and our first shared folder <code>TestFolder</code>.</p>
<blockquote>
<p><strong>Attention</strong>: there's a dot in folder name while creating it, it's
<code>.TestFolder</code>, not <code>TestFolder</code>. All folders with a prefixed dot will be
considered as an IMAP folder by Dovecot with iRedMail default settings.</p>
</blockquote>
<pre><code>mkdir -p /var/vmail/public/.TestFolder <pre><code>mkdir -p /var/vmail/public/.TestFolder
chown -R vmail:vmail /var/vmail/public chown -R vmail:vmail /var/vmail/public
chmod -R 0700 /var/vmail/public chmod -R 0700 /var/vmail/public
</code></pre> </code></pre>
<blockquote> <div class="admonition note">
<p>Note that there are no <code>cur/</code>, <code>new/</code> or <code>tmp/</code> directories directly under <p class="admonition-title">Notes</p>
the <code>/var/mail/public/</code>, because the <code>Public/</code> namespace isn't a mailbox <ul>
itself. (If you create them manually, it does become a selectable mailbox.)</p> <li>
</blockquote> <p>There's a dot in folder name while creating it, it's <code>.TestFolder</code>, not
<code>TestFolder</code>. All folders with a prefixed dot will be considered as an
IMAP folder by Dovecot with iRedMail default settings.</p>
</li>
<li>
<p>There are no <code>cur/</code>, <code>new/</code> or <code>tmp/</code> directories directly under the
<code>/var/mail/public/</code> folder, because the <code>Public/</code> namespace isn't a
mailbox itself. If you create them manually, it does become a selectable
mailbox.</p>
</li>
</ul>
</div>
<p>With steps above, if you login to webmail (or other IMAP client) as any mail <p>With steps above, if you login to webmail (or other IMAP client) as any mail
user hosted on same server, there's no visible public folder at all -- this is user hosted on same server, there's no visible public folder at all -- this is
correct, because no one has permission to access this folder.</p> correct, because no one has permission to access this folder right now.</p>
<h2 id="manage-access-control-with-doveadm">Manage Access Control with <code>doveadm</code></h2> <h2 id="manage-access-control-with-doveadm">Manage Access Control with <code>doveadm</code></h2>
<p>Before we set any permission, let's check the access control of this public folder:</p> <p>Before we set any permission, let's check the access control of this public
folder first with command <code>doveadm acl get</code>:</p>
<pre><code>doveadm acl get -A &quot;Public/TestFolder&quot; <pre><code>doveadm acl get -A &quot;Public/TestFolder&quot;
</code></pre> </code></pre>
@ -108,15 +115,13 @@ correct, because no one has permission to access this folder.</p>
<pre><code>Username ID Global Rights <pre><code>Username ID Global Rights
</code></pre> </code></pre>
<ul> <p>With shell command below, we grant <code>lookup</code>, <code>read</code>, <code>write</code>, <code>insert</code>,
<li>With shell command below, we grant <code>lookup</code>, <code>read</code>, <code>write</code>, <code>insert</code>, <code>delete</code> and <code>create</code> (sub-directory) permissions to user
<code>delete</code> and <code>create</code> (sub-directory) permissions to user <code>postmaster@test.com</code> (again, this user is hosted on same server):</p>
<code>postmaster@test.com</code> (again, this user is hosted on same server):</li>
</ul>
<pre><code>doveadm acl set -A &quot;Public/TestFolder&quot; &quot;user=postmaster@test.com&quot; lookup read write insert delete create <pre><code>doveadm acl set -A &quot;Public/TestFolder&quot; &quot;user=postmaster@test.com&quot; lookup read write insert delete create
</code></pre> </code></pre>
<p>Check the ACl with <code>doveadm</code> now:</p> <p>Check the ACl with <code>doveadm</code> again:</p>
<pre><code># doveadm acl get -A &quot;Public/TestFolder&quot; <pre><code># doveadm acl get -A &quot;Public/TestFolder&quot;
Username ID Global Rights Username ID Global Rights
postmaster@a.cn user=postmaster@test.com create delete insert lookup read write postmaster@a.cn user=postmaster@test.com create delete insert lookup read write
@ -124,10 +129,8 @@ postmaster@a.cn user=postmaster@test.com create delete insert lookup read
<p>If you now login to webmail (or other IMAP client) as user <code>postmaster@test.com</code>, <p>If you now login to webmail (or other IMAP client) as user <code>postmaster@test.com</code>,
you can see a new folder <code>TestFolder</code>.</p> you can see a new folder <code>TestFolder</code>.</p>
<ul> <p>With shell command below, we grant all users hosted on same server <code>lookup</code>,
<li>With shell command below, we grant all users hosted on same server <code>lookup</code>, and <code>read</code> permissions:</p>
and <code>read</code> permissions:</li>
</ul>
<pre><code>doveadm acl set -A &quot;Public/TestFolder&quot; &quot;anyone&quot; lookup read <pre><code>doveadm acl set -A &quot;Public/TestFolder&quot; &quot;anyone&quot; lookup read
</code></pre> </code></pre>
@ -140,16 +143,15 @@ postmaster@a.cn user=postmaster@test.com create delete insert lookup read
<p>If you login to webmail (or other IMAP client) as any user hosted on same <p>If you login to webmail (or other IMAP client) as any user hosted on same
server, you can see a new folder <code>TestFolder</code>.</p> server, you can see a new folder <code>TestFolder</code>.</p>
<ul> <p>With shell command below we delete access control for user <code>postmaster@test.com</code>:</p>
<li>With shell command below we delete access control for user <code>postmaster@test.com</code>:</li>
</ul>
<pre><code>doveadm acl delete -A &quot;Public/TestFolder&quot; &quot;user=postmaster@test.com&quot; <pre><code>doveadm acl delete -A &quot;Public/TestFolder&quot; &quot;user=postmaster@test.com&quot;
</code></pre> </code></pre>
<p>For more details about <code>doveadm</code> acl control, please read its <a href="#references">manual page</a>.</p> <p>For more details about ACL control, please read Dovecot tutorials mentioned in
<a href="#references">References</a> below.</p>
<h2 id="manage-access-control-manually">Manage Access Control manually</h2> <h2 id="manage-access-control-manually">Manage Access Control manually</h2>
<blockquote> <div class="admonition note">
<p>Notes:</p> <p class="admonition-title">Note</p>
<ul> <ul>
<li>if you're running Dovecot-2, it's recommended to manage ACL with <code>doveadm</code> <li>if you're running Dovecot-2, it's recommended to manage ACL with <code>doveadm</code>
command.</li> command.</li>
@ -158,7 +160,7 @@ server, you can see a new folder <code>TestFolder</code>.</p>
add/edit <code>dovecot-acl</code> files, you may need to delete the <code>dovecot-acl-list</code> add/edit <code>dovecot-acl</code> files, you may need to delete the <code>dovecot-acl-list</code>
to get the mailboxes visible.</li> to get the mailboxes visible.</li>
</ul> </ul>
</blockquote> </div>
<p>Access permission is controlled in file <code>dovecot-acl</code> under each shared folder, <p>Access permission is controlled in file <code>dovecot-acl</code> under each shared folder,
let's create it before showing you some examples:</p> let's create it before showing you some examples:</p>
<pre><code>touch /var/vmail/public/.TestFolder/dovecot-acl <pre><code>touch /var/vmail/public/.TestFolder/dovecot-acl
@ -166,21 +168,18 @@ chown vmail:vmail /var/vmail/public/.TestFolder/dovecot-acl
chmod 0700 /var/vmail/public/.TestFolder/dovecot-acl chmod 0700 /var/vmail/public/.TestFolder/dovecot-acl
</code></pre> </code></pre>
<ul> <p>With shell command below, we grant <code>lookup</code> (l), <code>read</code> (r), <code>write</code> (w),
<li>With shell command below, we grant <code>lookup</code> (l), <code>read</code> (r), <code>write</code> (w), <code>insert</code> (i), <code>delete</code> (x) and <code>create sub-directory</code> (k) permissions to user
<code>insert</code> (i), <code>delete</code> (x) and <code>create sub-directory</code> (k) permissions to user <code>postmaster@test.com</code> (again, this user is hosted on same server):</p>
<code>postmaster@test.com</code> (again, this user is hosted on same server):</li>
</ul>
<pre><code>echo 'user=postmaster@test.com lrwixk' &gt;&gt; /var/vmail/public/.TestFolder/dovecot-acl <pre><code>echo 'user=postmaster@test.com lrwixk' &gt;&gt; /var/vmail/public/.TestFolder/dovecot-acl
</code></pre> </code></pre>
<ul> <p>With shell command below, we grant all users <code>lookup</code> (l) and <code>read</code> (r)
<li>With shell command below, we grant all users <code>lookup</code> (l) and <code>read</code> (r) permissions:</p>
permissions:</li> <div class="admonition note">
</ul> <p class="admonition-title">Reminder</p>
<blockquote> <p>It requires Dovecot setting <code>acl_anyone = allow</code> in <code>dovecot.conf</code>.</p>
<p>Note: it requires setting <code>acl_anyone = allow</code> in Dovecot config file.</p> </div>
</blockquote>
<pre><code>echo 'anyone lr' &gt;&gt; /var/vmail/public/.TestFolder/dovecot-acl <pre><code>echo 'anyone lr' &gt;&gt; /var/vmail/public/.TestFolder/dovecot-acl
</code></pre> </code></pre>