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

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
  #1 (permalink)  
Old 10-08-2007, 12:42 PM
Senior Member
 
Posts: 55
Default Custom Filters

Hello everyone,

I've searched a bit through the wiki, the forums, and the documentation and cannot find the answer. How do I implement custom email filters with more functionality than the web filter rules support.

For example, I used to have a procmail filter that I used to sort incoming mail by host. I could extract the host with a regexp, then file the email into the appropriate folder. Is there a command-line interface/API for the filtering mechanism? Is there a more powerful way to filter messages than the default web interface? Sieve, Procmail, anything?

Thanks,

Jeffrey Turmelle
IRI of Columbia University.
Zimbra Release 4.5.6_GA_1044.MACOSX
Reply With Quote
  #2 (permalink)  
Old 10-08-2007, 02:05 PM
Zimlet Guru & Moderator
 
Posts: 467
Default

Quote:
Originally Posted by jefft@iri.columbia.edu View Post
Hello everyone,

I've searched a bit through the wiki, the forums, and the documentation and cannot find the answer. How do I implement custom email filters with more functionality than the web filter rules support.

For example, I used to have a procmail filter that I used to sort incoming mail by host. I could extract the host with a regexp, then file the email into the appropriate folder. Is there a command-line interface/API for the filtering mechanism? Is there a more powerful way to filter messages than the default web interface? Sieve, Procmail, anything?

Thanks,

Jeffrey Turmelle
IRI of Columbia University.
Zimbra Release 4.5.6_GA_1044.MACOSX
Seive is the technology that underlies the mail filter rules. I don't know if it's possible to edit the Seive rules easily, but you might be able to create the rule with the Zimlet.
Reply With Quote
  #3 (permalink)  
Old 10-08-2007, 02:11 PM
Moderator
 
Posts: 6,237
Default

sieve - you can even convert from procmail:/forums/users/7239-any-way-add-message-filters-command-line.html

very simply it's kinda like:
zmprov modifyAccount user@domain.com zimbraMailSieveScript 'require ["fileinto", "reject", "tag", "flag"]

or there's always:
zmmailbox -z -m user@domain.com addFilterRule "tag special" active any header "subject" contains "special" tag "special" stop
-this should also add it into the user's list of rules to manage from the web interface

Last edited by mmorse; 10-08-2007 at 02:19 PM..
Reply With Quote
  #4 (permalink)  
Old 10-10-2007, 10:11 AM
Senior Member
 
Posts: 55
Default

Quote:
Originally Posted by mmorse View Post
sieve - you can even convert from procmail:/forums/users/7239-any-way-add-message-filters-command-line.html

very simply it's kinda like:
zmprov modifyAccount user@domain.com zimbraMailSieveScript 'require ["fileinto", "reject", "tag", "flag"]

or there's always:
zmmailbox -z -m user@domain.com addFilterRule "tag special" active any header "subject" contains "special" tag "special" stop
-this should also add it into the user's list of rules to manage from the web interface
Thanks, that's what I was looking for. I was able to add a rule through zmprov, but I ended up losing my next message that it would have matched. Where can I trace the filters? They don't seem to show up in /var/log/zimbra.log.

Also, which takes precedence, zmmailbox or zimbraMailSieveScript ?

Thanks again for your help on this.
Reply With Quote
  #5 (permalink)  
Old 12-14-2007, 10:09 AM
Senior Member
 
Posts: 55
Default Sieve Variables

As I learn zimbra more, I think I can ask better questions

I have learned a little about Sieve, and was wondering if Zimbra sieve supports the variables extension?

And even better - does anyone have any examples??

Also, my last question was never addressed as to which rules take precedence: the zmmailbox filters or the zimbraMailSieveScript ?

Thanks to anyone who can answer this!

Jeff
__________________
Jeffrey Turmelle
International Research Institute for Climate and Society
Earth Institute at Columbia University


Release 7.1.1_GA_3196.RHEL5_64_20110527001604 RHEL5_64 NETWORK edition.
Reply With Quote
  #6 (permalink)  
Old 12-14-2007, 10:58 AM
Zimbra Consultant & Moderator
 
Posts: 20,312
Default

Quote:
Originally Posted by jefft@iri.columbia.edu View Post
Also, my last question was never addressed as to which rules take precedence: the zmmailbox filters or the zimbraMailSieveScript ?
They are the same thing, zmmailbox is just a tool for creating the filters for a mailbox.
__________________
Regards


Bill
Reply With Quote
  #7 (permalink)  
Old 12-14-2007, 12:25 PM
Senior Member
 
Posts: 55
Default zimbraMailSieveScript

Why don't I see anything when I look at the zimbraMailSieveScript variable:
# zmprov ga xxxx@iri.columbia.edu | grep zimbraMailSieveScript
zimbraMailSieveScript: require ["fileinto", "reject", "tag", "flag"];

I can see all my filters using the command:
# zmmailbox -z -m xxxx@iri.columbia.edu gfrl

If I use the zimbraMailSieveScript, will it overwrite all my rules?
__________________
Jeffrey Turmelle
International Research Institute for Climate and Society
Earth Institute at Columbia University


Release 7.1.1_GA_3196.RHEL5_64_20110527001604 RHEL5_64 NETWORK edition.
Reply With Quote
  #8 (permalink)  
Old 12-14-2007, 12:57 PM
Zimbra Consultant & Moderator
 
Posts: 20,312
Default

Quote:
Originally Posted by jefft@iri.columbia.edu View Post
Why don't I see anything when I look at the zimbraMailSieveScript variable:
# zmprov ga xxxx@iri.columbia.edu | grep zimbraMailSieveScript
zimbraMailSieveScript: require ["fileinto", "reject", "tag", "flag"];
It's because that command will only search fro the line containing zimbraMailSieveScript Use that command without the grep to see all the filters.

Quote:
Originally Posted by jefft@iri.columbia.edu View Post
If I use the zimbraMailSieveScript, will it overwrite all my rules?
With zmprov, yes it will.
__________________
Regards


Bill
Reply With Quote
  #9 (permalink)  
Old 12-14-2007, 01:04 PM
Senior Member
 
Posts: 55
Lightbulb thanks

grep - duh! That makes a lot of sense

Thanks!

The only thing left that I want to know is if Zimbra supports the sieve variables extension?
__________________
Jeffrey Turmelle
International Research Institute for Climate and Society
Earth Institute at Columbia University


Release 7.1.1_GA_3196.RHEL5_64_20110527001604 RHEL5_64 NETWORK edition.
Reply With Quote
  #10 (permalink)  
Old 10-21-2009, 02:16 PM
zaf zaf is offline
Partner (VAR/HSP)
 
Posts: 80
Default

Quote:
Originally Posted by jefft@iri.columbia.edu View Post
grep - duh! That makes a lot of sense

Thanks!

The only thing left that I want to know is if Zimbra supports the sieve variables extension?
I know this is an extremely old thread, but I'm needing to know the same thing. I need to make a sieve script that will take a string from the subject of an email and throw that into a part of the To: field for a redirect. Anybody know?
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.