Issue Description
(please excuse multiple bugs in one report - say the word and I’ll post one topic each)
Stalwart’s implementation of the SMTP FUTURERELEASE extension appears to be incompatible with RFC 4865, primarily because HOLDUNTIL and the advertised maximum future-release date are represented as Unix timestamps rather than RFC 3339 date-times.
RFC 4865, including verified Erratum 2040, defines:
HOLDFOR=<seconds>
HOLDUNTIL=<date-time>
where date-time uses the RFC 3339 format.
For example:
MAIL FROM:<[email protected]> HOLDUNTIL=2026-08-10T03:00:00Z
Stalwart instead expects HOLDUNTIL to contain an integer Unix timestamp.
There are also several related validation issues:
- A
MAIL FROMcommand containing bothHOLDFORandHOLDUNTILis accepted, although RFC 4865 requires more than one hold parameter to be rejected. - A
HOLDUNTILtimestamp in the past is converted to a zero-second hold using saturating subtraction and accepted for immediate delivery. - The EHLO
FUTURERELEASEcapability advertises its maximum date as a Unix timestamp rather than an RFC 3339 date-time.
Relevant specification:
https://www.rfc-editor.org/rfc/rfc4865.html
Verified Erratum 2040:
Expected Behavior
A client should be able to submit an RFC 3339 timestamp:
MAIL FROM:<[email protected]> HOLDUNTIL=2026-08-10T03:00:00Z
The EHLO capability should similarly advertise the maximum supported absolute date as an RFC 3339 timestamp, for example:
250-FUTURERELEASE 86400 2026-08-10T03:00:00Z
Actual Behavior
Stalwart currently treats HOLDUNTIL as Unix epoch seconds.
For example, its SMTP tests construct values equivalent to:
MAIL FROM:<[email protected]> HOLDUNTIL=1786321200
and expect them to succeed.
The SMTP parser parses HOLDUNTIL using the same numeric parser used for integer parameters, so a standards-compliant RFC 3339 timestamp cannot be parsed.
The EHLO response also advertises the maximum absolute release time as Unix seconds:
250-FUTURERELEASE 86400 1786407600
rather than an RFC 3339 date-time.
Reproduction Steps
-
Enable the
FUTURERELEASESMTP extension, for example with a maximum hold duration of one day. -
Connect to the submission service and issue
EHLO. -
Observe the advertised capability. Stalwart returns a response similar to:
250-FUTURERELEASE 86400 1786407600
The second argument is a Unix timestamp rather than the RFC 3339 date-time required by RFC 4865.
- Attempt a standards-compliant
HOLDUNTILrequest:
MAIL FROM:<[email protected]> HOLDUNTIL=2026-08-10T03:00:00Z
-
Observe that Stalwart rejects it because
HOLDUNTILis parsed as an integer. -
Send the equivalent Unix timestamp instead:
MAIL FROM:<[email protected]> HOLDUNTIL=1786321200
-
Observe that Stalwart accepts it.
-
As a separate validation test, send both hold parameters:
MAIL FROM:<[email protected]> HOLDFOR=3600 HOLDUNTIL=1786321200
- Observe that the command is accepted rather than rejected.
Relevant Log Output
Nothing relevant.
Stalwart Version
v0.16.x
Installation Method
Docker
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
Internal
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on