question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong e-mail address in `From` field with non-ascii characters

See original GitHub issue

Description

I set the notif_from: "%(app)s üzenet <sz-matrix@example.com>" and I end up with: From: "Matrix üzenet <sz-matrix@example.com>"@maildomain.example.com

The weird thing is that the: Return-Path: <sz-matrix@example.com> is correct.

Steps to reproduce

  • set the notif_from: to something like in the documentation
  • restart synapse
  • post message and wait for the e-mail notification

I expect to see Matrix üzenet <sz-matrix@example.com> in the From field of the incoming mail.

Version information

  • Homeserver: Synapse 1.35.1

If not matrix.org:

  • Version:

  • Install method:

  • Platform:

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:21 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
baboliviercommented, Jun 28, 2021

I’ve looked into this issue, and it looks like when Synapse does UTF8 encoding it does it on the whole john doe <jdoe@example.com> string (rather than just john doe), so it’s also converting the </> surrounding the address as well as @/./etc in the address. So from the SMTP server’s pov the From header doesn’t have an address.

0reactions
baboliviercommented, Jul 1, 2021

@clokep pointed out that https://docs.python.org/3/library/email.headerregistry.html#email.headerregistry.AddressHeader and email.utils.formataddr might be interesting to consider in order to fix this bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: There are non-ASCII characters in the local part of the ...
To check for this, open the On My Mac account (on macOS) or Local Folders account (on Windows), then navigate to the Outbox....
Read more >
Can an email address contain international (non-english ...
I would assume yes since a number of top level domains already allow non ascii characters for domains and since the domain ...
Read more >
What are valid and invalid email address characters - TechNet
Hi The format of email addresses is local-part@domain where the local-part may be up to 64 characters long and the domain name may...
Read more >
Sending email to addresses where the local part is non ASCII ...
Sends a non quoted string to the smtp server in the To: header 3. Actual Results: BAD HEADER SECTION, Non-encoded 8-bit data (char...
Read more >
Sending email to non-ASCII character email address
The RFC 6530 protocol allowing addresses with non-Latin and accented Latin characters was released in 2012. However, nothing has been changed ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found