bug: email trigger silently discards messages larger than 8 KiB
Describe the bug
The built-in email (SMTP) trigger silently discards any message larger than ~8 KiB. There is no error, no log line, and no job is created — the message simply disappears.
The sending side sees the SMTP session proceed normally up to 354 End data with <CRLF>.<CRLF>, and then receives no response at all — no 250, no error code.
This matters because the practical use case for an email trigger is "a document arrives by mail, a workflow starts". Any real message with a PDF attachment exceeds 8 KiB, so the trigger works in testing with plain-text mails and then loses every real document in production, without leaving a trace anywhere.
To reproduce
- Create an email trigger with a
local_part(e.g.invoices). - Set the instance setting
email_domain(the SMTP listener on port 2525 only starts once this is set). - Send messages of increasing size to
invoices@<email_domain>(STARTTLS required). - Observe which ones produce a job.
Measured on CE v1.792.2:
| Attachment | Total message size | Result |
|---|---|---|
| 0.5 KB | 501 B | delivered |
| 4 KB | 6,010 B | delivered |
| 5 KB | 7,329 B | delivered |
| 6 KB | 8,729 B | discarded |
| 7 KB | 10,133 B | discarded |
| 16 KB | 22,827 B | discarded |
| 36 KB (real invoice PDF) | 49,849 B | discarded |
The cutoff lies between 7,329 and 8,729 bytes, i.e. at 8,192 bytes — which looks like a buffer size rather than a deliberate limit.
Expected behavior
Either:
- accept messages above 8 KiB (with a configurable limit), or
- reject them at the SMTP level with a proper error code (e.g.
552 Message size exceeds fixed limit) so the sender knows.
Silently accepting the DATA phase and then dropping the message is the worst of both: the sender believes delivery succeeded, and the operator has nothing to detect.
Screenshots
No response
Browser information
Not applicable — reproduced over SMTP, not the UI.
Application version
CE v1.792.2 (self-hosted, Docker Compose)
Additional Context
The absence of logging is the most serious part. For delivered messages the server log shows:
received email for recipient ...For discarded messages there is no line at all — not even a warning. There is also no entry in the job history and no failed job. From the operator's side the message never existed.
Happy to test a patch against a real invoice mail if that helps.
Source: windmill-labs/windmill