The right way to do this is probably through zmmailbox:
Code:
zmmailbox -z -m f@test.test addFilterRule "tag special" active any header "subject" contains "special" tag "special" stop
If you still want to work through zmprov, note that you need a blank line before and after all the filter definitions. To start with, this works for me:
Code:
zmprov modifyAccount f@test.test zimbraMailSieveScript 'require ["fileinto", "reject", "tag", "flag"];
# tag special
if anyof (header :contains "subject" "special" )
{
tag "special";
stop;
}
' That's not especially automated, though, but this perl script does the same thing. The important thing is the single quotes around the $s in the zmprov command.
Code:
#!/usr/bin/perl
$s='require ["fileinto", "reject", "tag", "flag"];
# tag special
if anyof (header :contains "subject" "special" )
{
tag "special";
stop;
}
';
$c="zmprov modifyAccount f\@test.test zimbraMailSieveScript '$s'";
system($c); This is all on Release 4.5.6_GA_1024.RHEL4_20070627170556 RHEL4 NETWORK edition, and the filter matches and tags messages appropriately.