Skip to content

Attachments

MXHook parses email attachments and includes them in the webhook payload.

Payload Format

Each attachment in the attachments array contains:

json
{
  "filename": "report.pdf",
  "content_type": "application/pdf",
  "size": 24680,
  "content": "base64-encoded-content..."
}
FieldTypeDescription
filenamestringOriginal filename
content_typestringMIME type (e.g., application/pdf, image/png)
sizeintegerSize in bytes
contentstringBase64-encoded file content

Size Limits

MXHook enforces a maximum message size of 10 MB (configurable). This includes the entire email — body, headers, and all attachments combined.

Raw Email Storage

In addition to the parsed webhook payload, MXHook stores the raw .eml file for every message. This is useful for:

  • Compliance — retain the original message exactly as received
  • Auditing — verify that parsing was correct
  • Replay — re-process messages if your parsing needs change

Raw files are stored using the configured storage backend (filesystem or S3-compatible).

Handling Large Attachments

For emails with large attachments, consider:

  • Setting your webhook endpoint's request body limit high enough to accept the payload
  • Configuring a generous timeout, as large payloads take longer to transfer
  • Processing attachments asynchronously — extract and acknowledge the webhook quickly, then process files in the background

Released under the Apache 2.0 License.