]> git.ipfire.org Git - thirdparty/patchwork.git/commit
parser: Unmangle From: headers that have been mangled for DMARC purposes
authorAndrew Donnellan <ajd@linux.ibm.com>
Wed, 16 Oct 2019 04:23:07 +0000 (15:23 +1100)
committerDaniel Axtens <dja@axtens.net>
Fri, 18 Oct 2019 05:38:26 +0000 (16:38 +1100)
commit8279a84238c10acbcadd075e4e998dffdc39f2e9
tree6e91234c9346a1cfc19ce05ec2139568650282a1
parent9795ec7505d78de5819ef3e1ebbd446f4010d7aa
parser: Unmangle From: headers that have been mangled for DMARC purposes

To avoid triggering spam filters due to failed signature validation, many
mailing lists mangle the From header to change the From address to be the
address of the list, typically where the sender's domain has a strict DMARC
policy enabled.

In this case, we should try to unmangle the From header.

Add support for using the X-Original-From or Reply-To headers, as used by
Google Groups and Mailman respectively, to unmangle the From header when
necessary and associate the patch with the correct submitter based on the
unmangled email address.

When downloading mboxes, rewrite the From header using the unmangled
address, and preserve the original header as X-Patchwork-Original-From in
case someone needs it for some reason. The original From header will still
be stored in the database and exposed via the API, as we want to keep
messages as close to the original received format as possible.

Closes: #64 ("Incorrect submitter when using googlegroups")
Reported-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Tested-by: Daniel Axtens <dja@axtens.net> # mailman only
[dja: add release note]
Signed-off-by: Daniel Axtens <dja@axtens.net>
patchwork/parser.py
patchwork/tests/test_mboxviews.py
patchwork/tests/test_parser.py
patchwork/views/utils.py
releasenotes/notes/handle-dmarc-bdf35a2a95606153.yaml [new file with mode: 0644]