[Dovecot] A little assistance with Sieve

Stephan Bosch stephan at rename-it.nl
Mon Apr 7 23:03:06 EEST 2008


(Forgot to CC to the mailinglist)

cam at ellisonpsychology.ca schreef:
> Here's the latest managesieve session:
> OK "Logged in."
> CAPABILITY
> "IMPLEMENTATION" "dovecot"
> "SIEVE" "fileinto reject envelope vacation imapflags notify subaddress
> relational comparator-i;ascii-numeric regex"
> OK "Capability completed."
> PUTSCRIPT ".dovecot.sieve" {2049+}
> LOGOUT
 From what I see here I am not quite sure whether you have understood 
the ManageSieve protocol. The putscript command as specified above 
expects you to provide 2049 bytes of script directly after entering the 
command. It will not accept other commands until it has fully read the 
2049 bytes. (Refer to the specification 
http://tools.ietf.org/id/draft-martin-managesieve-08.txt). The listing 
above shows no script and a logout command in stead. You indicate that 
you have to cancel the connection using Ctrl-C which is consistent with 
that behavior.

The following similar protocol session should show how it is done with a 
trivially small script:

OK "Logged in."
CAPABILITY
"IMPLEMENTATION" "dovecot"
"SIEVE" "comparator-i;ascii-numeric fileinto reject vacation imapflags 
notify include envelope body relational regex subaddress copy"
OK "Capability completed."
PUTSCRIPT "hotseflots" {6+}
keep;
OK "Putscript completed."
GETSCRIPT "hotseflots"
{6}
keep;
OK "Getscript completed.
SETACTIVE "hotseflots"
OK "Setactive completed."
LISTSCRIPTS
"phpscript"
"hotseflots" ACTIVE
"frop"
"ingo"
"fruts"
OK "Listscripts completed."

BTW, it is  not useful to upload a script called .dovecot.sieve on the 
server. For managesieve, the .dovecot.sieve script (as looked for by the 
Sieve plugin) is a symbolic link that points to the actual active script 
in the sieve storage directory. That also explains the warning in your 
follow-up e-mail, indicating that a normal file is still in place. When 
you upload and activate a new script, the situation is resolved. The 
regular file previously called .dovecot.sieve is moved to the sieve 
directory as dovecot-orig.sieve (and listed as dovecot-orig). However, 
if you consider your current sieve script to be important you are 
advised to back it up before uploading and activating a script through 
managesieve.

I hope this solves your issue.

Regards,

Stephan



More information about the dovecot mailing list