Send email notifications UTF-8 encoded
commitf997d625cf0b75cc4a6d5514ac9c637493311bb5
authorДилян Палаузов <dilyan.palauzov@aegee.org>
Sat, 31 Dec 2022 17:36:57 +0000 (31 17:36 +0000)
committerMark Sapiro <mark@msapiro.net>
Sat, 31 Dec 2022 17:36:57 +0000 (31 17:36 +0000)
tree7bf9b0eecd55a750e5d48524b00d7b65298dbaf3
parentb402bd6c627aa55653a21f515a4205c0183da43d
Send email notifications UTF-8 encoded

The list:admin:action:subscribe and list:admin:action:unsubscribe templates include username, which username includes the displayname and email address.  The displayname shall be sent per email in the template to the list owners RFC2047-decoded.  This implies, that the email must be sometimes UTF-8 encoded, or at least not us-ascii, so that it can contain correctly the displayname.

This change:
* coverts the emails from UserNotification to UTF-8, if the preferred charset cannot include the input correctly.
* in the list:admin:action:subscribe and list:admin:action:unsubscribe templates puts the RFC2047-decoded displayname in username.
src/mailman/app/subscriptions.py
src/mailman/app/tests/test_subscriptions.py
src/mailman/app/tests/test_unsubscriptions.py
src/mailman/docs/NEWS.rst
src/mailman/email/message.py
src/mailman/email/tests/test_message.py