Add configurable default outbound signature#201
Merged
Conversation
Every outbound email now carries a signature appended to the body before DKIM signing. Default is `Sent from AIMX.\nhttps://aimx.email`; operators override or disable via the new top-level `signature` key in config.toml (omit for default, set to a string to override, set to "" to disable). The injection happens daemon-side in send_handler so the same behavior applies to `aimx send`, `email_send`, and `email_reply`. Multipart messages get the signature inside the first text/plain part, before the next boundary; flat text messages get it appended to the body.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sent from AIMX.\nhttps://aimx.email.signaturekey inconfig.toml— omit for the built-in default, set a string to customize, or set""to disable. Implemented asOption<String>to match existingOption<T>"default + override" precedents (verify_host,upgrade, per-mailboxtrust/trusted_senders); rejected the alternative of a separatedisable_signatureboolean since the codebase has no such precedent and one field naturally encodes all three states.send_handler::append_signature, called betweeninject_message_id_headerand DKIM signing) so the same behavior applies uniformly toaimx send,email_send, andemail_reply. Multipart messages get the signature inside the firsttext/plainpart (before the next boundary); flat text messages get it appended to the body. Malformed multipart falls back to end-of-body append so DKIM signing stays deterministic.Configis hot-swappable viaConfigHandle, so editingsignaturetakes effect on the next send without restartingaimx serve.Test plan
cargo build— cleancargo clippy -- -D warnings— cleancargo fmt -- --check— cleancargo test— 1050 unit + 106 integration tests pass; 0 failuresappend_signature,extract_multipart_boundary, andfind_first_part_terminator(11 tests covering empty-signature noop, text/plain end-append, multipart text-part injection, LF terminator preservation, multibyte signatures, malformed-multipart fallback, quoted/unquoted/case-insensitive boundary parsing)handle_send(4 tests covering default-when-omitted, custom override, empty disables, and signature-lands-in-text-part for multipart)send_uds_end_to_end_delivers_signed_messageintegration test (realaimx serve+aimx sendround-trip via the file-drop mail transport)book/configuration.mdunder the new "Outbound signature" section