Ok, got it working, thanks. For anyone else trying to do this, here's a quick and dirty perl script that'll convert your procmail ^TO rules to sieve rules. Mind you, I hacked this quickly and it assumes some things about your .procmailrc AND the paths to your folders (for example, it assumes you have .folder style courier folders), so PLEASE check your results before running. I make not guarantees it'll work at all for you.
You essentially run it passing the path of your procmailrc as the first arg, zimbra account name as second arg, and then direct it's output to a file. Then, run this file as a shell script...
Hope it helps:
Code:
#!/usr/bin/perl
$file = $ARGV[0];
$acct = $ARGV[1];
sub output {
$list = shift;
$folder = shift;
print <<EOL
# $list
if anyof (header :contains "to" "$list" ,
header :contains "cc" "$list" )
{
fileinto "/$folder";
stop;
}
EOL
}
print "#!/bin/bash\nzmprov ma $acct zimbraMailSieveScript '\n";
print 'require ["fileinto", "reject", "tag", "flag"];' . "\n";
open(FH, $file) or die "Can't open $file\n";
$to = "";
$fo = "";
while (<FH>) {
$line = $_;
if ($line=~/\^TO_(.*)/) {
$to = $1;
$line = <FH>;
$fo = $1 if ($line=~/\.(.*)\/new/);
}
if ($fo && $to) {
output($to, $fo);
$to = "";
$fo = "";
}
}
print "'\n";