Microsoft Defender for Office 365
Email and collaboration

Advanced Spam Filter (ASF) settings in anti-spam policies

In brief

The article now describes how ASF settings mark messages as Spam or High confidence spam, clarifies matching .biz and .info URLs, and updates wording for Test mode, sensitive words, and SPF hard fail settings.

What Defender admins need to know

Admins can use the revised descriptions to evaluate ASF settings and their anti-spam policy outcomes. No required administrator action is stated.

Summaries are generated from the documentation change itself.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Advanced Spam Filter (ASF) settings in anti-spam policies

For each ASF setting, the following options are available in anti-spam policies:

  • On: ASF adds the corresponding X-header field to the message:
  • Off: The ASF setting is disabled. This value is the default.
  • Test: The ASF setting is in Test Mode.mode. What happens to the message is determined by the Test mode (TestModeAction) value:
    • None: Message delivery is unaffected by the ASF detection. The message is still subject to other types of filtering and rules.
    • Add default X-header text (AddXHeader): The X-header value X-CustomSpam: This message was filtered by the custom spam filter option is added to the message. You can use this value in Inbox rules (not mail flow rules) to affect the delivery of the message.
    • Send Bcc message (BccMessage): The specified email addresses (the TestModeBccToRecipients parameter value in PowerShell) are added to the Bcc field of the message, and the message is delivered to the additional Bcc recipients. In the Microsoft Defender portal, you separate multiple email addresses by semicolons (;). In PowerShell, you separate multiple email addresses by commas.

Increase spam score settings

The following Increase spam score ASF settings result in an increase in spam score and therefore a higher chance of getting markedmark matching messages as spam with a spam confidence level (SCL) of 5 or 6, which corresponds to a Spam filter verdict and apply the corresponding action in anti-spam policies. Not every message that matches the following ASF conditions is marked as spam.policies, unless another detection results in a higher-priority verdict.

Anti-spam policy setting Description X-header added
Image links to remote websites (IncreaseScoreWithImageLinks) Messages that contain <Img> HTML tag links to remote sites (for example, using http) are marked as spam. X-CustomSpam: Image links to remote sites
Numeric IP address in URL (IncreaseScoreWithNumericIps) Messages that contain numeric-based URLs (typically, IP addresses) are marked as spam. X-CustomSpam: Numeric IP in URL
URL redirect to other port (IncreaseScoreWithRedirectToOtherPort) Messages that contain hyperlinks that redirect to TCP ports other than 80 (HTTP), 8080 (alternate HTTP), or 443 (HTTPS) are marked as spam. X-CustomSpam: URL redirect to other port
Links to .biz or .info websites (IncreaseScoreWithBizOrInfoUrls) Messages that contain .biz or .info links in the body of the message are marked as spam.

Note that URLs such as contoso.info.com (where .biz or .info is notisn't the top-level domain) will also match.
X-CustomSpam: URL to .biz or .info websites

Mark as spam settings

The following Mark as spam ASF settings set the SCL ofmark detected messages to 9, which corresponds towith a High confidence spam filter verdict and the corresponding action in anti-spam policies.

Anti-spam policy setting Description X-header added
Frame or iframe tags in HTML (MarkAsSpamFramesInHtml) Messages that contain <frame> or <iframe> HTML tags are marked as high confidence spam.

These tags are used in email messages to format the page for displaying text or graphics.
X-CustomSpam: IFRAME or FRAME in HTML
Web bugs in HTML (MarkAsSpamWebBugsInHtml) A web bug (also known as a web beacon) is a graphic element (often as small as one pixel by one pixel) that determines whether the recipient read the message.

Messages that contain web bugs are marked as high confidence spam.

Legitimate newsletters might use web bugs, although many consider them an invasion of privacy.
X-CustomSpam: Web bug
Object tags in HTML (MarkAsSpamObjectTagsInHtml) Messages that contain <object> HTML tags are marked as high confidence spam.

This tag allows plug-ins or applications to run in an HTML window.
X-CustomSpam: Object tag in html
Sensitive words (MarkAsSpamSensitiveWordList_)(MarkAsSpamSensitiveWordList) Microsoft maintains a dynamic but non-editable list of words that are associated with potentially offensive messages.

Messages that contain words from the sensitive word list in the subject or message body are marked as high confidence spam.
X-CustomSpam: Sensitive word in subject/body
SPF record: hard fail (MarkAsSpamSpfRecordHardFail) Messages sent from an IP address that isn't specified in the SPF Sender Policy Framework (SPF) record in DNS for the source email domain are marked as high confidence spam.

Test mode isn't available for this setting.
X-CustomSpam: SPF Record Fail

The following Mark as spam ASF settings set the SCL ofmark detected messages to 6, which corresponds towith a Spam filter verdict and the corresponding action in anti-spam policies.

Anti-spam policy setting Description X-header added