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..."
}| Field | Type | Description |
|---|---|---|
filename | string | Original filename |
content_type | string | MIME type (e.g., application/pdf, image/png) |
size | integer | Size in bytes |
content | string | Base64-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