Send pure plain-text mails as quoted-printable master github/master
authorMagnus Hagander <magnus@hagander.net>
Wed, 7 Jan 2026 20:35:39 +0000 (21:35 +0100)
committerMagnus Hagander <magnus@hagander.net>
Wed, 7 Jan 2026 20:46:07 +0000 (21:46 +0100)
We were already using QP for HTML emails, but due to an oversight it
wasn't done for the pure plaintext ones. Fix that as it's a lot easier
to debug that way, and it's what most MUAs do so it should lead to lower
spam scores.

pgweb/mailqueue/util.py

index a119f8749eb2d67177272a80c333b0a86862363d..527eea95dbccf9cae93213f8b229d02a36354ad2 100644 (file)
@@ -53,7 +53,7 @@ def send_simple_mail(sender, receiver, subject, msgtxt, attachments=None, userge
             mpart.attach(MIMEText(htmlbody, 'html', _charset=_utf8_charset))
     else:
         # Just a plaintext body, so append it directly
-        mpart = MIMEText(msgtxt, _charset='utf-8')
+        mpart = MIMEText(msgtxt, _charset=_utf8_charset)
 
     if attachments:
         msg = MIMEMultipart()