Stalwart currently advertises a hard coded maxDelayedSend value of 2592000 seconds (30 days), while the SMTP FutureRelease limit is configurable through MTA extension settings.
This causes JMAP clients such as iHasMail, Bulwark, or JMAP-Webmail to limit scheduled sending to 30 days even when the administrator has configured SMTP FutureRelease for a longer duration.
It would be useful for JMAP maxDelayedSend to either be independently configurable or use the same value from SMTP FutureRelease.
This would keep the advertised JMAP capability consistent with the server’s configured delayed-delivery policy.
One more data point for this: with the default settings the two values disagree in the other direction, so clients that trust the session offer dates the server then rejects.
v0.16.27, default MTA extension settings. The session says 30 days:
["EmailSubmission/set", {"accountId": "c", "notCreated": {"s": {"type": "forbiddenMailFrom",
"description": "Server rejected MAIL-FROM: 501 5.5.4 Requested hold time exceeds maximum of 604800 seconds."}}}, "s"]
HOLDFOR: 604800 is accepted.
Three small things that would help clients:
Derive maxDelayedSend from the FUTURERELEASE limit (MtaExtensions.futureRelease) instead of the hard-coded 86400 * 30 in crates/common/src/config/mailstore/capabilities.rs. Since the limit is an expression, evaluating it for an authenticated local sender would be a reasonable value for the session.
submissionExtensions.FUTURERELEASE is []. RFC 8621 (section 1.3, submissionExtensions: “the value is a list of ehlo-args”) passes the EHLO arguments, and RFC 4865 (sections 3 and 4.2) makes max-future-release-interval and max-future-release-date-time required EHLO parameters, so it could be ["604800", "<date-time>"]. (SIZE could carry the size limit in the same way.)
A hold time over the limit, or a HOLDUNTIL in the past, is reported as forbiddenMailFrom (“The server does not permit the user to send a message with the envelope From address”). The 501 5.5.4 reply itself follows RFC 4865, but on the JMAP side invalidProperties with "properties": ["envelope"] would describe the problem better. Past HOLDUNTIL today:
{"type": "forbiddenMailFrom", "description": "Server rejected MAIL-FROM: 501 5.5.4 HOLDUNTIL must be a date and time in the future."}