Custom Filters

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
jefft@iri.columbia.edu
Advanced member
Advanced member
Posts: 62
Joined: Fri Sep 12, 2014 10:41 pm
Location: Palisades, NY
ZCS/ZD Version: Release 8.7.1_GA_1670.RHEL6_64_2016
Contact:

Custom Filters

Postby jefft@iri.columbia.edu » Mon Oct 08, 2007 2:42 pm

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


JoshuaPrismon
Outstanding Member
Outstanding Member
Posts: 458
Joined: Fri Sep 12, 2014 9:59 pm

Custom Filters

Postby JoshuaPrismon » Mon Oct 08, 2007 4:05 pm

[quote user="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[/QUOTE]
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.
mmorse
Ambassador
Ambassador
Posts: 6036
Joined: Fri Sep 12, 2014 10:24 pm

Custom Filters

Postby mmorse » Mon Oct 08, 2007 4:11 pm

sieve - you can even convert from procmail:/forums/users/7239-any-way-add-message-filters-command-line.html
very">http://www.zimbra.com/forums/users/7239-any-way-add-message-filters-command-line.html>/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
jefft@iri.columbia.edu
Advanced member
Advanced member
Posts: 62
Joined: Fri Sep 12, 2014 10:41 pm
Location: Palisades, NY
ZCS/ZD Version: Release 8.7.1_GA_1670.RHEL6_64_2016
Contact:

Custom Filters

Postby jefft@iri.columbia.edu » Wed Oct 10, 2007 12:11 pm

[quote user="mmorse"]sieve - you can even convert from procmail:/forums/users/7239-any-way-add-message-filters-command-line.html
very">http://www.zimbra.com/forums/users/7239-any-way-add-message-filters-command-line.html>/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[/QUOTE]

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.
jefft@iri.columbia.edu
Advanced member
Advanced member
Posts: 62
Joined: Fri Sep 12, 2014 10:41 pm
Location: Palisades, NY
ZCS/ZD Version: Release 8.7.1_GA_1670.RHEL6_64_2016
Contact:

Custom Filters

Postby jefft@iri.columbia.edu » Fri Dec 14, 2007 12:09 pm

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
phoenix
Ambassador
Ambassador
Posts: 26621
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Custom Filters

Postby phoenix » Fri Dec 14, 2007 12:58 pm

[quote user="jefft@iri.columbia.edu"]Also, my last question was never addressed as to which rules take precedence: the zmmailbox filters or the zimbraMailSieveScript ?[/QUOTE]They are the same thing, zmmailbox is just a tool for creating the filters for a mailbox.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
jefft@iri.columbia.edu
Advanced member
Advanced member
Posts: 62
Joined: Fri Sep 12, 2014 10:41 pm
Location: Palisades, NY
ZCS/ZD Version: Release 8.7.1_GA_1670.RHEL6_64_2016
Contact:

Custom Filters

Postby jefft@iri.columbia.edu » Fri Dec 14, 2007 2:25 pm

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?
phoenix
Ambassador
Ambassador
Posts: 26621
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Custom Filters

Postby phoenix » Fri Dec 14, 2007 2:57 pm

[quote user="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"];[/QUOTE]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 user="jefft@iri.columbia.edu"]If I use the zimbraMailSieveScript, will it overwrite all my rules?[/QUOTE]With zmprov, yes it will.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
jefft@iri.columbia.edu
Advanced member
Advanced member
Posts: 62
Joined: Fri Sep 12, 2014 10:41 pm
Location: Palisades, NY
ZCS/ZD Version: Release 8.7.1_GA_1670.RHEL6_64_2016
Contact:

Custom Filters

Postby jefft@iri.columbia.edu » Fri Dec 14, 2007 3:04 pm

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?
1230zaf
Advanced member
Advanced member
Posts: 69
Joined: Fri Sep 12, 2014 10:03 pm

Custom Filters

Postby 1230zaf » Wed Oct 21, 2009 4:16 pm

[quote user="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?[/QUOTE]
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?

Return to “Administrators”

Who is online

Users browsing this forum: No registered users and 17 guests