Attachment attribute filters

To enable you to delete certain attachments before archiving messages, a rule can contain attachment attribute filters which define which attachment files to select.

The following example XML shows how you can include one or more attachment attribute filters in a rule:

<RULE NAME="rule_name" ... ATTACHMENT_ACTION="<action>">

   [<message_attribute>... </message_attribute>]

   <FILES INCLUDES="ANY|ALL|NONE">
	 <FILE FILENAME="<filename>" SIZE_GREATER_THAN_KB="<integer>" />
	 <FILE ... />
	 ...
   </FILES>

   <FILES INCLUDES="ANY|ALL|NONE">
	 <FILE ... />
	 ...
   </FILES>

</RULE>

The <FILES> tag defines an attachment filter.

If you specify an attachment action (ATTACHMENT_ACTION=), then you need to include at least one attachment filter (using the <FILES> tag). For an attachment to match a rule (and the attachment action applied), the attachment must satisfy all attachment filters specified in the rule. The order of attachment filters in a rule is not significant.

The INCLUDES= operator enables you to define how the following attribute lines are to be applied, when evaluating each attachment.

An attachment filter contains one or more <FILE> elements, that define the attributes to match. Each <FILE> element contains one or both of the following attributes:

Where file name and size are specified in a <FILE> element, both must be satisfied for an attachment to match. For example, if an attachment is to match the following line, it must have an extension of .MP3 and be larger than 1 MB:

<FILE FILENAME="*.MP3" SIZE_GREATER_THAN_KB="1000" />

If you specify multiple <FILE> elements to use in evaluating attachment files, each one will be applied. For an attachment to match the rule, it must match each <FILE> element.

To define how the <FILE> lines are to be applied, when evaluating each attachment, use the INCLUDES= operator:

In the following example, an attachment will match the filter if all the following are true:

<FILES INCLUDES="ANY">
  <FILE FILENAME="*.MP3" SIZE_GREATER_THAN_KB="2000" />
  <FILE FILENAME="*enlarge*.*" SIZE_GREATER_THAN_KB="1000" />
  <FILE FILENAME="*.MPG" />
  <FILE SIZE_GREATER_THAN_KB="12000" />
</FILES>

The following example shows how multiple attachment filters can be used to exclude certain attachments from deletion:

<RULE NAME="Filter attachments rule" ... ATTACHMENT_ACTION="REMOVE">

   [<message_attribute>... </message_attribute>]

   <FILES INCLUDES="NONE">
	 <FILE FILENAME="signature.jpg" />
   </FILES>

   <FILES INCLUDES="ANY">
	 <FILE SIZE_GREATER_THAN_KB="5000" />
   </FILES>

</RULE>

With these attachment filters, attachments will be deleted if they do not have the filename, signature.jpg, and are larger than 5 MB.