<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MailKit",
  "identifier" : "/documentation/MailKit/MEContentBlocker",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "MailKit"
    ],
    "preciseIdentifier" : "c:objc(pl)MEContentBlocker"
  },
  "title" : "MEContentBlocker"
}
-->

# MEContentBlocker

An object that provides a set of rules to block content when displaying a message.

```
protocol MEContentBlocker : NSObjectProtocol
```

## Overview

A mail content blocker is similar to content blockers for Safari. Mail uses content blockers when it displays message content in a user’s mailbox. If your extension’s `Info.plist` file contains `MEContentBlocker` in the list of <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSExtension/NSExtensionAttributes/MEExtensionCapabilities>, MailKit invokes [`handlerForContentBlocker()`](/documentation/MailKit/MEExtension/handlerForContentBlocker()) to get the object that provides content-blocking rules. The handler returns the content-blocking rules as JSON data from the [`contentRulesJSON()`](/documentation/MailKit/MEContentBlocker/contentRulesJSON()) method.

For more information about content blockers, see <doc://com.apple.documentation/documentation/SafariServices/creating-a-content-blocker>.

> Note:
> MailKit always applies content-blocking rules for enabled extensions. This is true even if the user clicks the “Load remote content” button on the banner that Mail displays when remote content isn’t loaded.

To indicate that your extension contains a content blocker, add `MEContentBlocker` to the `MEExtensionCapabilities` array in the extension’s `Info.plist` file:

```plist
<key>NSExtensionAttributes</key>
<dict>
    <key>MEExtensionCapabilities</key>
    <array>
        <string>MEContentBlocker</string>
    </array>
</dict>
```

## Topics

### Defining Rules to Block Content

[`-  contentRulesJSON`](/documentation/MailKit/MEContentBlocker/contentRulesJSON())

The rules, as JSON data, that the system applies when it displays a message.

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)