From 9c512c07b877fe8c218295c9515c32a2cb4c544a Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Wed, 5 Jun 2019 16:39:30 -0700 Subject: Fixed missing <> in List-ID with invalid char in description. --- Mailman/Handlers/CookHeaders.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Mailman') diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py index e36c5291..41645d6c 100644 --- a/Mailman/Handlers/CookHeaders.py +++ b/Mailman/Handlers/CookHeaders.py @@ -328,6 +328,12 @@ def process(mlist, msg, msgdata): # 2047 encoded. i18ndesc = uheader(mlist, mlist.description, 'List-Id', maxlinelen=998) listid_h = formataddr((str(i18ndesc), listid)) + # With some charsets (utf-8?) and some invalid chars, str(18ndesc) can + # be empty. + if str(i18ndesc): + listid_h = formataddr((str(i18ndesc), listid)) + else: + listid_h = '<%s>' % listid else: # without desc we need to ensure the MUST brackets listid_h = '<%s>' % listid -- cgit v1.2.3