Skip to content

fix: Name <email> format for Postmark sender in health workflows - #11

Merged
beveradb merged 1 commit into
mainfrom
feat/sess-20260518-1958-postmark-from-format
May 19, 2026
Merged

fix: Name <email> format for Postmark sender in health workflows#11
beveradb merged 1 commit into
mainfrom
feat/sess-20260518-1958-postmark-from-format

Conversation

@beveradb

Copy link
Copy Markdown
Contributor

Summary

The Postmark switch in #9 also silently broke the email-on-failure path. Spotted while investigating run #26064397324 where Postmark replied 501 5.1.7 Bad sender address syntax and the alert was dropped.

dawidd6/action-send-mail@v3 builds the From header like this:

function getFrom(from, username) {
    if (from.match(/.+ <.+@.+>/)) return from
    return `"${from}" <${username}>`
}

Our from: admin@nomadkaraoke.com (no Name <email> form) hit the fallback branch, so the action constructed:

"admin@nomadkaraoke.com" <POSTMARK_SERVER_TOKEN_UUID>

That's not a real mailbox, hence the 501 from Postmark. SendGrid happened to accept the same shape because apikey was the username — Postmark uses the actual token, which makes the bug visible.

Fix: wrap each workflow's from: in "Name <admin@nomadkaraoke.com>" so the regex matches and the value is used verbatim. Also makes alerts distinguishable in the inbox.

Files changed

  • .github/workflows/decide-health.ymlKaraoke Decide Health <admin@nomadkaraoke.com>
  • .github/workflows/gen-health.ymlKaraoke Gen Health <admin@nomadkaraoke.com>
  • .github/workflows/flacfetch-health.ymlFlacfetch Health <admin@nomadkaraoke.com>

Test plan

  • YAML parses (python3 -c "import yaml; yaml.safe_load(open(f))" for each).
  • Verification of actual email delivery has to wait until the next real health-check failure — there's no harmless way to trigger the notification step without faking a failure.

@coderabbitai ignore

🤖 Generated with Claude Code

dawidd6/action-send-mail@v3 only treats the `from:` input as a full
mailbox if it matches `Name <email>`; otherwise it builds
`"<from>" <<username>>`. Our workflows passed a bare
`admin@nomadkaraoke.com` with `username:` set to the Postmark server
token, so the action constructed a sender header of
`"admin@nomadkaraoke.com" <<postmark-token-uuid>>` — which Postmark
rejected with `501 5.1.7 Bad sender address syntax`, silently dropping
the only alert channel for the scheduled health checks.

Wrap the sender in `"Name <email>"` so getFrom() short-circuits and the
header lands as a real mailbox. SendGrid happened to be lenient about
this; Postmark is not.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@beveradb
beveradb merged commit c627abd into main May 19, 2026
2 checks passed
@beveradb
beveradb deleted the feat/sess-20260518-1958-postmark-from-format branch May 19, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant