[Dovecot] A little assistance with Sieve
With all the mess that my email has become, it makes sense for me to try to make use of Sieve, but I'm having quite the time finding out how to make it work. I'm running 1.0.13 on a Debian machine. Sieve appears to be compiled with it. I can access managesieve, and I have set up dovecot.conf with lda. I do not get a NO response when I PUTSCRIPI, but LISTSCRIPTS produces no result, so I assume it's not working properly, though if I try with a non-existent script I get an error message.
Questions:
- Is anyone else seeing this, or am I doing something wrong?
- I have seen through Googling some dovecot.conf examples that suggest I should be using managesieve instead of lda (or in addition? - it's not clear), as in protocol managesieve { ...
Any advice will be gratefully received.
Thank you
Cam
-- Cam Ellison, PhD RPsych (BC #01417) Cam Ellison & Associates Ltd. 3446 Beach Avenue Roberts Creek BC V0N 2W2 Phone 604.885.4806 Fax 694.885.4809 Cell 604.989.0635
cam@ellisonpsychology.ca wrote:
With all the mess that my email has become, it makes sense for me to try to make use of Sieve, but I'm having quite the time finding out how to make it work. I'm running 1.0.13 on a Debian machine. Sieve appears to be compiled with it. I can access managesieve, and I have set up dovecot.conf with lda. I do not get a NO response when I PUTSCRIPI, but LISTSCRIPTS produces no result, so I assume it's not working properly, though if I try with a non-existent script I get an error message.
Questions:
- Is anyone else seeing this, or am I doing something wrong?
- I have seen through Googling some dovecot.conf examples that suggest I should be using managesieve instead of lda (or in addition? - it's not clear), as in protocol managesieve { ...
First of all, could you provide us with the output of 'dovecot -n' and, since you are talking ManageSieve manually to the server already, a listing of a protocol session (i.e. commands and responses)? And, if you enable mail_debug for the managesieve protocol, you will get messages in your logfile indicating where the sieve storage directory is located. This gives you the ability to check whether the scripts are actually stored as expected.
About the relation with lda: the 'protocol managesieve' section is for the managesieve server and the 'protocol lda' section is for Dovecot's 'deliver' LDA. Deliver is what actually executes the Sieve script (using the Sieve plugin) and delivers the message accordingly. So, managesieve does not substitude the lda; it is run in addition to it.
Recently, I've started to write a wiki page for the managesieve daemon:
http://wiki.dovecot.org/ManageSieve
That should provide enough information for the configuration of the managesieve daemon, so you might be able to find the cause of your problem there already. The dovecot configuration example (which is installed as the default configuration in Debian) also contains some configuration documentation regarding managesieve.
Regards,
Stephan.
First of all, could you provide us with the output of 'dovecot -n' and, since you are talking ManageSieve manually to the server already, a listing of a protocol session (i.e. commands and responses)? And, if you enable mail_debug for the managesieve protocol, you will get messages in your logfile indicating where the sieve storage directory is located. This gives you the ability to check whether the scripts are actually stored as expected. Output of dovecot -n: # 1.0.13: /etc/dovecot/dovecot.conf log_path(default): /var/log/dovecot/imaplog log_path(imap): /var/log/dovecot/imaplog log_path(managesieve): /var/log/dovecot/managesievelog info_log_path(default): /var/log/dovecot/imaplog info_log_path(imap): /var/log/dovecot/imaplog info_log_path(managesieve): /var/log/dovecot/managesievelog protocols: imap imaps managesieve listen(default): * listen(imap): * listen(managesieve): *:2000 ssl_listen(default): * ssl_listen(imap): * ssl_listen(managesieve): ssl_ca_file: /etc/openvpn/rsa/keys/ca.crt ssl_cert_file: /etc/ssl/certs/server.crt ssl_key_file: /etc/ssl/certs/server.key login_dir: /var/run/dovecot/login login_executable(default): /usr/lib/dovecot/imap-login login_executable(imap): /usr/lib/dovecot/imap-login login_executable(managesieve): /usr/lib/dovecot/managesieve-login mail_access_groups: mail Debian-exim default_mail_env: maildir:/var/mail/%u/Maildir mail_location: maildir:/var/mail/%u/Maildir mail_debug: yes mail_executable(default): /usr/lib/dovecot/rawlog /usr/lib/dovecot/imap mail_executable(imap): /usr/lib/dovecot/rawlog /usr/lib/dovecot/imap mail_executable(managesieve): /usr/lib/dovecot/managesieve mail_plugin_dir(default): /usr/lib/dovecot/modules/imap mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve sieve_storage(default): sieve_storage(imap): sieve_storage(managesieve): ~/sieve sieve(default): sieve(imap): sieve(managesieve): ~/.dovecot.sieve auth default: debug: yes passdb: driver: pam userdb: driver: passwd
About the relation with lda: the 'protocol managesieve' section is for the managesieve server and the 'protocol lda' section is for Dovecot's 'deliver' LDA. Deliver is what actually executes the Sieve script (using the Sieve plugin) and delivers the message accordingly. So, managesieve does not substitude the lda; it is run in addition to it.
OK. I've put that in.
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
BYE "Server shutting down." imap(root): Info: Server shutting down imap(root): Error: sieve-storage: o_stream_send_istream(/home/cam/sieve/tmp/.dovecot.sieve-1207578536.P26366Q0M617889.treehouse.sieve) failed: Success
I got it to shut down with Ctrl-C I do not understand the last message.
Recently, I've started to write a wiki page for the managesieve daemon:
That's where I went - very helpful indeed - and I copied what you have there almost verbatim.
Here are the relevant bits of dovecot.conf:
protocol imap { listen = * ssl_listen = * ssl_disable = no login_executable = /usr/lib/dovecot/imap-login mail_executable = /usr/lib/dovecot/rawlog /usr/lib/dovecot/imap mail_plugin_dir = /usr/lib/dovecot/modules/imap log_path = /var/log/dovecot/imaplog info_log_path = /var/log/dovecot/imaplog } protocol lda { postmaster_address = postmaster@ellisonpsychology.ca sieve_global_path = /var/mail/.global.sieve script_path = ~/.dovecot.sieve mail_plugin_dir = /usr/lib/dovecot/modules/lda mail_plugins = cmusieve mail_debug = yes log_path = /var/log/dovecot/deliverlog info_log_path = /var/log/dovecot/deliverlog
} protocol managesieve { listen = *:2000 login_executable = /usr/lib/dovecot/managesieve-login mail_executable = /usr/lib/dovecot/managesieve sieve = ~/.dovecot.sieve sieve_storage = ~/sieve mail_debug = yes log_path = /var/log/dovecot/managesievelog info_log_path = /var/log/dovecot/managesievelog }
Thank you very much for the help.
Cam
-- Cam Ellison, PhD RPsych (BC #01417) Cam Ellison & Associates Ltd. 3446 Beach Avenue Roberts Creek BC V0N 2W2 Phone 604.885.4806 Fax 694.885.4809 Cell 604.989.0635
There are no entries in any of the logs related to lda or managesieve.
I did run managesieve again (after creating the relevant logfiles), and got this:
OK "Logged in." LISTSCRIPTS imap(root): Warning: Active sieve script symlink /home/cam/.dovecot.sieve is no symlink. OK "Listscripts completed." LOGOUT imap(root): Info: Disconnected: Logged out OK "Logout completed."
I presume the warning is just that - only a warning - but it mystifies me.
Cheers
Cam
-- Cam Ellison, PhD RPsych (BC #01417) Cam Ellison & Associates Ltd. 3446 Beach Avenue Roberts Creek BC V0N 2W2 Phone 604.885.4806 Fax 694.885.4809 Cell 604.989.0635
(Forgot to CC to the mailinglist)
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
cam@ellisonpsychology.ca schreef: 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
participants (2)
-
cam@ellisonpsychology.ca
-
Stephan Bosch