Re-enable envelope/body now that the Mailutils Sieve engine supports them

The Gentoo mail-mta/bongo overlay's net-mail/mailutils ebuild now
carries a local patch (files/mailutils-3.21-sieve-envelope-body.patch)
that fixes require.c's registry lookup so require ["envelope"]; can
reach the standard test Mailutils already implements, and adds a new
body.c test module (RFC 5173, using only Mailutils' own MIME API) that
Mailutils never implemented in any form. Verified against Mailutils'
own upstream Sieve test suite (107/107, zero regressions, including
the real envelope.at case) plus live execution of both extensions.

Advertise both again in the ManageSieve CAPABILITY string and allow
them in safe_requirement(); update docs/sieve.md and drop the now-
resolved ROADMAP item about replacing the Sieve engine entirely.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Mario Fetka
2026-08-01 11:44:06 +02:00
parent 57d38fc6fc
commit ba434bf79e
4 changed files with 14 additions and 36 deletions
-16
View File
@@ -162,22 +162,6 @@ outside the 0.7.0 release scope:
OAuth instead of stored account passwords where required. Mail, calendar and
contacts may share one provider preset and credential grant, but must remain
independently enabled and revocable by the user.
- Replace the bundled GNU Mailutils Sieve engine, which cannot run
`envelope` or `body`. Its `require` resolution only ever checks its
action registry for a bare extension name, so `require ["envelope"];`
(the only syntax RFC 5228 scripts use) can never succeed no matter how
a same-named test is registered (confirmed against Mailutils' own
`sieve` reference tool, independent of Bongo), and it does not
implement `body` in any form. Plan: import Cyrus `libsieve` as a
pinned, unmodified git submodule with only the minimal build-time
patches needed for Bongo compatibility, the same pattern planned for
the 0.8 Bulwark Webmail integration. Cyrus's `libsieve` expects
callbacks into Cyrus's own mailbox/message-store API, so the real work
is a compatibility shim bridging those callbacks to `BongoSieveStore`
and the queue, in the spirit of how `install_bongo_actions()` already
bridges Mailutils' action callbacks today. This is a dedicated,
separately planned project, not a quick swap; see
`docs/test-evidence/0.7-r1.md#sieve-04`.
- Complete JMAP Core (RFC 8620), JMAP Mail (RFC 8621) and JMAP Contacts
(RFC 9610) for the 0.9 series as the modern primary synchronization API,
building on the standards-conforming Webmail slice introduced for 0.8.
+12 -10
View File
@@ -39,17 +39,19 @@ names and literals are bounded, syntax is validated before activation, an
active script cannot be deleted accidentally, and scripts are isolated by
authenticated user.
The implementation advertises `fileinto`, `variables`, `vacation`, and
`vacation-seconds`. `envelope` and `body` are not usable: the underlying
Mailutils Sieve engine's `require` resolution only ever checks its action
registry for a bare extension name, so `require ["envelope"];` cannot
succeed regardless of how a same-named test is registered (confirmed
The implementation advertises `fileinto`, `envelope`, `body`, `variables`,
`vacation`, and `vacation-seconds`. `envelope` and `body` (RFC 5173) are
not implemented by the stock Mailutils Sieve engine at all -- confirmed
directly against Mailutils' own `sieve` reference tool, independent of
Bongo), and `body` (RFC 5173) is not implemented by Mailutils in any form.
Both are intentionally left off the advertised capability list so scripts
requiring them are rejected cleanly at upload time instead of accepted and
silently ignored; see the release testing evidence for SIEVE-04. Actions
include keep, discard, file into a
Bongo -- so the Gentoo `net-mail/mailutils` ebuild this project builds
against carries a local patch adding both: a small `require.c` fix so
`require ["envelope"];` resolves the standard test Mailutils already
implements but never lets a bare `require` reach, and a new `body.c` test
module (using only Mailutils' own MIME/message API, no new dependency)
implementing `:raw`, `:content <types>`, and `:text` (default) per
RFC 5173. Both are verified against Mailutils' own upstream Sieve test
suite (zero regressions) plus live execution; see the release testing
evidence for SIEVE-04. Actions include keep, discard, file into a
folder, redirect, reject, and vacation response. Vacation history is durable
so repeated delivery does not generate an immediate reply loop. Scripts and
vacation state live in the owning user's authoritative Bongo Store and are
+1 -1
View File
@@ -78,7 +78,7 @@ static int capabilities(Connection *connection, int tls, const char *mechanisms)
if (ConnWriteF(connection, "\"IMPLEMENTATION\" \"Bongo %s\"\r\n",
BONGO_VERSION) == -1 ||
ConnWriteStr(connection,
"\"SIEVE\" \"fileinto variables vacation vacation-seconds\"\r\n"
"\"SIEVE\" \"fileinto envelope body variables vacation vacation-seconds\"\r\n"
"\"MAXREDIRECTS\" \"4\"\r\n") == -1) return -1;
if (!tls && ConnWriteStr(connection, "\"STARTTLS\"\r\n") == -1) return -1;
if (tls && mechanisms && ConnWriteF(connection, "\"SASL\" \"%s\"\r\n",
+1 -9
View File
@@ -37,19 +37,11 @@ extern char **environ;
static int install_bongo_actions(mu_sieve_machine_t machine);
/* The installed Mailutils build's `require` handling only ever resolves a
* bare extension name (as opposed to a "comparator-"/"test-" prefixed one)
* against its action registry, so `require ["envelope"];` -- the only
* syntax RFC 5228 scripts actually use -- can never succeed regardless of
* how a test named "envelope" is registered; confirmed directly against
* the system's /usr/bin/sieve reference tool, independent of Bongo. It
* does not implement "body" (RFC 5173) at all, in any form. Do not
* advertise or accept requirements this Sieve engine cannot execute. */
static int
safe_requirement(const char *name, size_t length)
{
static const char *allowed[] = {
"fileinto", "redirect", "reject", "variables",
"fileinto", "redirect", "reject", "envelope", "body", "variables",
"vacation", "vacation-seconds"
};
size_t index;