How to globally filter specific SMTP messages
search cancel

How to globally filter specific SMTP messages

book

Article ID: 159758

calendar_today

Updated On:

Products

Data Loss Prevention Network Monitor Data Loss Prevention Enforce Data Loss Prevention Data Loss Prevention Network Email

Issue/Introduction

How can specific messages be filtered prior to being detected by policies?

This can be useful when certain emails sent to internal domains should be excluded from detection. 

Environment

DLP 15.8+ (Email Prevent and Network Monitor) 

Resolution

You can use global SMTP filter by doing the following:

- Login as Administrator
- Go to System > Settings > Protocol
- Click on the SMTP protocol
- Expand "Filtering (may override at server level)" and go down to section "L7 recipient filter" you can enter

+   means include ( and drop)
-    means exclude (and drop)
*    means drop 

Example: 

Sender: [email protected]
To drop this sender the following syntax should used:
   [email protected], +*@test.com, *

(The following syntax to drop [email protected] is incorrect: + *.test.com.com, [email protected] as everything after *.test.com will be dropped).

- Ensure you restart the services after making any changes to the Protocol. 

NOTE: L7 filters only affect network monitor servers.

Please also note: For SMTP the following applies.

  • L7 Sender Filter: Any sender email (for SMTP/MSN IM) or IP addresses (for UTCP), proxy-authenticated user names (for proxied HTTP/FTP), or user names (for AIM/Yahoo IM) to be evaluated

  • L7 Recipient Filter: Any recipient email (for SMTP/MSN IM/FTP) or IP addresses (for UTCP), user names (for Yahoo IM/AIM), or URLs (for HTTP) to be evaluated

You can use filters to include (inspect) or exclude (ignore) messages from specific senders and/or to specific recipients. The specific filter syntax depends on the protocol. For example, for email addresses, you can use wildcards anywhere in the filter string:

 

  • *@test.com matches all email to/from test.com
  • *.test.com

matches all email to/from any subdomains of test.com

  •  

*test.com matches all email to/from any email address ending in test.com.

  •  

[email protected] matches all email to/from [email protected]

 

You can add the following symbols to modify sender or recipient filters:

Plus sign (+)

Any email address mask preceded by a plus sign (+) keeps matching messages for inspection. For example, if you add the sender filter +*@abc.com, all messages sent from anyone in the abc.com domain are inspected.

Minus sign (-)

Any email address mask preceded by a minus sign (-) excludes matching messages from inspection. For example, if you add the recipient filter -*@xyz.com, all messages sent to anyone in the xyz.com domain are not inspected.

Asterisk (*)

If you add an asterisk (*) to the end of the filter expression, any message not explicitly matching any of the filter masks is ignored. For example, if you add the sender filter +*@abc.com,*, all messages from anyone in the abc.com domain are inspected, but all other messages are ignored.


The order in which filters are evaluated is from left to right. For example, if you add the recipient filter


[email protected], +*@xyz.com,*
, all messages sent to [email protected] are ignored, and all messages sent to anyone in the xyz.com domain are inspected. (The last asterisk tells the filter to ignore all other messages.)

In case of conflicting sender and recipient filters (for example, if the sender filter for a particular message evaluates as "inspect" and the recipient filter evaluates as "ignore"), the message resulting in such a case is ignored.

If you add multiple exclusion masks to a recipient filter, all message recipients must match any of the exclusion masks for the message to be excluded.  For example, if the recipient filter is -*@xyz.com, -*@abc.com, all messages sent to xyz.com and abc.com domains are ignored; however, messages sent to either xyz.com or abc.com (but not both) are inspected. If messages have any additional recipients in other domains, the messages are inspected.

You can monitor messages sent from the xyz.com domain but ignore message sent to that domain by adding the following filters:

Sender Filter: +*@xyz.com, *

Recipient Filter: -*@xyz.com

 

Please note: The recipient filter only filters out messages where *all* the recipients (including cc and bcc) match a filter condition. 

 

 

Additional Information

SMTP recipient

Test Case 1
  smtp recipient filter: [email protected], -*test1.com,-*test2.com
  Send email to bob and another user at test1.com.  Email should be processed
  Send email to non-bob at test1.com and [email protected] Email should be dropped
  Send email to non-bob at test1.com and [email protected] and [email protected] Email should be caught

Test Case 2
  smtp recipient filter: [email protected], -*test1.com,-*test2.com,*
  Send email to non-bob at test1.com and [email protected] and [email protected] Email should be dropped

Test Case 3
   smtp recipient filter: -*@test1.com
   send mail to [email protected]  Email should be caught
   send mail to [email protected] Email should be dropped

SMTP sender


Test Case 1
   smtp sender filter: [email protected], -*test1.com,-*test2.com
   Send email from bob and another user at test1.com.  Email should be processed
   Send email from non-bob at test1.com Email should be dropped
   Send email from [email protected] Email should be caught

Test Case 2
   Smtp sender filter: [email protected], -*test1.com,-*test2.com,*
   Send email from [email protected] Email should be dropped

Test case 3
   Smtp sender filter: -*@test1.com
   Send mail from [email protected]  Email should be caught
   Send mail from [email protected] Email should be dropped


Test case 4
   Smtp sender filter: [email protected],+*test1.com
   Send mail from [email protected] should be dropped
   Send mail from [email protected] should be caught
   Send mail from [email protected] should be caught