permissions when moving mails

Alexander 'Leo' Bergolth leo at strike.wu.ac.at
Wed Oct 15 08:14:44 UTC 2014


Hi!

I am using Unix groups to control access to shared mailboxes.

This works fine as long as files are not moved between mailboxes that
are owned by different groups. The move operation doesn't change group
ownership of the mail.

Is there a way to force dovecot to e.g. inherit the ownership from the
parent folder, not only for new messages bot also for messages moved
from one folder to another?

The wiki says:
http://wiki2.dovecot.org/SharedMailboxes/Permissions
-------------------- 8< --------------------
When mails are copied between Maildirs, it's usually done by hard
linking. If the source and destination directory permissions are
different, Dovecot create a new file and copies data the slow way so
that it can assign the wanted destination permissions. The source and
destination permission lookups are done only by looking at the mailbox
root directories' permissions, not individual mail files. This may
become a problem if the mail files' permissions aren't as Dovecot expects.
-------------------- 8< --------------------

Does dovecot only look at the permissions or does it also take
user/group ownership into account? The behavior I experience is that
even though the mailbox directories are owned by different groups,
dovecot doesn't copy the mails. (See my example below.)

Setting maildir_copy_with_hardlinks = no seems to fix the problem but
maybe this behavior should be considered as a bug?

I am using dovecot 2.2.14 and maildir mailboxes.

Cheers,
--leo

P.S.: Here is an example of the current behavior:

before the move from PAS to GSD:
-------------------- 8< --------------------
GSD/.Eingang/cur/:
total 0
drwxrws--- 2 nobody gsd  6 Oct 13 13:46 .
drwxrws--- 5 nobody gsd 81 Oct 15 09:41 ..

PAS/.Eingang/cur/:
total 4
drwxrws--- 2 nobody pas   89 Oct 15 09:39 .
drwxrws--- 5 nobody pas   79 Oct 15 09:39 ..
-rw-rw-r-- 1 nobody pas 4073 Jul  8 08:14
1404967500.M656935P20690.samba.intern.rk-klosterneuburg.at,S=4073,W=4213:2,S
-------------------- 8< --------------------

after the move:
-------------------- 8< --------------------
GSD/.Eingang/cur/:
total 4
drwxrws--- 2 nobody gsd   87 Oct 15 09:42 .
drwxrws--- 5 nobody gsd   81 Oct 15 09:42 ..
-rw-rw-r-- 1 nobody pas 4073 Jul  8 08:14
1413358925.M22574P3008.samba.intern.rk-klosterneuburg.at,S=4073,W=4213:2,S

PAS/.Eingang/cur/:
total 0
drwxrws--- 2 nobody pas  6 Oct 15 09:42 .
drwxrws--- 5 nobody pas 79 Oct 15 09:42 ..
-------------------- 8< --------------------

Mailbox directories are:
-------------------- 8< --------------------
drwxrws---  4 nobody pas  143 Nov 25  2013 PAS
drwxrws---  5 nobody pas   79 Oct 15 09:57 PAS/.Eingang
drwxrws--- 10 nobody gsd 4096 Dec 11  2013 GSD
drwxrws---  5 nobody gsd   81 Oct 15 09:42 GSD/.Eingang
-------------------- 8< --------------------

(In my own litte world, the mail should now be owned by the gsd group.. :-))

-- 
e-mail   ::: Leo.Bergolth (at) wu.ac.at
fax      ::: +43-1-31336-906050
location ::: IT-Services | Vienna University of Economics | Austria



More information about the dovecot mailing list