* feat(luahost): capture config settings set by Lua scripts
Add inbucket.config, a Lua-settable settings namespace, with its first
field decode_headers registering additional message headers for Inbucket
to decode. Values are captured once at startup from the first pooled
LState and exposed to the assembly via Host.ScriptConfig().
Settings that only have value to the Lua script belong here rather than
in env config. No consumers of decode_headers yet; that follows.
* feat(message): expose decoded headers to extensions
StoreManager gains ExtraDecodeHeaders, passed through to
enmime.DecodeHeaders, and the decoded header set (defaults plus any
registered extras) is attached to the InboundMessage event as
Headers (net/textproto.MIMEHeader).
Lua scripts access it via the read-only inbound_message.header field,
added with the new inbound_header binding. Lookups are exact-then-
case-insensitive, since enmime canonicalizes keys with email-specific
rules that differ from net/textproto.
FullAssembly wires ScriptConfig().DecodeHeaders into StoreManager.
Part of #627.
* docs(extension): document shared and untrusted header semantics
Reviewer note: BeforeMessageStored listeners receive the same decoded
header map, so a Go listener's mutations are visible to later listeners.
Also record that sender-supplied header values (Authentication-Results,
X-Spam-Status) are untrusted unless the deployment controls provenance.
Part of #627.
---------
Co-authored-by: hillyerd-bot <hillyerd-bot@users.noreply.github.com>
* chore: rename BeforeMailAccepted to BeforeMailFromAccepted
Signed-off-by: James Hillyerd <james@hillyerd.com>
* chore: update BeforeMailAccepted to use SMTPSession
Signed-off-by: James Hillyerd <james@hillyerd.com>
---------
Signed-off-by: James Hillyerd <james@hillyerd.com>
* event: Use pointers for InboundMessage addresses
To ease conversions to/from MessageMetadata
Signed-off-by: James Hillyerd <james@hillyerd.com>
* message: test StoreManager.MailboxForAddress()
Signed-off-by: James Hillyerd <james@hillyerd.com>
---------
Signed-off-by: James Hillyerd <james@hillyerd.com>
* lua: Restore missing test log output
* lua: Use logger for test assert_async output
* lua: add InboundMessage bindings
* lua: bind BeforeMessageStored function
---------
Signed-off-by: James Hillyerd <james@hillyerd.com>
* lua: tidy test helpers
Signed-off-by: James Hillyerd <james@hillyerd.com>
* lua: test after_message_deleted func
Signed-off-by: James Hillyerd <james@hillyerd.com>
---------
Signed-off-by: James Hillyerd <james@hillyerd.com>