Skip to content

SES: raw message size can exceed the 40 MB SendEmail limit #2

Description

@devopsmitch

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlow priorityNice to have; may be addressed eventually

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions