Repository navigation
Conversation
…ere only caught at send time
This branch has not been deployed
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.
Problem
While it was my own fault (empty from="") i've run into this behavior myself, the problem is that neomd didn't warn me.
luckily i was able to recover the typed email body using ":recover"
Note: during editing i noticed the empty From field, but i suspected he will simply fallback to my defined email address for the current account selected.
Details:
With
fromleft empty (its default) neomd starts fine, the pre-send screenshows a blank
From:line, and the failure surfaces only after the mail iswritten:
The same goes for a malformed
from = "xx".extractDomain's comment evenassumes "the From address always comes from validated config.toml accounts" —
but
validate()never checkedfromat all.Fix
Config.validate()now requires afromon every[[accounts]]entry and[[senders]]alias, and checks it is a single RFC 5322 address with anon-empty domain (
validFromAddress— the same barextractDomainappliesat send, so anything that passes load can actually send):
account "name": from is required (set from to your address, e.g. "Name <you@example.com>")"xx",Name <xx>, multiple addresses) →account "name": from "xx" is not a valid email addressBoth surface through the existing
config validation:startup error, beforeany mail is composed.
Behavior change: configs with an empty
frompreviously loaded (but couldnever send) — they now refuse to start, with a message that says exactly what
to set.
Tests
TestValidate_AccountRequiresFrom,TestValidate_SenderRequiresFromTestValidate_FromFormat(valid/invalid table:"xx",Name <xx>,xx@, multiple addresses)TestLoad_EmptyFromIsLoadError(throughLoad)Full suite + Hardening suites pass. +157/−0 (code, tests, CHANGELOG entry, AGENTS.md invariant).