Hi all,
I've installed my reverting DKIM verifier. Today it failed on a specific message which I also received directly. The reason it failed is the Subject: field was rewritten like so:
ORIGINAL: Subject: RE: [dmarc-ietf] A policy for direct mail flows only, was ARC questions
REWRITTEN: Subject: Re: [dmarc-ietf] A policy for direct mail flows only, was ARC questions
The message is tagged X-Mailman-Version: 2.1.29. Is it Mailman doing that change? I found some code which may seem to be doing something like that in CookHeaders.py:
rematch = re.match(
'(\s*(RE|AW|SV|VS)\s*(\[\d+\])?\s*:\s*)+',
subject, re.I)
if rematch:
subject = subject[rematch.end():]
recolon = 'Re:'
It seems I have to save the subject if it matches that string, correct?
Best Ale
On 11/25/20 10:37 AM, Alessandro Vesely wrote:
Hi all,
I've installed my reverting DKIM verifier. Today it failed on a specific message which I also received directly. The reason it failed is the Subject: field was rewritten like so:
ORIGINAL: Subject: RE: [dmarc-ietf] A policy for direct mail flows only, was ARC questions
REWRITTEN: Subject: Re: [dmarc-ietf] A policy for direct mail flows only, was ARC questions
The message is tagged X-Mailman-Version: 2.1.29. Is it Mailman doing that change?
Yes, but actually it's the Python email library that's responsible for the folding of long headers.
I found some code which may seem to be doing something
like that in CookHeaders.py:
rematch = re.match( '(\s*(RE|AW|SV|VS)\s*(\[\d+\])?\s*:\s*)+', subject, re.I) if rematch: subject = subject[rematch.end():] recolon = 'Re:'
That code is not responsible for the folding. It has to do with subject prefixing.
It seems I have to save the subject if it matches that string, correct?
No. Folding is done by Python's email library. The thing that controls it is the maxlinelen in the call to Header() in the uheader() function. Nothing that calls uheader specifies maxlinelen so it defaults to None which in turn defaults in Header() to 76 (see <https://docs.python.org/2.7/library/email.header.html>). You can set it to a bigger number, but this could be problematic if an incoming header is folded, and the resultant header ends up not folded.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Alessandro Vesely
-
Mark Sapiro