Skip to main content

SpamTitan

Content Filtering

Content filtering allows you to create custom filters for inbound and outbound email and take a specified action on any email that matches a filter. Content filtering is recommended if:

  • You want to take an action on an email that can not be done using pattern filtering, such as a redirect, delete, bounce or ignore. See Pattern Filtering.

  • You want to bypass virus filtering or attachment filtering using allow lists.

Go to Content Filtering > Content Filtering to add, edit and delete content filters.

Pre-defined Content Filters

Three pre-defined content filters are already in place in SpamTitan Gateway:

Note

The pre-defined filters are designed to match most formats for credit card numbers and social security numbers. However, as numbers can be formatted in multiple ways, the filter patterns may not catch all messages containing credit card numbers or social security numbers. Also, as the filter looks for a specific pattern of numbers, it is possible that numeric patterns that are not credit card numbers or social security numbers may be matched.

  1. Credit Card Numbers: When enabled, this filter scans for content matching credit card numbers. Messages containing Visa, Mastercard, Discovery, American Express or Diners Club card numbers will be subject to the specified action.

  2. Social Security Numbers: When enabled, this filter scans messages for U.S. social security numbers. Messages containing social security numbers matching the pattern nnn-nn-nnnn are subject to the specified action. The pattern checks for valid social security numbers by ensuring the pattern does not contain a group of digits that are all zeros, such as in 000-11-1111, 111-00-1111, or 111-11-0000.

  3. X-Originating-IP: This filter is only enabled in SpamTitan cloud builds. When enabled, the filter strips any headers that may be added by a MTA (Message Transfer Agent), as they can cause email to be blocked after RBL testing.

Adding, Editing or Deleting a Content Filter

  • To add a new content filter, click Add... and the Add Filter window displays. Using the table below, complete the fields. Click Save to save this content filter.

  • To edit an existing content filter, click the edit ST-701-edit-button.jpg button in the Options column and the Edit Filter window displays. Using the table below as a reference, edit the fields. Click Save to save this content filter.

  • To delete a single content filter, click the delete ST-701-delete-button.jpg button in the options column. To delete multiple content filters, check the box ST-701-check-box.jpg beside the names of the filters you want to delete and click Delete.

Field

Description

Filter Name:

A descriptive name for this content filter.

Status:

Select ON to enable this filter or OFF to disable this filter.

Filter Expression:

Add or edit a filter rule where the message content for the specified location:

  • starts with: begins with the specified value.

  • ends with: ends with the specified value.

  • contains: contains the specified value. This option matches whole words and parts of words. For example, if the value specified is sex, and the rule is applied to the message body if the body contains the word sex or unisex, or then the rule will match.

    To match messages with just the word sex, use 'matches any word in' or 'matches regular expression' filter options.

  • equals: contains only the specified value. For example, if Free Hotel Rooms is specified and the filter is applied to the Subject: header, then the filter will match only if the subject contains the text Free Hotel Rooms, and no other text.

  • matches any word in: contains any word listed in the specified value. Separate words with spaces.

  • matches regular expression: matches the specified regular expression value. See Using Regular Expression for information on writing regular expressions.

Value:

The specified value, or content, that this filter looks to match. If starts with, ends with, contains, equals, or matches any word in is selected above:

  • The value must be a word or phrase.

  • The value is not case sensitive.

If matches regular expression is selected above:

  • The value can be a regular expression. Regular expression is used to scan messages for text patterns, rather than specific words or phrases.

  • The regular expression syntax is validated as you type. If the syntax is invalid, the field is highlighted in red.

Dot matches new lines:

Displays when matches regular expression is selected from Filter Expression: drop-down. This option makes the dot (.) in regular expression match new line characters (\n). Enabling this option allows matching a word at the beginning of an email's body and a word at the end of an email's body with one regular expression.

Test Filter:

Enter sample text to test if your filter expression is correct and matches. If the filter rule matches the text entered, the field is highlighted in green.

Apply to Body:

Check to apply the rule to the body of the message.

Apply to Headers:

Check to apply the rule to message headers. Enter the headers in the text box provided; one header per line. For example, to apply the filter to the subject header, enter Subject or Subject:. The rule will match if it is found in any of the specified headers.

To apply the rule to all headers, leave this field blank.

Inbound/Outbound Action:

Select from one of these actions if an inbound or outbound message matches this filter rule:

  • Delete: discard the message with no notification to the sender or recipient.

  • Redirect to Relay: relay the message to a different SMTP relay host. In the Relay: field, enter the fully qualified hostname or IP address of the relay host. Specify a domain, host, host:port, [host]:port, [address] or [address]:port; the form [host] turns off MX lookups.

  • Redirect to User: redirect the message to the specified email address. In the User: field, enter the email address of the recipient. The message will be sent to this address instead of the intended recipient(s). This action affects all recipients of the message.

  • Bounce: reject the message. The sender will receive a bounce message.

  • Allow: send the message to the intended recipient(s), bypassing all spam checking.

  • Quarantine: quarantine the message.

  • BCC: add the specified address as a blind carbon-copy (BCC) recipient.

  • Ignore: silently delete the matching line from the message, and inspect the next input line.

  • Off: disable the rule.

Comment:

An optional comment on this filter.