SMTP: non-ASCII sender names and subjects are sent as raw UTF-8

Open
#643 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
swift
Domain
backend

Research direction

Start with RequestEncoder and the existing encoder tests; the issue names both as the place to investigate. Check how the From display name and Subject are serialized, then add an encoder test using non-ASCII text. Done means the test verifies MIME encoded words for the display name and subject while leaving the email address outside the encoded word.

Written by the indexing model from the issue text.

Description

Summary

RequestEncoder writes the From display name and the Subject as they are. Non-ASCII text isn't encoded as
RFC 2047 encoded words, and the client doesn't use the SMTPUTF8 extension.

Evidence

An email from José Ñúñez <josé@example.com> with the subject Café meeting is sent with the headers
From: José Ñúñez <josé@example.com> and Subject: Café meeting as 8-bit text.

Impact

Servers and clients that expect 7-bit headers may reject the message, or show garbled names and subjects.

Suggested fix

Encode non-ASCII display names and the subject with MIME's String.headerEncoded() (keeping the address itself outside
the encoded word), or negotiate SMTPUTF8 when the server offers it. Add an encoder test with non-ASCII text.

Dominant language
Swift
Stars
1.3k
Forks
51
Avg merge
1d 7h
Merged PRs (30d)
33

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from thunderbird/thunderbird-ios

All issues in thunderbird/thunderbird-ios

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.