Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Custom Filters

  1. #1
    jefft@iri.columbia.edu is offline Senior Member
    Join Date
    Aug 2007
    Location
    New York
    Posts
    56
    Rep Power
    7

    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

  2. #2
    JoshuaPrismon is offline Zimlet Guru & Moderator
    Join Date
    Nov 2005
    Posts
    477
    Rep Power
    9

    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.

  3. #3
    mmorse's Avatar
    mmorse is offline Moderator
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    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.

  4. #4
    jefft@iri.columbia.edu is offline Senior Member
    Join Date
    Aug 2007
    Location
    New York
    Posts
    56
    Rep Power
    7

    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.

  5. #5
    jefft@iri.columbia.edu is offline Senior Member
    Join Date
    Aug 2007
    Location
    New York
    Posts
    56
    Rep Power
    7

    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.2.4_GA_2900.RHEL5_64_20130523110956 RHEL5_64 NETWORK edition.

  6. #6
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,480
    Rep Power
    56

    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


    Acompli: A new adventure for Co-Founder KevinH.

  7. #7
    jefft@iri.columbia.edu is offline Senior Member
    Join Date
    Aug 2007
    Location
    New York
    Posts
    56
    Rep Power
    7

    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.2.4_GA_2900.RHEL5_64_20130523110956 RHEL5_64 NETWORK edition.

  8. #8
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,480
    Rep Power
    56

    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


    Acompli: A new adventure for Co-Founder KevinH.

  9. #9
    jefft@iri.columbia.edu is offline Senior Member
    Join Date
    Aug 2007
    Location
    New York
    Posts
    56
    Rep Power
    7

    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.2.4_GA_2900.RHEL5_64_20130523110956 RHEL5_64 NETWORK edition.

  10. #10
    zaf
    zaf is offline Partner (VAR/HSP)
    Join Date
    Jan 2006
    Location
    Lafayette, LA
    Posts
    81
    Rep Power
    9

    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?

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Migrating Horde/INGO filters to Zimbra
    By Daimyo in forum Migration
    Replies: 0
    Last Post: 07-12-2007, 11:22 AM
  2. Replies: 1
    Last Post: 05-03-2007, 01:37 AM
  3. Replies: 3
    Last Post: 04-06-2007, 07:07 AM
  4. imapsync and mail filters
    By Coilcore in forum Administrators
    Replies: 5
    Last Post: 08-10-2006, 08:21 AM
  5. filters
    By rmvg in forum Users
    Replies: 0
    Last Post: 09-26-2005, 07:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •