Roundcube Community Forum

 

Sieverules (managesieve) plugin

Started by zoc, May 09, 2009, 05:35:25 AM

Previous topic - Next topic

Schmatze

Mh ... no it doesn't work :(

I added
  sieve_global_dir = /etc/dovecot/sieve/
  sieve_global_path = /etc/dovecot/sieve/example.sieve
  sieve_before = /etc/dovecot/sieve/example.sieve

under plugin {

and restartetd dovecot. Nothing changed. Maybe it doesn't work with debians 1.0 dovecot? But userdefined rules work.

dziobak

yes, it doesn't work with 1.0... the newest version of dovecot is dovecot-1.2.10, so in your place I would think about an update...


Rando

#213
Hi John,
thank you for this quick update.
the generated code worked fine with dovecot-1.2 and dovecot-sieve-0.1.15
date, time and weekday. tested with vacation, copy, reject, ..

---

an error occured when creating a new filter : (rc 0.4b, last sieverules version)
matching all (or any) of the rules
1st rule : subject, contains, any content
2nd rule : Arrival date filter, weekday, any day
when saving, a pop-up said "Please enter a value to test the header against"

---

the default operators' list don't match for date and time, and only 2 do for weekday
here is the list of the main operators that could fit as a default list (and an alternate display name)
*date and time : (case-insensitive string)
"value is greater than" ("After")
"value is greater than or equal to" ("After (inclusive)")
"value is less than" ("Before")
"value is less than or equal to" ("Before (inclusive)")

*date and weekday :
"is equal to" ("is")
"is not equal to" ("is not")

cheers,
Rando.

edit: updated

JohnDoh

great, the validation bug is fixed in the repo. i'll see what i can do about the operators.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

kondybas

Quote from: Schmatze;27036Mh ... no it doesn't work :(

I added
  sieve_global_dir = /etc/dovecot/sieve/
  sieve_global_path = /etc/dovecot/sieve/example.sieve
  sieve_before = /etc/dovecot/sieve/example.sieve

under plugin {

and restartetd dovecot. Nothing changed. Maybe it doesn't work with debians 1.0 dovecot? But userdefined rules work.

See Dovecot manual for sieve: LDA/Sieve/Dovecot - Dovecot Wiki

It says literally:

"...The extra scripts can be executed before and after the user's private script. For example, this allows executing global Sieve policies before the user's script. This is not possible using the sieve_global_path  setting, because that is only used when the user's private script does not exist..."

Default "global sieve" executed ONLY if user's sieve is absent. If user's sieve exists, global sieve ignored.


If you want sequentially execute multiple sieves, you need
sieve_before=/a/b/before/before.sieve
and
sieve_after=/a/b/after/after.sieve

If you need more than one sieve in before an after phases, just omit filenames in config:
sieve_before=/a/b/before/
sieve_after=/a/b/after/

Then ALL scripts in dirs will be executed if alphabetical order.

pixilla

If you create a mailbox, say "Spam" for example, and create a rule with "Filter Actions: Move message to Spam" and then remove the mailbox and review the sieve rule, "Filter Actions: Move message to" will display the first mailbox in the list ("Inbox" in my case) as the move to target while the sieve rule source still has "Spam" as the target.

I am checking this out to find if dovecot/sieve-plugin automatically creates Mailboxes as needed.

JohnDoh

yep, thats meant to be like that, if the folder doesnt exist then it wont be listed and so cant be selected by default.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

pixilla

It's misleading. The script moves to "Spam" which does not exist. Only the visual representation of the script says "Inbox".

Reproduce:
1. Make folder "DeleteMe"
2. Make rule moving to "DeleteMe"
3. Delete folder "DeleteMe"
4. Rule shows move to "Inbox"
5. Looking at source code for sieve rule says move to "DeleteMe" not "Inbox"

So you are mislead without looking at source.

JohnDoh

I do not belive it is misleading, if a folder doesn't exist then normally the message will stay in the inbox (there is no where for it to go).
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

pixilla

Sorry for the letting so much time lapse.

Quote from: JohnDoh;27686I do not belive it is misleading, if a folder doesn't exist then normally the message will stay in the inbox (there is no where for it to go).

On my dovecot system this is not what I observe. Using my example if the mailbox DeleteMe does not exist it is created and the rule delivers into DeleteMe.

JohnDoh

I tried it again and you're right, it does create the folder, not sure what I was doing different before, sorry about that. Unfortantly the fact still remains the plugin uses the folder list from the server so if the folder doesn't exist it cant be listed, its a limitation of the way it works.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

pixilla

I'm sure this is a rare thing but I could see someone deleting a folder and getting frustrated that it keeps coming back, checking the rules shows no rule referencing deleted folder.

Since the interface to the rules has the folder selected if it exists, the RC SieveRules plugin has the folder name parsed from the script in a var. Check if that var is in the folder list array and if not append it to the end of the array and possibly add "missing" like "DeleteMe (missing)" in the folder list, under or to the right in bold red. DeleteMe is the folder name I've been using in my examples.

Sorry, I don't know if I can follow my own message :) but no time to rewrite.

Thanks,
Brad

JohnDoh

If the missing folder is manually added to the list then you'll get questions like "where has this folder come from?" "why can't I see this folder in my list?" and "how come the DeleteMe folder is only available for one rule?".

Possibly there should also be a new config option because the RCF says:  
QuoteIf the specified mailbox doesn't exist, the implementation MAY treat it as an error, create the mailbox, or deliver the message to an implementation-defined mailbox.
Then admins can select the behaviour appropriate for their setup.

The plugin already contains an "Advanced editor" which allows more experienced users to skip the limitations of the UI and manually create rule files. I understand your point about users being confused by folders re-appearing apparently for no reason but I think this is a very rare case and the user should of created the rule to put messages in that folder and hopefully when they see the folder and the message inside it then it will give their memory a little jog and they'll go and change the rule!
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

pixilla

I agree with your last paragraph. As a developer I am used to reporting possible errors and/or inconsistencies when I observe them. Weighing their impact is always part of way forward.

I wasn't clear enough in my previous post. I was suggesting adding the message to the list WITH an error message.

Either append "(does not exist)" to the select option label, or better, add to the right of select object "Error: This folder does not exist."

// Brad