MailEnable Enterprise Guide
In This Topic
    Reporting Matching Criteria
    In This Topic

    MailEnable logs a return result from filters to the log file or as the [ME_CRITERIA] token replacement for actions. For example, the action to add a header to an email can use the [ME_CRITERIA] token which will be replaced with the string returned from the script. When not using scripting for a filter, this return value is preset and cannot be modified, but when a scripting filter is used the return value can be set within the script.  This is done by setting the MEResultData variable within the script.

    Example: Setting the MEResultData variable within a scripted filter

    If "%SUBJECT%" = "ABC" Then

       MEResultData = "Subject matched ABC"

       FilterResult=1

    Else

       If InStr(1,"%SUBJECT%","FRED") > 0 Then

                    MEResultData = "Subject contained Fred"

       End If

    End If

    If not using a scripted filter, then a system-generated string is returned to denote which were the matching criteria. An example string returned when a filter is matching the term ‘Viagra’ at the beginning of the message subject follows:

    CRITERIA=SUBJECT, DATA=<MF-W>Viagra*</MF-W>

    An extract from an example log file is shown below. The filter column will show whether a scripted filter is being used or not.

    Time

    Action

    Message

    ID

    Connector

    Filter

    Result

    Account

    Sender

    IP

    Address

    Data

    08/21/06 21:42:15

    Start

    -

    -

    -

    -

    -

    -

    -

    -

    08/21/06 21:42:31

    Exec

    A.MAI

    SMTP

    Scripted

    ADD_HEADER,

    NOTIFY_SENDER

     

    [SMTP:user@mailenable.com]

    127.0.0.1

    Subject matched ABC

    08/21/06 21:43:37

    Exec

    B.MAI

    SMTP

    Basic

    ADD_HEADER,

    NOTIFY_SENDER

     

    [SMTP:user@mailenable.com]

    127.0.0.1

    CRITERIA=SUBJECT, DATA=<MF-W>AB*</MF-W>

    This example shows messages A.MAI and B.MAI being processed.

    A.MAI was intercepted by a filter called “Scripted” because the scripted filter reported that the subject matched the term ABC.

    B.MAI was intercepted by a filter called “Basic” because the Subject of the message matched a criteria string AB*. (Note: the <MF-W> mark-up around the term is used to indicate that the term was sourced from word list criteria).