| 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.
|  | | 
10-08-2007, 12:42 PM
| | | 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 | 
10-08-2007, 02:05 PM
| | Zimlet Guru & Moderator | |
Posts: 467
| | Quote:
Originally Posted by jefft@iri.columbia.edu 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. | 
10-08-2007, 02:11 PM
| | | 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..
| 
10-10-2007, 10:11 AM
| | | Quote:
Originally Posted by mmorse 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. | 
12-14-2007, 10:09 AM
| | | 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.
| 
12-14-2007, 10:58 AM
| | Zimbra Consultant & Moderator | |
Posts: 20,312
| | Quote:
Originally Posted by jefft@iri.columbia.edu 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
| 
12-14-2007, 12:25 PM
| | | 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.
| 
12-14-2007, 12:57 PM
| | Zimbra Consultant & Moderator | |
Posts: 20,312
| | Quote:
Originally Posted by jefft@iri.columbia.edu 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 If I use the zimbraMailSieveScript, will it overwrite all my rules? | With zmprov, yes it will.
__________________
Regards
Bill
| 
12-14-2007, 01:04 PM
| | | 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.
| 
10-21-2009, 02:16 PM
| | Partner (VAR/HSP) | |
Posts: 80
| | Quote:
Originally Posted by jefft@iri.columbia.edu 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? | | Thread Tools | Search this Thread | | | | | Display Modes | Linear Mode | | Why Join? Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.  |