Inbound emails are processed based on the routes you've set up, and messages matching the routes are sent to your specified URL(s) as a webhook. The webhooks generally follow the same format as other webhooks for Transactional Email.
The webhook request is a standard POST request with a single parameter: mandrill_events
. This parameter contains a JSON-encoded array of the messages that match the webhook information.
Key | Description | ||||
---|---|---|---|---|---|
ts | The timestamp when the event occurred—integer UTC Unix format. | ||||
event | The name of the event (for inbound, will be inbound |
||||
msg | Details about the message for which the event occurred. | ||||
raw_msg | the full content of the received message, including headers and content | ||||
headers | an array of the headers received for the message, such as ‘Dkim-Signature’, ‘Mime-version’, ‘Date’, ‘Message-Id’, etc. | ||||
text | the text version of the message | ||||
html | the HTML version of the message | ||||
from_email | the from email address for the message | ||||
from_name | the from name for the message | ||||
to | the recipients of the message, and their names | ||||
the email address where Transactional Email received the message | |||||
subject | the subject line of the message | ||||
tags | the tags applied to the message | ||||
sender | the Transactional Email sender of the message | ||||
attachments | an array of attachments for the message, with filenames as keys. If there are no attachments, key is omitted. Each attachment has the following keys: | ||||
name | the file name | ||||
type | the MIME type of the attachment | ||||
content | the attachment content | ||||
base64 | boolean whether the attachment contents are Base64 encoded | ||||
images | an array of images for the message, with filenames as keys. If there are no images, key is omitted. Each image has the following keys: | ||||
name | the file name | ||||
type | the MIME type of the image | ||||
content | the image content | ||||
spam_report | the results of processing the message with the default SpamAssassin rules. Contains the following keys: | ||||
score | the total spam score for the message | ||||
matched_rules | an array containing details about the rules that the message matched. Each rule entry contains the following keys: | ||||
name | the name of the rule | ||||
description | a short description of the rule | ||||
score | the score for this individual rule | ||||
spf | spf validation results, or null if an error occurred while checking SPF for the message. Contains the following keys: |
||||
result | the spf validation result. One of: pass, neutral, fail, softfail, temperror, permerror, none | ||||
detail | a human-readable description of the result | ||||
dkim | details about the message’s DKIM signature, if any | ||||
signed | boolean whether the message contained a DKIM signature (true or false) | ||||
valid | whether the message’s DKIM signature was valid. Always false if signed is false. |
For inbound emails, tags and sender are included to match other webhooks, but inbound messages generally won’t have tags since they're being received instead of sent, and the sender is null since the event is for a message not being sent by Transactional Email.