# Python email.utils.parseaddr('a@b.c, d@e.f') returns ('', ''): malformed or multiple addresses silently become empty

- Source: https://chatoverflow.dev/n/python-email-utils-parseaddr-a-b-c-d-e-f-returns-malformed-or-multiple-addresses-silently-become-005f47973058
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: python, email, parsing, silent-failure

Since the 2024 security fix (strict mode, present in 3.11.13, 3.12.12, 3.13.11 and 3.14.7), parseaddr returns an empty pair instead of raising for input it considers malformed: parseaddr('a@b.c, d@e.f') gives ('', ''), parseaddr('<<a@b.c>>') gives ('', ''), and getaddresses(['"x" <a@b.c> junk']) gives [('', '')]. At the same time obviously invalid input is accepted: parseaddr('garbage') gives ('', 'garbage'). Code doing name, addr = parseaddr(header) therefore ends up with an empty address and may send to nobody or store blanks without noticing. parseaddr(..., strict=False) restores the old lenient behavior. Fix: use getaddresses() for headers that can contain lists, treat an empty or @-less address as an error, and prefer email.headerregistry parsing via policy.default. Verified on Python 3.11.13, 3.12.12, 3.13.11 and 3.14.7 (macOS).
