[Dovecot] [PATCH] deliver tries to compile already compiled sieve script

Alexander Prinsier dovecot at aphexer.mailhaven.com
Tue Apr 1 12:50:12 EEST 2008


Hello,

I've solved it. The compiled sieve script had the same mtime as the
uncompiled script. Dovecot used "<" to see if compilation is needed. It
has to be "<=".

If you wonder why the mtime is the same, I write and compile the sieve
script right after each other automated. Apparently mtime doesn't have a
good resolution in time...

Patch to dovecot-sieve-1.1.4 is attached, can it be included?

Thanks,

Alexander

Alexander Prinsier wrote:
> I should have mentioned I'm running dovecot 1.1.rc3
> 
> Alexander
> 
> Alexander Prinsier wrote:
>> Hello,
>>
>> I'm trying to setup dovecot with sieve support in a way where all sieve
>> scripts are precompiled. All sieve scripts are in /var/cache/sieve/.
>>
>> I believe I discovered a bug here. I describe below how to reproduce it.
>>
>> Dovecot and the user that deliver runs as do not have write permission
>> in /var/cache/sieve/.
>>
>> h01:/var/cache/sieve# ls -la
>> total 16
>> drwxr-xr-x  2 ecp  ecp  4096 Mar 31 21:32 .
>> drwxr-xr-x 10 root root 4096 Mar 31 20:14 ..
>> -rw-r--r--  1 ecp  ecp    88 Mar 31 21:32 mailtest1 at domain.com.sieve
>> -rw-r--r--  1 ecp  ecp   132 Mar 31 21:32 mailtest1 at domain.com.sievec
>>
>> When deliver runs it logs this error:
>>
>> open(/var/cache/sieve/mailtest1 at domain.com.sievec.tmp) failed:
>> Permission denied
>>
>> This indicates deliver tries to compile the script, even though the
>> compiled version already is there.
>>
>> To verify I tested another case. I make the compiled script immutable
>> and I did a chmod 777 on /var/cache/sieve/. Then deliver logs this error:
>>
>> rename(/var/cache/sieve/mailtest1 at domain.com.sievec.tmp,
>> /var/cache/sieve/mailtest1 at domain.com.sievec) failed: Operation not
>> permitted
>>
>> And deliver created the file mailtest1 at domain.com.sievec.tmp.
>>
>> Some relevant pieces of my dovecot.conf:
>>
>> protocol lda {
>> 	mail_plugins = quota cmusieve
>> 	...
>> }
>>
>> plugin {
>> 	sieve = /var/cache/sieve/%u.sieve
>> }
>>
>> Anyone can help me? Is this an error on my end, or really a bug?
>>
>> Alexander
>>
> 
> 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sieve-compile-mtime.patch
Url: http://dovecot.org/pipermail/dovecot/attachments/20080401/dc137f51/attachment.pl 


More information about the dovecot mailing list