Compound conditions in Sieve filters

Need help? Ask here.

Moderator: Moderators

Post Reply
pblair
Posts: 4
Joined: Mon Jul 11, 2022 8:37 am

Compound conditions in Sieve filters

Post by pblair »

I've experienced some anomalous behavior using the Sieve filters and I'm not sure what's going on. What I'd like to do is to have a rule that specifies a conjunction one branch of which is a disjunction. So for example

Code: Select all

if allof (header :contains "from" "meetup.com", anyof (header :contains "subject" "NYC.rb", header :contains "subject" "NYC Tech Meetup"))
{
	fileinto "Events.Tech";
	stop;
}
This appears to be accepted when I edit the script manually on the "Hosted Mail Box ManageSieve" page. However, if I open the sieve script in the webmail "Filters" editor, that editor does not appear to support these complex conditions, and if I do any editing using that editor my complex condition is removed.

Questions:
1) If I only edit the text of the script directly using the text editor on the "Hosted Mail Box ManageSieve" page, will a compound condition like the one I specified above work? I believe this is syntactically correct.

2) If #1 is legitimate syntax that works, is it a known issue with the webmail Filters editor that it will mangle complex sieve scripts?
Ari
Site Admin
Posts: 5
Joined: Tue Nov 26, 2013 5:05 pm
Contact:

Re: Compound conditions in Sieve filters

Post by Ari »

I created a filter using the same syntax and it appears to work fine. Seems like the visual editor in RoundCube just doesn't support nested syntax. However, if you need to edit in RoundCube, select the filter name but ignore the visual editor and instead click on "Actions" at the top of the filters column. Then click "Edit filter set". That will open the script version of your filters. It appears you can edit and save in the script version within RounCube and it keeps your conditions correct. Just don't use the visual editor on that rule.
Ari Knowles, Roller Network LLC
pblair
Posts: 4
Joined: Mon Jul 11, 2022 8:37 am

Re: Compound conditions in Sieve filters

Post by pblair »

Got it. That's essentially what I've been doing, though I've been editing the entire managesieve script from the "edit" link on the ManageSieve page. That puts all the rules on one page, which might be good in some contexts (I can copy/paste) and not so good in others (it's getting to be a pretty big file).

I'm actually not sure I see where you're accessing RoundCube - the only visual editor I'm aware of is accessible via the webmail, and from there I don't see an "actions" at the top of the column of filters.
Ari
Site Admin
Posts: 5
Joined: Tue Nov 26, 2013 5:05 pm
Contact:

Re: Compound conditions in Sieve filters

Post by Ari »

ManageSieve is under "Settings", "Filters" in RoundCube.
Ari Knowles, Roller Network LLC
Post Reply