Am 16.12.2014 um 00:34 schrieb Viktor Dukhovni:
On Tue, Dec 16, 2014 at 12:28:26AM +0100, li...@rhsoft.net wrote:

Am 15.12.2014 um 22:59 schrieb Viktor Dukhovni:
On Mon, Dec 15, 2014 at 12:39:56PM +0100, li...@rhsoft.net wrote:

is there some way to invoke regexp:/etc/postfix/header_checks_smtpd.cf to
local stored messages for strip out unwanted headers?

Have you considered postmap(1)

        http://www.postfix.org/postmap.1.html

The "-h" option is I think what you're looking for

sounds promising - thank you for the hint!

You'll need to modify the code to process the "IGNORE" action,
rather than print it, and to print unmatched headers

modifiy the postfix code?

below what i tried before read your response which sadly behaves completly unexpected, not only in context of headers, also the body is missing from the output

the difficult thing here is that "grep" in context of multiline headers don't work that well while "header_checks" does but pipe all the mailfiles through smtpd is not really a repeatable solution
_________________________________________________

regex.cf:

/^attention.*/ IGNORE
/^authentication\-results.*/ IGNORE
/^auto\-submitted.*/ IGNORE
/^ctch\-senderid\-totalspam.*/ IGNORE
/^delivered\-to.*/ IGNORE
/^dkim\-signature.*/ IGNORE
/^importance.*/ IGNORE
/^list\-archive.*/ IGNORE
/^list\-help.*/ IGNORE
/^list\-id.*/ IGNORE
/^list\-post.*/ IGNORE
/^list\-subscribe.*/ IGNORE
/^list\-unsubscribe.*/ IGNORE
/^mailing\-list.*/ IGNORE
/^message\-id.*/ IGNORE
/^mime\-version.*/ IGNORE
/^organization.*/ IGNORE
/^precedence.*/ IGNORE
/^received.*/ IGNORE
/^received\-spf.*/ IGNORE
/^to.*/ IGNORE
/^user\-agent.*/ IGNORE
_________________________________________________

harry@srv-rhsoft:/scripts/anonymize-corpus]$ postmap -h -m -q - regexp:/regex.cf < sample.eml Received: from mail-gw.thelounge.net (mail-gw.thelounge.net [10.0.0.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested)
        by mail.thelounge.net (THELOUNGE MTA) with ESMTPS id 3k1dl40jnZz2k
        ignorep...@rhsoft.net>; Tue, 16 Dec 2014 00:16:16 +0100 (CET)
Received-SPF: Pass (sender SPF authorized) identity=mailfrom;
 client-ip=67.23.230.181; helo=quailitybadges.org;
 envelopIGNORE=i...@quailitybadges.org; receiver=sp...@rhsoft.net
Received: from quailitybadges.org (quailitybadges.org [67.23.230.181])
by mail-gw.thelounge.net (THELOUNGE GATEWAY) with ESMTP id 3k1dl21pxYz1l
        ignorep...@rhsoft.net>; Tue, 16 Dec 2014 00:16:07 +0100 (CET)
Received: from Gray2PC (unknown [105.184.167.60])
        by quailitybadges.org (Postfix) with ESMTPA id 0CB8A4B24AC1
        ignorep...@rhsoft.net>; Tue, 16 Dec 2014 02:14:18 +0300 (MSK)
To: "spaIGNOREoft.net" <sp...@rhsoft.net>
MIME-VerIGNORE1.0
Message-IGNORERAY2PC9003b2c9411d4518b5d4f82fdbbea3f9@Gray2PC>
X-Spam-SIGNORE No, score=2.5, tag-level=5.6, block-level=8.0
X-Spam-Report: * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches
 handover relay *      domain   * -0.0 SPF_HELO_PASS SPF: HELO matches SPF
 record * -0.0 SPF_PASS SPF: sender matches SPF record  *  0.0 HTML_MESSAGE
BODY: HTML included in message * 2.5 BAYES_50 BODY: Bayes spam probability
 is 40 tIGNORE  *      [score: 0.5031]
X-Virus-IGNOREd: Yes

Reply via email to