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

# MEMessageActionHandler

An object that performs actions on messages as the system downloads them.

```
protocol MEMessageActionHandler : NSObjectProtocol
```

## Overview

As MailKit downloads messages, it invokes the [`decideAction(for:completionHandler:)`](/documentation/MailKit/MEMessageActionHandler/decideAction(for:completionHandler:)) method on your handler. You indicate the action to take for each message, such as marking it as read or unread, flagging it, or archiving it.

To indicate that your extension contains a message action handler, add `MEMessageActionHandler` to the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSExtension/NSExtensionAttributes/MEExtensionCapabilities> array in the extension’s `Info.plist` file:

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

## Topics

### Performing Actions on Messages

[`-  decideActionForMessage:completionHandler:`](/documentation/MailKit/MEMessageActionHandler/decideAction(for:completionHandler:))

Determines the action that the system takes when it downloads a message.

[`MEMessageAction`](/documentation/MailKit/MEMessageAction)

An action the system performs on a message, such as setting a color or archiving it.

[`MEMessageActionDecision`](/documentation/MailKit/MEMessageActionDecision)

The action that the system performs on a message, or a request to ask the action handler again later when the message content is available.

[`MessageColor`](/documentation/MailKit/MEMessageAction/MessageColor)

A color that the system uses to display a message in the message list.

### Instance Properties

[`requiredHeaders`](/documentation/MailKit/MEMessageActionHandler/requiredHeaders)

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