Report a message the SMTP server rejects (1.0.4) #5

Merged
joeyr merged 1 commit from fix/smtp-data-reply into main 2026-10-05 20:08:57 -05:00
Owner

A message the mail server rejected was still logged as sent.

The server judges a message only after its final ".", so a rejection (spam filter, size limit, policy) is the reply to closing DATA. sendEmail deferred wc.Close() and dropped that error. Close is now checked, and a rejection logs "Failed to send email to …" with the server's reply.

  • smtp/sender.go: check the write and the end-of-DATA reply.
  • smtp/sender_session_test.go: the fake server's end-of-DATA reply is a parameter. The new test answers 554, and it fails on the old code.
  • CLAUDE.md: the planned-work list now has the order and decisions agreed on 2026-10-05.
  • VERSION 1.0.4, CHANGELOG.

🤖 Generated with Claude Code

A message the mail server rejected was still logged as sent. The server judges a message only after its final ".", so a rejection (spam filter, size limit, policy) is the reply to closing DATA. `sendEmail` deferred `wc.Close()` and dropped that error. Close is now checked, and a rejection logs "Failed to send email to …" with the server's reply. - `smtp/sender.go`: check the write and the end-of-DATA reply. - `smtp/sender_session_test.go`: the fake server's end-of-DATA reply is a parameter. The new test answers 554, and it fails on the old code. - `CLAUDE.md`: the planned-work list now has the order and decisions agreed on 2026-10-05. - VERSION 1.0.4, CHANGELOG. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Report a message the SMTP server rejects (1.0.4)
All checks were successful
CI / gate (pull_request) Successful in 59s
CI / lint (pull_request) Successful in 55s
CI / image (pull_request) Has been skipped
7c10620fb9
A server judges a message only after its final ".", and that verdict
(spam filter, size limit, policy) is the reply to closing DATA. sendEmail
deferred wc.Close() and dropped its error, so a refused newsletter still
logged "Successfully sent". Close is now checked, and a rejection logs
"Failed to send email to ..." with the server's reply, e.g. 554.

The fake SMTP server in the session test now takes its end-of-DATA
reply as a parameter; the new test has it answer 554 and fails on the
old code, which logged the message as sent.

CLAUDE.md's planned-work list is replaced by the order and decisions
agreed on 2026-10-05.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
joeyr merged commit 9474595f5b into main 2026-10-05 20:08:57 -05:00
joeyr deleted branch fix/smtp-data-reply 2026-10-05 20:08:57 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
joeyr/jellyfin-newsletter!5
No description provided.