Sun Java System Messaging Server 6.3 Administration Guide

ProcedureTo Create a Channel-level Filter

  1. Write the filter using Sieve.

  2. Store the filter in a file in the following directory:

    msg-svr-base/config/file.filter

    The file must be world readable and owned by the MTA’s uid.

  3. Include the following in the channel configuration:

    destinationfilter file:IMTA_TABLE:file.filter

  4. Recompile the configuration and restart the Dispatcher.

    Note that changes to the filter file do not require a recompile or restart of the Dispatcher.

    The destinationfilter channel keyword enables message filtering on messages enqueued to the channel to which it is applied. The sourcefilter channel keyword enables message filtering on messages enqueued by (from) the channel to which it is applied. These keywords each have one required parameter which specifies the path to the corresponding channel filter file associated with the channel.

    The syntax for the destinationfilter channel keyword is:


    destinationfilter URL-pattern
    

    The syntax for the sourcefilter channel keyword is:


    sourcefilter URL-pattern
    

    where URL-pattern is a URL specifying the path to the filter file for the channel in question. In the following example, channel-name is the name of the channel.


    destinationfilter file:///usr/tmp/filters/channel-name.filter

    The filter channel keyword enables message filtering on the channels to which it is applied. The keyword has one required parameter which specifies the path to the filter files associated with each envelope recipient who receives mail via the channel.

    The syntax for the filter channel keyword is


    filter URL-pattern
    

    URL-pattern is a URL that, after processing special substitution sequences, yields the path to the filter file for a given recipient address. URL-pattern can contain special substitution sequences that, when encountered, are replaced with strings derived from the recipient address, local-part@host.domain in question. These substitution sequences are shown in Table 18–5.

    The fileinto keyword specifies how to alter an address when a mailbox filter fileinto operator is applied. The following example specifies that the folder name should be inserted as a subaddress into the original address, replacing any originally present subaddress:


    fileinto $U+$S@$D