Exchange Server 2003 supports connection filtering based on block lists. Connection filtering takes advantage of external services that list known sources of spam, dial-up user accounts, and servers that are open for relay (based on IP addresses). Connection filtering complements third-party content filter products. This feature allows you to check an incoming IP address against a block list provider's list for the categories that you want to filter. Furthermore, you can use several connection filters and prioritize the order in which each filter is applied.
With connection filtering, you can also do the following:
-
Configure global accept and deny lists. A global accept list is a list of IP addresses from which you will always accept mail. A global deny list is a list of IP addresses from which you will always deny mail. You can use global accept and deny lists with or without using a block list service provider.
-
Configure a recipient address as an exception to all connection filtering rules. When mail is sent to this address, it is automatically accepted, even if the sender appears on a block list.
How Connection-Filtering Rules Work
When you create a connection-filtering rule, SMTP uses the rule to perform a DNS lookup to a list that is provided by a third-party block list service. The connection filter matches each incoming IP address against the IP addresses on the third-party block list. The block list provider issues one of two responses:
-
host not found Indicates that the IP address is not present on its block list.
-
127.0.0.
x A response status code indicating that a match for the IP address was found in the list of offenders. The x value can vary, depending on your block list provider.
If the incoming IP address is found on the block list, SMTP returns a 5.x.x error in response to the RCPT TO command (The RCPT TO command is the SMTP command that the connecting server issues to identify the intended message recipient.)
You can customize the response that is returned to the sender. Additionally, because block list providers usually contain different offender categories, you can specify the matches that you want to reject. Most block list providers screen for three types of offenders:
-
Sources of spam These lists are generated by scanning unsolicited commercial e-mail messages and adding the source address to the list.
-
Known open relay servers These lists are created by identifying open relay SMTP servers on the Internet. The most common reason for an open relay server is a configuration mistake by the system administrator.
-
Dial-up user lists These lists are created from either existing Internet service provider (ISP) lists that contain IP addresses with dial-up access, or from the inspection of addresses that indicate a probable dial-up connection.
How Block List Providers Match Offending IP Addresses
After you set up your connection filter, when an e-mail message is sent to your organization, Exchange contacts the block list provider. The provider checks for the existence of an A (host) record in its DNS. Exchange queries for this information in a specific format. For example, if the connecting address is 192.168.5.1, and the block list provider's organization is contoso.org, Exchange queries for the existence of the following record:
<reverse IP address of the connecting server>.<dns name for the block list organization> IN A 127. 0.0.x
which, in this case, is:
If this IP address is found on the provider's list, the provider returns a 127.0.0.x status code that indicates an offending IP address and the type of offense. All block list providers return a response code of 127.0.0.x, where x indicates the type of offense. The x value varies, depending on the block list provider.
Understanding Block List Provider Response Codes
As mentioned earlier, if a block list provider finds a match, the provider always returns a status code of 127.0.0.x. The status code is either an explicit return code or a bit mask, which is a multifunctional return code. If your block list provider returns a value, you can specify which values you want to filter against. However, if your block list provider returns a bit mask, you must understand how a bit mask works to specify the matches that you want to filter.
A bit mask is a method that is used for verifying that a particular bit is set for an entry. A bit mask differs from a traditional mask in that it checks for a specific bit value, as opposed to a subnet mask, which checks for a range of values. Consider the following example.
For each match in its block list, assume a block list provider returns the status codes that are listed in the following table.
Examples of block list status codes
|
Category
|
Returned status code
|
|---|
|
Known source of spam
|
127.0.0.3
|
|
Dial-up user account
|
127.0.0.2
|
|
Known relay server
|
127.0.0.4
|
However, if an IP address is a member of two lists, the block list provider adds the values of the last octet. Therefore, if an IP address is on the list of known relay servers and known sources of spam, the block list provider returns a status code of 127.0.0.7, where 7 is the combined values of the last octet that is returned for the known sources of unsolicited commercial e-mail status code and the known relay servers status code.
If you want to filter against only known sources of unsolicited commercial e-mail, enter a bit mask value of 0.0.0.3; the block list then filters against any of the possible values, in this case, 127.0.0.3, 127.0.0.5, 127.0.0.7, and 127.0.0.9.
The following table lists the bit mask values that are associated with each of the example status codes.
Examples of block list status codes and corresponding bit mask values
|
Category
|
Returned status code
|
Bit mask value
|
|---|
|
Known source of spam
|
127.0.0.3
|
0.0.0.3
|
|
Dial-up user account
|
127.0.0.2
|
0.0.0.2
|
|
Known relay server
|
127.0.0.4
|
0.0.0.4
|
|
Known relay server and dial-up user account
|
127.0.0.6
|
0.0.0.6
|
In the last category in this table ("Known relay server and dial-up user account"), the bit mask 0.0.0.6 returns a match for an IP address only if it appears on both the known relay server and dial-up user account lists. It does not return a match if the IP address appears on only one of the two lists. You cannot use a bit mask to check for a single match in multiple lists.
Note: |
|---|
|
A bit mask checks only against a single value. If you set a bit mask value that is returned when an IP address appears on two lists, the mask matches only IP addresses that appear on both lists. If you want to check for an IP address on either of two lists, enter the status codes for these settings.
|
Specifying Exceptions to the Connection Filter Rule
You can allow message delivery to specific recipients, regardless of whether they appear on a block list. This exception is useful if you want to allow legitimate organizations to communicate with your administrators by contacting the postmaster account. For example, if a legitimate company has a server inadvertently configured to allow open relaying, e-mail messages from this company to your users would be blocked. However, if you configure connection filtering to allow message delivery to the postmaster account in your organization, the administrator in the blocked company could send mail to your postmaster account to communicate their situation or inquire as to why their mail was rejected.
Enabling Connection Filtering
To enable connection filtering, perform the following steps:
-
Create the connection filter by using the Connection Filtering tab on the Message Delivery Properties dialog box. For detailed instructions, see How to Create a Recipient Filter.
-
Apply the filter at the SMTP virtual server level. For detailed instructions, see How to Apply a Recipient Filter to an SMTP Virtual Server.
Each of these steps is detailed in the following sections.
Configuring Connection Filtering
To configure connection filtering, perform the following tasks:
-
Create global accept and deny lists.
-
Create connection filtering rules.
-
Create exceptions to the connection filtering rules.
For detailed instructions about creating global accept lists and global deny lists, see the following topics:
For detailed instructions on creating exceptions to the connection filtering rules, see the following topic:
Applying the Connection Filter to the Appropriate SMTP Virtual Servers
After creating the connection filter and any exceptions for the filter, you must apply it to the appropriate SMTP virtual servers. Usually, you apply the connection filter to the SMTP virtual servers that exist on your gateway servers that accept inbound Internet e-mail messages. Use the following procedure to apply a connection filter to an SMTP virtual server.
For detailed instructions, see How to Apply a Connection Filter to An SMTP Virtual Server.