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.
|The timestamp when the event occurred—integer UTC Unix format.
|The name of the event (for inbound, will be
|Details about the message for which the event occurred.
|the full content of the received message, including headers and content
|an array of the headers received for the message, such as ‘Dkim-Signature’, ‘Mime-version’, ‘Date’, ‘Message-Id’, etc.
|the text version of the message
|the HTML version of the message
|the from email address for the message
|the from name for the message
|the recipients of the message, and their names
|the email address where Transactional Email received the message
|the subject line of the message
|the tags applied to the message
|the Transactional Email sender of the message
|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:
|the file name
|the MIME type of the attachment
|the attachment content
|boolean whether the attachment contents are Base64 encoded
|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:
|the file name
|the MIME type of the image
|the image content
|the results of processing the message with the default SpamAssassin rules. Contains the following keys:
|the total spam score for the message
|an array containing details about the rules that the message matched. Each rule entry contains the following keys:
|the name of the rule
|a short description of the rule
|the score for this individual rule
|spf validation results, or
null if an error occurred while checking SPF for the message. Contains the following keys:
|the spf validation result. One of: pass, neutral, fail, softfail, temperror, permerror, none
|a human-readable description of the result
|details about the message’s DKIM signature, if any
|boolean whether the message contained a DKIM signature (true or false)
|whether the message’s DKIM signature was valid. Always
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.