Summary
Allow self-hosters to override the hardcoded 10 MB attachment size limit in transactional emails via an environment variable, so that the limit can be tuned to match the underlying SES sending quota (which is 40 MB by default).
Motivation
The current 10 MB total attachment size limit is documented at transactional-emails.mdx and works well as a safe default for most use cases. However, for self-hosted Plunk instances acting as a backbone for multiple downstream services, the limit can be too restrictive.
In our case, we run Plunk as the central SMTP relay for several other self-hosted services (Baserow, HeyForm, DocuSeal, etc.). DocuSeal in particular sends signed PDF documents as email attachments — these can easily exceed 10 MB once the original PDF, audit trail, and embedded signatures are included. The result is a 450 Failed to send email: Payload Too Large error from Plunk, even though the underlying AWS SES account would happily accept the message (SES allows up to 40 MB per message).
Since Plunk is built on top of SES and SES already handles its own 40 MB ceiling at the provider level, the 10 MB Plunk-side limit is essentially a defensive default that self-hosters might reasonably want to relax.
Proposed Solution
Introduce an environment variable (e.g., MAX_ATTACHMENT_SIZE_MB or EMAIL_ATTACHMENT_MAX_SIZE) that controls the maximum total attachment size, defaulting to the current 10 for backwards compatibility:
# Override the default 10 MB attachment limit (in megabytes)
# Maximum supported by AWS SES is 40 MB
MAX_ATTACHMENT_SIZE_MB=25
Optionally, a second variable for the maximum number of attachments:
This would let self-hosters opt into higher limits when their SES setup supports it, without changing default behavior for the hosted Plunk Cloud.
Alternatives Considered
- Forking Plunk and patching the constant — works, but creates a maintenance burden across upgrades.
- Disabling attachments in upstream services — only works for services that support sending links instead of attachments. Many services (e.g., DocuSeal Community) can do this, but the user experience is degraded.
- Using a separate SMTP relay just for attachment-heavy emails — fragments the email infrastructure and undermines the value of having Plunk as a unified relay.
Additional Context
- AWS SES message size limit: 40 MB per message (including all attachments and headers, base64-encoded)
- This change should be backwards compatible if the default stays at
10
- Documentation update would be needed in
apps/wiki/content/docs/concepts/transactional-emails.mdx
Summary
Allow self-hosters to override the hardcoded 10 MB attachment size limit in transactional emails via an environment variable, so that the limit can be tuned to match the underlying SES sending quota (which is 40 MB by default).
Motivation
The current 10 MB total attachment size limit is documented at transactional-emails.mdx and works well as a safe default for most use cases. However, for self-hosted Plunk instances acting as a backbone for multiple downstream services, the limit can be too restrictive.
In our case, we run Plunk as the central SMTP relay for several other self-hosted services (Baserow, HeyForm, DocuSeal, etc.). DocuSeal in particular sends signed PDF documents as email attachments — these can easily exceed 10 MB once the original PDF, audit trail, and embedded signatures are included. The result is a
450 Failed to send email: Payload Too Largeerror from Plunk, even though the underlying AWS SES account would happily accept the message (SES allows up to 40 MB per message).Since Plunk is built on top of SES and SES already handles its own 40 MB ceiling at the provider level, the 10 MB Plunk-side limit is essentially a defensive default that self-hosters might reasonably want to relax.
Proposed Solution
Introduce an environment variable (e.g.,
MAX_ATTACHMENT_SIZE_MBorEMAIL_ATTACHMENT_MAX_SIZE) that controls the maximum total attachment size, defaulting to the current10for backwards compatibility:Optionally, a second variable for the maximum number of attachments:
This would let self-hosters opt into higher limits when their SES setup supports it, without changing default behavior for the hosted Plunk Cloud.
Alternatives Considered
Additional Context
10apps/wiki/content/docs/concepts/transactional-emails.mdx