Document compose-safe DEFAULT_FROM_EMAIL quoting.
Deploy Beta / unit-tests (push) Successful in 8s
Deploy Beta / docker (push) Successful in 14s
Deploy Beta / deploy-beta (push) Successful in 1m39s

Docker Compose .env rejects "Name" <addr>; prefer a bare address or one pair of quotes around the whole From value.
This commit is contained in:
2026-08-09 07:23:47 -05:00
parent 5b53ef376d
commit d3db6eed76
3 changed files with 18 additions and 9 deletions
+8
View File
@@ -221,10 +221,18 @@ def format_from_email(address: str | None, display_name: str | None = None) -> s
Bare ``noreply@…`` shows as "noreply". Prefer
``"Monica Dhillon" <noreply@…>`` (RFC 5322).
Docker Compose ``.env`` cannot parse split quotes like
``"Name" <addr>`` — use a bare address (this helper adds SITE_NAME)
or one pair of quotes around the whole value:
``DEFAULT_FROM_EMAIL="Monica Dhillon <addr@domain>"``.
"""
raw = (address or "").strip()
if not raw:
return ""
# Strip a single layer of wrapping quotes from env/compose.
if len(raw) >= 2 and raw[0] == raw[-1] and raw[0] in {'"', "'"}:
raw = raw[1:-1].strip()
if "<" in raw and ">" in raw:
return raw
name = (display_name or SITE_NAME or "").strip()