Re: [Dovecot] A little assistance with Sieve
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.
OK. I understand all this. Thank you for the reference to the specification. Apart from the wrong name, I was using PUTSCRIPT instead of GETSCRIPT. Now, where do I have to put the scripts to GET them? My home directory does not work, nor do the /var/mail/user/ and /var/mail/user/Maildir directories. I get a "Script does not exist" response, though the script is in all three locations.
Thank you for all the assistance
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 schreef:
OK. I understand all this. Thank you for the reference to the specification. Apart from the wrong name, I was using PUTSCRIPT instead of GETSCRIPT. Now, where do I have to put the scripts to GET them? My home directory does not work, nor do the /var/mail/user/ and /var/mail/user/Maildir directories. I get a "Script does not exist" response, though the script is in all three locations.
According to one of your previous messages you have specified the following in the config.
sieve_storage = ~/sieve
That means that your script files are inside your home directory in a subdirectory called 'sieve'. All scripts must have an extension '.sieve'. Meaning that if you put a script called 'ingo' on your server through ManageSieve, it is stored in that directory as 'ingo.sieve'. If you place a script called 'existing.sieve' inside that directory it will be listed in LISTSCRIPTS as 'existing'. If GETSCRIPT cannot find the script, try LISTSCRIPTS to find out which scripts are actually known by the server.
Regards,
Stephan.
sieve_storage = ~/sieve
That means that your script files are inside your home directory in a subdirectory called 'sieve'. All scripts must have an extension '.sieve'. Meaning that if you put a script called 'ingo' on your server through ManageSieve, it is stored in that directory as 'ingo.sieve'. If you place a script called 'existing.sieve' inside that directory it will be listed in LISTSCRIPTS as 'existing'. If GETSCRIPT cannot find the script, try LISTSCRIPTS to find out which scripts are actually known by the server.
Aha! Should have seen this, I suppose. Yes, that works. Now I can go back to the original problem.
Thank you, once again
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
Unfortunately, this does not seem to be over, yet. I have a script in the right place now, it is set as Active, but it does not seem to be doing anything. That is, everything is still going to the INBOX instead of to the designated directories, and there are no entries in the log files. I am using subdirectories, and am showing them as "xxxx.yyyy" - maildir format. Is this correct?
Is there something I should have in dovecot.conf in either imap or lda that links to the script?
I shall continue to search, but a hint or two would help.
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
On Mon, 7 Apr 2008, cam@ellisonpsychology.ca wrote:
Unfortunately, this does not seem to be over, yet. I have a script in the right place now, it is set as Active, but it does not seem to be doing anything. That is, everything is still going to the INBOX instead of to the designated directories, and there are no entries in the log files. I am using subdirectories, and am showing them as "xxxx.yyyy" - maildir format. Is this correct?
Is there something I should have in dovecot.conf in either imap or lda that links to the script?
I shall continue to search, but a hint or two would help.
I'm reentering this conversation a little late - but how are you delivering mail? Via the Dovecot LDA (in which case Sieve should be used)? Or directly via e.g. procmail (in which case Sieve never gets a chance to be run)?
-- Asheesh.
-- Truth is hard to find and harder to obscure.
I'm reentering this conversation a little late - but how are you delivering mail? Via the Dovecot LDA (in which case Sieve should be used)? Or directly via e.g. procmail (in which case Sieve never gets a chance to be run)?
I have Exim, which does its usual thing, and the LDA is Dovecot (IMAPS). Up to this point, I have used Thunderbird/Icedove as the MUA, but there have been problems, as we have discussed already (not solved yet). I do the road warrior thing from time to time, so have been using Squirrelmail on the laptop (also now on the desktop, because it's the only thing that I can send on).
When I try to set lda as a protocol, that is:
protocols = imaps managesieve lda
I get an error message: Restarting IMAP/POP3 mail server: dovecotFatal: Unknown protocol lda failed!
Either one is not supposed to do that, or there's something wrong with how I have lda set up:
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 }
Managesieve sets up the symlink for ~/.dovecot.sieve OK. However, nothing is in the logs, and there's nothing in /sieve/tmp.
Of course, the problem may lie elsewhere. but this seems to me the place to start.
Thanks
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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mon, 7 Apr 2008, cam@ellisonpsychology.ca wrote:
I have Exim, which does its usual thing, and the LDA is Dovecot (IMAPS).
Dovecot does not support LMTP, hence, Dovecot IMAPS cannot be your LDA.
An LDA is a program the MTA is calling to locally deliver mail. Which is "deliver" with Dovecot. Have you read and understood http://wiki.dovecot.org/LDA/Exim already?
protocols = imaps managesieve lda
"lda" is no protocol, but an acrynom in the chain of MTA and MSA, hence, remove it here and read the Wiki to enable the Dovecot LDA in exim.
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFH/wuPVJMDrex4hCIRAoB3AJ9d2z5d703wZNCqLhs3NpLd5uo1lwCfZWMq uOKEUdP0d+w7OLyJzTUJSPA= =EgT/ -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mon, 7 Apr 2008, cam@ellisonpsychology.ca wrote:
I have Exim, which does its usual thing, and the LDA is Dovecot (IMAPS).
Dovecot does not support LMTP, hence, Dovecot IMAPS cannot be your LDA.
An LDA is a program the MTA is calling to locally deliver mail. Which is "deliver" with Dovecot. Have you read and understood http://wiki.dovecot.org/LDA/Exim already?
protocols = imaps managesieve lda
"lda" is no protocol, but an acrynom in the chain of MTA and MSA, hence, remove it here and read the Wiki to enable the Dovecot LDA in exim.
That was done long ago.
My setup does not look like the Wiki, but it has worked fine. In update-exim4.conf.conf, dc_local_delivery is set to 'dovecot', and I use both dovecot router and transport. I use appendfile instead of pipe as a driver, but otherwise it looks very similar. One of the reasons for not using a distinct router is to have a non-standard Mailbox location so that I can access my email from more than one machine.
This raises a question: does the fact that Dovecot itself is the LDA account for the fact that Sieve does not seem to work?
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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, 11 Apr 2008, cam@ellisonpsychology.ca wrote:
"lda" is no protocol, but an acrynom in the chain of MTA and MSA, hence, remove it here and read the Wiki to enable the Dovecot LDA in exim.
My setup does not look like the Wiki, but it has worked fine. In update-exim4.conf.conf, dc_local_delivery is set to 'dovecot', and I use both dovecot router and transport. I use appendfile instead of pipe as a driver, but otherwise it looks very similar. One of the reasons for not
I don't use exim, therefore I don't understand the exim-specific terms, therefore:
If you do not _spawn_ Dovecot's deliver programm (aka the LDA), you cannot use Dovecot's Sieve feature.
The term "appendfile" lets me guess that exim spools the mail into the mailbox, hence, exim is your LDA.
This raises a question: does the fact that Dovecot itself is the LDA account for the fact that Sieve does not seem to work?
What's a "LDA account"?
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFIBKNdVJMDrex4hCIRAl2EAKCJicGqq/t3wu9wVFVcYzQk2ftYhACfRQZR 3Fb4cqb+80pNROnNvhRdsKI= =puhQ -----END PGP SIGNATURE-----
participants (4)
-
Asheesh Laroia
-
cam@ellisonpsychology.ca
-
Steffen Kaiser
-
Stephan Bosch