test-email: a test message from Server › Health
Decided by the owner on 2026-10-13 (out of preflight); the sender is his
choice of 2026-10-16 ("Да, адрес годится"); mockups e92769f, e3b2501,
8f0ccf9, the route guard 75f97c9.
Card 09 on Health, in the right stack's static end (the left stack is
polled whole): one recipient and Send. HandleTestMessage (global role)
takes one address (validate.AccountEmail - no list, nothing that reads as
an option), at most ten an hour counted from the send log, writes the
message's send-log row first (store.InsertTestMessage: queued, the
hostname as domain, no application, no queue id), awaits its Message-ID
(logtail.AwaitMessageID) and hands it to sendmail as notifications go
(notify.Mailer.SendWithID: postmaster@ the hostname, signed by the local
socket with the key of the server's own name). The browser lands on the
row; the tailer gives it its queue id from cleanup's message-id= line
(src/cleanup/cleanup_message.c:639) and from then on its delivery lines
its status. Postfix refusing the hand-over removes the row; sendmail out
of time keeps it (postdrop may have queued it). The sweep closes a row
whose id was never seen once it is no longer awaited
(CloseUnmatchedTestMessages); an id awaited past ten minutes is not taken.
Reviewed for security before the commit (2026-10-17): no high or medium;
its three low findings are fixed in this commit (the unmatched row's
close, the awaited id's age, the timeout keeping the row) and the
security.md bullet says how the queue id is matched.
Tests: TestTestMessage (refusals, the row and the page, Postfix refusing,
the hourly ten), TestTestMessageTimeoutKeepsTheRow, TestTestMessageRows,
TestCloseUnmatchedTestMessages, TestAwaitedMessageID,
TestRunGivesTheTestMessageItsQueueID, TestHealthTestMessageCard; e2e sends
one to the sink: the row is sent with a long queue id, the sink has it
signed d=mail.e2e.test. go vet + go test (26 packages) and make e2e on the
test server for this tree.
Docs: help (word for word with the mockup), guide § Overview and Health,
architecture § Log tailer, security.md, CHANGELOG [Unreleased] § Added,
roadmap row done.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,25 @@ type Health struct {
|
||||
// reverse proxy's own.
|
||||
ConfigFacts []Fact
|
||||
ConfigProblem Text
|
||||
|
||||
// TestMessage is the card that sends the panel's test message
|
||||
// (test-email): TestFrom is its sender, TestTo the address typed and
|
||||
// TestErr why it was not sent, both kept when the form comes back.
|
||||
TestMessage Box
|
||||
TestAction string
|
||||
TestFrom string
|
||||
TestTo string
|
||||
TestErr string
|
||||
}
|
||||
|
||||
// TestMessageAction is where the Test message card posts.
|
||||
const TestMessageAction = "/server/health/test-message"
|
||||
|
||||
// WithTestMessage fills the Test message card: from is the sender, to and
|
||||
// problem what the form comes back with when it was refused.
|
||||
func (h *Health) WithTestMessage(from, to, problem string) *Health {
|
||||
h.TestFrom, h.TestTo, h.TestErr = from, to, problem
|
||||
return h
|
||||
}
|
||||
|
||||
// WithClientAddress says where the panel sees the viewer's request from:
|
||||
@@ -184,6 +203,9 @@ func NewHealth(m Meta, flash string) *Health {
|
||||
Configuration: Box{No: "08", InCards: true, Title: "Configuration", ID: "configuration",
|
||||
End: Plain("Safe to run at any time")},
|
||||
Reload: Action{Label: "Reload configuration", Icon: "ti-reload", Post: "/server/health/reload"},
|
||||
TestMessage: Box{No: "09", InCards: true, Title: "Test message", ID: "test-message",
|
||||
End: Plain("Shows what the receiving server answers"), Help: topicLink(HelpTestMessage, "What the test proves")},
|
||||
TestAction: TestMessageAction,
|
||||
}
|
||||
if flash != "" {
|
||||
h.Flash = &Flash{Text: Plain(flash)}
|
||||
|
||||
Reference in New Issue
Block a user