This discussion is archived
3 Replies Latest reply: Mar 25, 2013 6:27 PM by 831622 RSS

Sieve filter body message

831622 Newbie
Currently Being Moderated
Hi Oracle,
I create an sieve filter as follow:

if body :content_type "body/html" :contains :text "MAKE MONEY"
+}+
discard; stop;
+}+

When email in, out server, I received an problem email with content: Reason: Error in sieve filter: Body not listed in require clause prior to use around input line 41

What's wrong with me?
  • 1. Re: Sieve filter body message
    bv116112 Newbie
    Currently Being Moderated
    Hi,

    I see a number of problems with you attempt :

    -> body sieve filtering is something of MS7.
    What version of Messaging Server are you using ? (imsimta version)

    -> you should start this filter with :

    require ["body"];

    -> the sieve body filtering is according RFC5173, and there is no such thing like ":content_type".
    A better attempt would be :
    if body :text :contains "MAKE MONEY"

    -> the first bracket after the if statement should be '{'

    All together, your filter should look more like this :

    require ["body"];
    if body :text :contains "MAKE MONEY"
    {
    discard; stop;
    }


    There are a few remarks left to be made :
    - to enable sieve filtering in the body part of mails, you will have to enable this.
    Put in the option.dat the following :

    ENABLE_SIEVE_BODY=1

    This is mentioned here .
    Do not forget to [rebuild the config|https://wikis.oracle.com/display/CommSuite/About+MTA+Services+and+Configuration#AboutMTAServicesandConfiguration-CompilingtheMTAConfiguration] .

    - afaik. there are some limitations to this filtering method.
    Eg. The only body transforms supported are :raw and :text; :content is not supported
    I must admit I do not see this currently documented somewhere, but I will try to get his done.

    Cheers, Ben
  • 2. Re: Sieve filter body message
    bv116112 Newbie
    Currently Being Moderated
    The Sieve body extenstion restrictions are documented on this page :
    http://msg.wikidoc.info/index.php/Sieve_Implementation#Body_Extension_Implementation

    Cheers, Ben
  • 3. Re: Sieve filter body message
    831622 Newbie
    Currently Being Moderated
    Hi Ben,
    It's very helpfull, thank you so much.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points