Summary
When using the SES transport, messages are sent via the SendEmail API with a raw MIME payload. SES caps a raw message at 40 MB after encoding.
The HTTP handler currently accepts up to 32 MB of multipart form data (ParseMultipartForm(32 << 20)). Because attachments are base64-encoded in the MIME message (~33% size increase), a submission near the upload limit can exceed SES's 40 MB cap and fail at send time rather than being rejected early.
Impact
- Affects the SES transport only. SMTP has no equivalent hard cap in this codebase.
- Failure currently surfaces as a generic send error (HTTP 500) rather than a clear "attachment too large" response.
Possible directions
- Enforce a configurable max attachment/message size before attempting delivery, returning a clear 4xx.
- Account for base64 overhead when validating size for SES targets.
- Document the effective limit.
Priority
Low — nice to have. Real-world contact-form attachments are rarely this large.
Summary
When using the SES transport, messages are sent via the
SendEmailAPI with a raw MIME payload. SES caps a raw message at 40 MB after encoding.The HTTP handler currently accepts up to 32 MB of multipart form data (
ParseMultipartForm(32 << 20)). Because attachments are base64-encoded in the MIME message (~33% size increase), a submission near the upload limit can exceed SES's 40 MB cap and fail at send time rather than being rejected early.Impact
Possible directions
Priority
Low — nice to have. Real-world contact-form attachments are rarely this large.