• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SpamScope / mail-parser / 26539837647
100%

Build:
DEFAULT BRANCH: develop
Ran 27 May 2026 09:31PM UTC
Jobs 1
Files 12
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 May 2026 09:29PM UTC coverage: 100.0% (+0.3%) from 99.662%
26539837647

push

github

web-flow
fix(get_addresses): accept email.header.Header inputs (no more 'Header' object has no attribute 'strip') (#153)

* fix(get_addresses): coerce Header inputs to str before .strip()

Message.get() returns email.header.Header for RFC 2047 encoded-word
headers (non-ASCII display names). The Header type has no .strip()
method and is not a valid input to email.utils.getaddresses, which
caused MailParser.from_bytes() to raise

    AttributeError: 'Header' object has no attribute 'strip'

for any mail with a non-ASCII display name in an address header.
Normalize input at the top of get_addresses() so callers can pass
either a str, a Header, or None.

Adds three regression tests in tests/test_utils.py:
- get_addresses with an email.header.Header instance
- get_addresses with None
- get_addresses with a plain str (guards the existing happy path)

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(get_addresses): preserve RFC2047 header encoding for Unicode names

Coercing email.header.Header via str() avoids the AttributeError crash,
but can be lossy for some real-world headers and surface replacement
characters (�) in rendered output.

Use Header.encode() in get_addresses() to preserve RFC 2047 encoded-words.
This keeps the header parseable by email.utils.getaddresses while allowing
core.py to decode display names later via decode_header_part() without
introducing replacement chars.

Adds a regression test that parses a full message via MailParser.from_bytes
and asserts Unicode display names are preserved on mail.to.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(get_addresses): decode Header values before strict address parsing

Some real-world mails produce To/From Header objects that render as
encoded-word tokens like =?unknown-8bit?...?=. Passing those directly to
email.utils.getaddresses(strict=True) can misclassify the token itself as
the address, leaking encoded text into downstream output (e.g. PDF To: line).

Decode Header values first via... (continued)

117 of 117 branches covered (100.0%)

2138 of 2138 relevant lines covered (100.0%)

1.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 26539837647.1 27 May 2026 09:31PM UTC 12
100.0
GitHub Action Run
Source Files on build 26539837647
  • Tree
  • List 12
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #26539837647
  • 83d157b2 on github
  • Prev Build on develop (#23981198478)
  • Next Build on develop (#26541378866)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc