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

# MEExtension

A type that provides objects for manipulating email messages, such as performing actions on messages or blocking content when users view messages.

```
@MainActor protocol MEExtension : NSObjectProtocol
```

## Overview

To implement an app extension, you provide an object that conforms to the [`MEExtension`](/documentation/MailKit/MEExtension) protocol. The <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSExtension/NSExtensionAttributes/MEExtensionCapabilities> key of your extension’s `Info.plist` defines the capabilities that you support, as follows:

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

For each capability that your extension defines, you provide an object that implements the capability. MailKit uses the following methods to request the object for a given capability. The capability also specifies a protocol that the handler implements.

|Capability Key            |Method                                                                                   |Protocol                                                                  |
|--------------------------|-----------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
|`MEContentBlocker`        |``doc://com.apple.mailkit/documentation/MailKit/MEExtension/handler(for:)``              |``doc://com.apple.mailkit/documentation/MailKit/MEContentBlocker``        |
|`MEMessageActionHandler`  |``doc://com.apple.mailkit/documentation/MailKit/MEExtension/handlerForMessageActions()`` |``doc://com.apple.mailkit/documentation/MailKit/MEMessageActionHandler``  |
|`MEComposeSessionHandler` |``doc://com.apple.mailkit/documentation/MailKit/MEExtension/handlerForContentBlocker()`` |``doc://com.apple.mailkit/documentation/MailKit/MEComposeSessionHandler`` |
|`MEMessageSecurityHandler`|``doc://com.apple.mailkit/documentation/MailKit/MEExtension/handlerForMessageSecurity()``|``doc://com.apple.mailkit/documentation/MailKit/MEMessageSecurityHandler``|

## Topics

### Blocking Content

[`-  handlerForContentBlocker`](/documentation/MailKit/MEExtension/handlerForContentBlocker())

Returns an object that provides rules that the message viewer uses to block content.

### Performing Actions on Messages

[`-  handlerForMessageActions`](/documentation/MailKit/MEExtension/handlerForMessageActions())

Returns an object that performs actions on mail messages as the system downloads them.

### Enhancing the Compose Window

[`-  handlerForComposeSession:`](/documentation/MailKit/MEExtension/handler(for:))

Returns an object that participates in the composition of a mail message.

### Encrypting and Signing Messages

[`-  handlerForMessageSecurity`](/documentation/MailKit/MEExtension/handlerForMessageSecurity())

Returns an object that applies security measures such as encryption and digital signatures to messages.

## 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)