Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Users

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #21 (permalink)  
Old 07-18-2007, 09:08 AM
Member
 
Posts: 14
Default

One more (general) question:

Is there documentation somewhere that explains exactly what portion of Sieve the ZWC currently supports? I'm running into lots of errors that are related to particular directives from Cyrus/INGO that do not appear to work in the Zimbra web client. If I knew exactly what was supported and what was not, I could throw out filter rules that wouldn't import properly and still be able to get some stuff migrated.
Reply With Quote
  #22 (permalink)  
Old 07-24-2007, 11:41 AM
Zimbra Employee
 
Posts: 515
Default

Quote:
>Does this mean that if I import a filter using zmprov that contains a (for example) :comparator directive, the filter will work but won't show up in the ZWC GUI?
>
That's the way it looks to me. I didn't get any errors in the web client, but the filters rules UI was definitely displaying the rules wrong. It's possible that using the UI to add or edit rules will corrupt these rules.

Quote:
>Is there documentation somewhere
ZCS uses jsieve, which seems pretty complete. There is a zimbra mail filtering doc but it doesn't cover everything jsieve can do.
__________________
Search the Forums - Bugzilla - Wiki - Downloads
Reply With Quote
  #23 (permalink)  
Old 08-13-2007, 08:50 AM
Project Contributor
 
Posts: 47
Default

I've gotten the examples to work to add a filter however, what would I need to do to add an 'additional' filter (for example, if the user alrady had a filter or folters)? Would I need to find their current filters, build a new 'zimbraMailSieveScript' description, and then apply both the old and the new for each account? Or is there an easier was to use 'zmprov' to batch add a filter in addition to any filters the user might already have?
Thanks,
Jim...
__________________
Jim...
Reply With Quote
  #24 (permalink)  
Old 08-14-2007, 04:26 PM
Zimbra Employee
 
Posts: 515
Default

use zmmailbox addFilterRule
__________________
Search the Forums - Bugzilla - Wiki - Downloads
Reply With Quote
  #25 (permalink)  
Old 10-21-2009, 08:32 AM
Junior Member
 
Posts: 7
Default

I'd like to give my contribution to this discussion.

We've recently migrated from Postfix+Dovecot to Zimbra and we had the same issue with filter rules.

We had this kind of input:

Code:
#### machinename ##### 
if address :is "From" "root@machinename.domain.tld" { 
  # CRON 
  if header :contains ["Subject"] ["Cron <root@machinename.domain.tld>"] { 
    fileinto "INBOX.machinename.cron"; 
    stop; 
  } 
  # LOGWATCH 
  if header :contains ["Subject"] ["Logwatch for"] { 
    fileinto "INBOX.machinename.logwatch"; 
    stop; 
  } 
  # CATCHALL 
  fileinto "INBOX.machinename"; 
  stop; 
} 
##################
So we solved the situation with this perl script:
Code:
#!/usr/bin/perl -w

use warnings;
use strict;

open(FILE,"dovecot.sieve") || die ('unable to read rules');
my @line=<FILE>;
close(FILE);

my @rule;
my $index=0;

foreach my $val (@line) {
        next if $val =~ m/^$/;
        if ($val =~ m/#### (.*) #####/) {
                $rule[$index]{machine} = $1;  
        }
        if ($val =~ m/if header :contains \["Subject"\] \["Cron <(.*@.*)>"\]/) {
                $rule[$index]{cron} = $1; 
        }
        if ($val =~ m/##################/) {
                $index++;
        }
}

for my $i ( 0 .. $#rule ) { 

                my $machine=$rule[$i]{machine};
                my $mailcron=$rule[$i]{cron};

                print "zmmailbox -a admin -p accountpass -m accountname afrl $machine.cron header \"Subject\" contains \"Cron <root\@$machine>\" fileinto /Inbox/$machine.cron\n";
                print "zmmailbox -a admin -p accountpass -m accountname afrl $machine.logwatch header  \"Subject\" contains \"Logwatch for\" fileinto /Inbox/$machine.logwatch\n";
                print "zmmailbox -a admin -p accountpass -m accountname afrl $machine.catchall header \"From\" contains \"root\@$machine.hermess.it\" fileinto /Inbox/$machine\n";
}
A little bit...raw, but it works!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.