[Dovecot] managesieve does call a wrong chown

Wolfgang.Friebel at desy.de Wolfgang.Friebel at desy.de
Wed Jan 6 16:54:45 EET 2010


On Mon, 4 Jan 2010, Wolfgang.Friebel at desy.de wrote:

> After upgrading from dovecot 1.2.3, managesieve 0.11.8, sieve 0.1.11 to
> dovecot 1.2.9, managesieve 0.11.10 and sieve 0.1.14 users who do not have 
> sieve rules yet and use managesieve for the first time do trigger error 
> messages in the log file (for the authenticated user ggg in group syspr):
>
> Jan  4 17:35:26 apollo dovecot: MANAGESIEVE(ggg): chown(/var/spool/sieve/ggg, 
> -1, 0(root)) failed: Operation not permitted (egid=203(syspr))
> Jan  4 17:35:26 apollo dovecot: MANAGESIEVE(ggg): sieve-storage: 
> sieve_storage_verify_dir(/var/spool/sieve/ggg/tmp) failed: Operation not 
> permitted
> Jan  4 17:35:26 apollo dovecot: MANAGESIEVE(ggg): Fatal: Failed to create 
> sieve storage with data: /var/spool/sieve/ggg
>
replying to my own mail :-)

I did try to look into the code and see where this chown(dir, -1, 0) is 
coming from. It looks like the call is in mkdir_chown invoked in
dovecot-1.2-managesieve-0.11.10/src/lib-sievestorage/sieve-storage.c
line 249.

This piece of code is (if I understand it correctly) trying to set the 
group permissions according to the parent directory (assuming that the 
sieve storage is somewhere in the users home dir).

I did however choose to have a different dir layout, the sieve storage is 
under /var/spool/sieve/ which has permissions 1777 and is owned by 
root:root. Therefore the chown(dir, -1, 0) call is failing, as the parent 
dir does not belong to the group of the user but to root.

As the directory structure is nevertheless created (with the correct 
permissions), the next use of managesieve does no longer complain about 
wrong permissions and managesieve is correctly working.

Should I change my choice of sieve_dir as suggested in the wiki:

# Directory for :personal include scripts. The default is to use home directory.
sieve_dir = %h/sieve

or is my setting a correct alternative?

Best regards
-- 
Wolfgang Friebel                   Deutsches Elektronen-Synchrotron DESY
Phone/Fax:  +49 33762 77372/216    Platanenallee 6
Mail: Wolfgang.Friebel AT desy.de  D-15738 Zeuthen  Germany


More information about the dovecot mailing list