[Bug 1525954] [NEW] mailman-2.1.20: option "subject_prefix": prefix trailing blanks are removed when subject lines have non-ASCII characters

Public bug reported:
Trailing blanks on option "subject_prefix" are removed on subject lines with non-ASCII characters. F.i., with options
preferred_language = "Français" subject_prefix = "[prefix] "
(irrespective of encode_ascii_prefixes)
sending this (via Seamonkey Mail, LANG=en_US.UTF-8):
Subject: "[prefix] c'est du français"
results in reception of:
Subject: "[prefix]c'est du français"
** Affects: mailman Importance: Undecided Status: New

Pardon me. This happens *only* when subject_prefix is also non-ASCII, e.g. "[préfixe] ".

** Branch linked: lp:mailman/2.1

The issue is with RFC 2047 encoded Subject: and the fact that white space is insignificant between RFC 2047 "encoded words".
This fix adds a trailing space to the subject_prefix (from which it has been previously stripped) under what I think is just those circumstances where it is needed.
There is another issue in that under some circumstances, the prefix will be followed by two spaces. This is unchanged by this fix and I have no plan to try to change it. I think this only occurs when the prefix is ascii only and the incoming Subject: already contains the prefix, but doesn't contain a Re: indicator.
** Changed in: mailman Importance: Undecided => Low
** Changed in: mailman Status: New => Fix Committed
** Changed in: mailman Milestone: None => 2.1.21
** Changed in: mailman Assignee: (unassigned) => Mark Sapiro (msapiro)

** Changed in: mailman Status: Fix Committed => Fix Released
** Changed in: mailman Milestone: 2.1.21 => 2.1.21rc1

I just gave it a try after reviewing my configuration. Since the patch applies only to subjects with "Re:", it doesn't work on the very first message. Wouldn't it be feasible in all circumstances?

It's fairly complicated. I have a possible fix, but it will take me a while to test all combinations of ascii/non-ascii prefixes and subjects and old vs new style prefixes and subjects with and without Re: and prefix.
** Changed in: mailman Status: Fix Released => In Progress
** Changed in: mailman Milestone: 2.1.21rc1 => 2.1.24

Subject prefixing has been improved to always have a space between the prefix and the subject even with non-ascii in the prefix. This will sometimes result in two spaces when the prefix is non-ascii but the subject is ascii, but this is the lesser evil. (LP: #1525954)
** Changed in: mailman Status: In Progress => Fix Committed

** Changed in: mailman Status: Fix Committed => Fix Released
participants (3)
-
Launchpad Bug Tracker
-
Mark Sapiro
-
sphakka