Email filter
This section describes how to configure FortiGate email filtering for IMAP, POP3, and SMTP email. Email filtering includes both spam filtering and filtering for any words or files you want to disallow in email messages. If your FortiGate unit supports SSL content scanning and inspection, you can also configure spam filtering for IMAPS, POP3S, and SMTPS email traffic.
The following topics are included in this section:
- Email filter concepts
- Enable email filtering
- Configure email traffic types to inspect
- Configure the spam action
- Configure the tag location
- Configure the tag format
- Configure FortiGuard email filters
- Configure local email filters
- Email filter examples
Email filter concepts
You can configure the FortiGate unit to manage unsolicited commercial email by detecting and identifying spam messages from known or suspected spam servers.
The FortiGuard Antispam Service uses both a sender IP reputation database and a spam signature database, along with sophisticated spam filtering tools, to detect and block a wide range of spam messages. Using FortiGuard Antispam email filter profile settings, you can enable IP address checking, URL checking, email checksum checking, and spam submission. Updates to the IP reputation and spam signature databases are provided continuously via the global FortiGuard Distribution Network.
From the FortiGuard Antispam Service page in the FortiGuard Center, you can find out whether an IP address is blacklisted in the FortiGuard antispam IP reputation database, or whether a URL or email address is in the signature database.
Email filter techniques
The FortiGate unit has a number of techniques available to help detect spam. Some use the FortiGuard Antispam Service and require a subscription. The remainder use your DNS servers or use lists that you must maintain.
FortiGuard IP address check
The FortiGate unit queries the FortiGuard Antispam Service to determine if the IP address of the client delivering the email is blacklisted. A match will cause the FortiGate unit to treat delivered messages as spam.
The default setting of the smtp-spamhdrip CLI command is disable. If enabled, the FortiGate unit will check all the IP addresses in the header of SMTP email against the FortiGuard Antispam Service. For more information, see the FortiGate CLI Reference.
Page 43
FortiGuard URL check
The FortiGate unit queries the FortiGuard Antispam service to determine if any URL in the message body is associated with spam. If any URL is blacklisted, the FortiGate unit determines that the email message is spam.
Detect phishing URLs in email
The FortiGate unit sends the URL links in email messages to FortiGuard to determine if the links are associated with a known phishing site. If such a link is detected, the link is removed from the message. The URL remains, but it is no longer a selectable hyperlink.
FortiGuard email checksum check
The FortiGate unit sends a hash of an email to the FortiGuard Antispam server, which compares the hash to hashes of known spam messages stored in the FortiGuard Antispam database. If the hash results match, the email is flagged as spam.
FortiGuard spam submission
Spam submission is a way you can inform the FortiGuard AntiSpam service of non-spam messages incorrectly marked as spam. When you enable this setting, the FortiGate unit adds a link to the end of every message marked as spam. You then select this link to inform the FortiGuard AntiSpam service when a message is incorrectly marked.
IP address black/white list check
The FortiGate unit compares the IP address of the client delivering the email to the addresses in the IP address black/white list specified in the email filter profile. If a match is found, the FortiGate unit will take the action configured for the matching black/white list entry against all delivered email.
The default setting of the smtp-spamhdrip CLI command is disable. If enabled, the FortiGate unit will check all the IP addresses in the header of SMTP email against the specified IP address black/white list. For more information, see the FortiGate CLI Reference.
HELO DNS lookup
The FortiGate unit takes the domain name specified by the client in the HELO greeting sent when starting the SMTP session and does a DNS lookup to determine if the domain exists. If the lookup fails, the FortiGate unit determines that any messages delivered during the SMTP session are spam.
Email address black/white list check
The FortiGate unit compares the sender email address, as shown in the message envelope MAIL FROM, to the addresses in the email address black/white list specified in the email filter profile. If a match is found, the FortiGate unit will take the action configured for the matching black/white list entry.
Return email DNS check
The FortiGate unit performs a DNS lookup on the reply-to domain to see if there is an A or MX record. If no such record exists, the message is treated as spam.
Banned word check
The FortiGate unit blocks email messages based on matching the content of the message with the words or patterns in the selected spam filter banned word list. This feature is only available in the CLI.
Order of spam filtering
The FortiGate unit checks for spam using various filtering techniques. The order in which the FortiGate unit uses these filters depends on the mail protocol used.
Filters requiring a query to a server and a reply (FortiGuard Antispam Service and
DNSBL/ORDBL) are run simultaneously. To avoid delays, queries are sent while other filters are running. The first reply to trigger a spam action takes effect as soon as the reply is received.
Each spam filter passes the email to the next if no matches or problems are found. If the action in the filter is Mark as Spam, the FortiGate unit tags the email as spam according to the settings in the email filter profile.
For SMTP and SMTPS, if the action is discard, the email message is discarded or dropped.
If the action in the filter is Mark as Clear, the email is exempt from any remaining filters. If the action in the filter is Mark as Reject, the email session is dropped. Rejected SMTP or SMTPS email messages are substituted with a configurable replacement message.
Order of SMTP and SMTPS spam filtering
The FortiGate unit scans SMTP and SMTPS email for spam in the order given below. SMTPS spam filtering is available on FortiGate units that support SSL content scanning and inspection.
- IP address black/white list (BWL) check on last hop IP
- DNSBL & ORDBL check on last hop IP, FortiGuard Antispam IP check on last hop IP, HELO DNS lookup
- MIME headers check, E-mail address BWL check
- Banned word check on email subject
- IP address BWL check (for IPs extracted from “Received” headers)
- Banned word check on email body
- Return email DNS check, FortiGuard Antispam email checksum check, FortiGuard Antispam URL check, DNSBL & ORDBL check on public IP extracted from header.
Order of IMAP, POP3, IMAPS and POP3S spam filtering
The FortiGate unit scans IMAP, POP3, IMAPS and POP3S email for spam in the order given below. IMAPS and POP3S spam filtering is available on FortiGate units that support SSL content scanning and inspection.
- MIME headers check, E-mail address BWL check
- Banned word check on email subject
- IP BWL check
- Banned word check on email body
- Return email DNS check, FortiGuard Antispam email checksum check, FortiGuard Antispam URL check, DNSBL & ORDBL check.
Enable email filtering
Unlike antivirus protection, no single control enables all email filtering. Your FortiGate unit uses many techniques to detect spam; some may not be appropriate for every situation. For this reason, when you enable email filtering, you must then choose when techniques are applied to email traffic.
To enable email filtering
- Go to Security Profiles > Email Filter > Profile.
The default email filter profile is presented. You can edit this profile or create a new one.
- Select the Inspection Mode.
Proxy detection involves buffering the file and examining it as a whole. Advantages of proxy-based detection include a more thorough examination of attachments, especially archive formats and nesting.
Flow-based detection examines the file as it passes through the FortiGate unit without any buffering. Advantages of flow-based detection include speed and no interruption of detection during conserve mode.
- Select Enable Spam Detection and Filtering.
- If you wish to leave everything in it’s default setting you can select OK or
Once you have enabled the email filter you can further specify what protocols to inspect.
Configure email traffic types to inspect
The FortiGate unit examines IMAP, POP3, and SMTP email traffic. If your FortiGate unit supports content inspection, it can also examine IMAPS, POP3S, and SMTPS traffic. The options that you will see in the profile window are IMAP, POP3 and SMTP
To select the email traffic types to inspect
- Go to Security Profiles > Email Filter > Profile.
- The default email filter profile is presented. To edit another profile, select it from the drop down in the Edit Email Filter Profile title bar.
- Select Enable Spam Detection and Filtering.
- Select the types of email that you want the FortiGate unit to examine when using this email filter profile.
- Select Apply.
The traffic types you enable will be examined according to the settings in the email filter profile.
Configure the spam action
When spam is detected, the FortiGate unit will deal with it according to the Spam Action setting in the email filter profile. Note that POP3S, IMAPS and SMTPS spam filtering is available only on FortiGate units that support SSL content scanning and inspection. POP3, IMAP, POP3S and IMAPS mail can only be tagged. SMTP and SMTPS mail can be set to Discard or Tagged:
- Discard: When the spam action is set to Discard, messages detected as spam are deleted. No notification is sent to the sender or recipient.
- Tagged: When the spam action is set to Tagged, messages detected as spam are labelled and delivered normally. The text used for the label is set in the T ag Format field and the label is placed in the subject or the message header, as set with the T ag Location
To configure the spam action
- Go to Security Profiles > Email Filter > Profile
2.
down in the Edit Email Filter Profile title bar.
- Select Enable Spam Detection and Filtering.
4.
filter profile.
- Select Apply.
- The Spam Action row has a drop-down selection under the SMTP traffic type. Select Discard or Tagged.
No selection is available for POP3 or IMAP traffic. Tagged is the only applicable action for those traffic types.
By default, the tag location for any traffic set to Tagged is Subject and the tag format is Spam. If you want to change these settings, continue with “Configure the tag location” on page 47 and “Configure the tag format” on page 47.
- Select Apply.
Select the edited email filter profile in a security policy, and the traffic controlled by the security policy will be scanned according to the settings you configured. You may select the email filter profile in more than one security policy if required.
Configure the tag location
When the spam action is set to Tagged, the Tag Location setting determines where the tag is applied in the message.
To configure the tag location
- Go to Security Profiles > Email Filter > Profile.
- The default email filter profile is presented. To edit another profile, select it from the drop down in the Edit Email Filter Profile title bar.
- Select Enable Spam Detection and Filtering.
- Select the types of email that you want the FortiGate unit to examine when using this email filter profile.
- Select Apply.
- The Tag Location row has two options for each traffic type. Note that if the spam action for SMTP traffic is set to discard, the tag location will not be available. Select the tag location:
- Subject: The FortiGate unit inserts the tag at the beginning of the message subject. For example, if the message subject is “Buy stuff!” and the tag is “[spam]”, the new message subject is “[spam] Buy stuff!” if the message is detected as spam.
- MIME: The FortiGate unit inserts the tag into the message header. With most mail readers and web-based mail services, the tag will not be visible. Despite this, you can still set up a rule based on the presence or absence of the tag.
- Select Apply.
Would X.509 v3 certificates affect network connectivity should you attempt to use URLs instead of IP addresses for the commonName?
Depends on the domain and dns configurations at your deployment
if all profiles are enabled, who will be performed? in parallel or in sequence ?
if all are on the same policy. They are done in a sequence