Sun Java System Messaging Server 6.3 Administration Guide

18.13 To Create Channel-level Filters

Channel-level filters apply to each message enqueued to a channel. A typical use for this type of filter is to block messages going through a specific channel.

Table 18–5 filter Channel Keyword URL-pattern Substitution Tags (Case-insensitive)

Tag 

Meaning 

Perform group expansion. 

** 

Expand the attribute mailForwardingAddress. This can be a multivalued attribute resulting in several delivery addresses being produced.

$$ 

Substitute in the $ character 

$\ 

Force subsequent text to lower case 

$^ 

Force subsequent text to upper case 

$_ 

Perform no case conversion on subsequent text 

$~ 

Substitute in the file path for the home directory associated with the local part of the address 

$1S 

As $S, but if no subaddress is available just insert nothing

$2S 

As $S, but if no subaddress is available insert nothing and delete the preceding character

$3S 

As $S, but if no subaddress is available insert nothing and ignore the following character

$A 

Substitute in the address, local-part@ host.domain 

$D 

Substitute in host.domain 

$E 

Insert the value of the second spare attribute, LDAP_SPARE_1

$F 

Insert the name of the delivery file (mailDeliveryFileURL attribute)

$G 

Insert the value of the second spare attribute, LDAP_SPARE_2

$H 

Substitute in host 

$I 

Insert the hosted domain (part of UID to the right of the separator specified by domainUidSeparator). Fail if no hosted domain is available

$1I 

As $I, but if no hosted domain is available just insert nothing

$2I 

As $I, but if no hosted domain is available insert nothing and delete the preceding character

$3I 

As $I, but if no hosted domain is available insert nothing and ignore the following character

$L 

Substitute in local-part 

$M 

Insert the UID, stripped of any hosted domain 

$P 

Insert the method name (mailProgramDeliveryInfo attribute)

$S 

Insert the subaddress associated with the current address. The subaddress is that part of the user part of the original address after the subaddress separator, usually +, but can be specified by the MTA option SUBADDRESS_CHAR. Fail if no subaddress is given

$U 

Insert the mailbox part of the current address. This is either the whole of the address to the left of the @ sign, or that part of the left hand side of the address before the subaddress separator, +. 

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