1
# Copyright (C) 2006-2012 by the Free Software Foundation, Inc.
3
# This file is part of GNU Mailman.
5
# GNU Mailman is free software: you can redistribute it and/or modify it under
6
# the terms of the GNU General Public License as published by the Free
7
# Software Foundation, either version 3 of the License, or (at your option)
10
# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15
# You should have received a copy of the GNU General Public License along with
16
# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
18
"""Remove any 'DomainKeys' (or similar) headers.
20
The values contained in these header lines are intended to be used by the
21
recipient to detect forgery or tampering in transit, and the modifications
22
made by Mailman to the headers and body of the message will cause these keys
23
to appear invalid. Removing them will at least avoid this misleading result,
24
and it will also give the MTA the opportunity to regenerate valid keys
25
originating at the Mailman server for the outgoing message.
28
from __future__ import absolute_import, print_function, unicode_literals
36
from lazr.config import as_boolean
37
from zope.interface import implementer
39
from mailman.config import config
40
from mailman.core.i18n import _
41
from mailman.interfaces.handler import IHandler
45
@implementer(IHandler)
47
"""Remove DomainKeys headers."""
50
description = _('Remove DomainKeys headers.')
52
def process(self, mlist, msg, msgdata):
54
if as_boolean(config.mta.remove_dkim_headers):
55
del msg['domainkey-signature']
56
del msg['dkim-signature']
57
del msg['authentication-results']