Emailheader und Postfix

Aus C3D2
Zur Navigation springen Zur Suche springen

Basierend auf den Blogpost von Daniel wollte ich meinen Postfix anweisen in Email die sensitive Informationen (Email Client IP usw.) zu bereinigen.

Beispiel

IPv4

Return-Path: <c3d2@example.net>
Delivered-To: <fsteinel@example.com>
Received: from server.example.com
        by example.com (Dovecot) with LMTP id abc1De23F4G5HIJKlMNopq
        for <fsteinel@example.com>; Sun, 19 Jan 2014 16:20:08 +0100
Received: from [192.168.18.10] (wiki.c3d2.example.net [192.168.18.10])
        (Authenticated sender: c3d2)
        by server.example.com (Postfix) with ESMTPSA id 12ABC3D4567;
        Sun, 19 Jan 2014 16:20:07 +0100 (CET)
Message-ID: <1234A5B6.7890123@example.net>
Date: Sun, 19 Jan 2014 16:20:07 +0100
From: c3d2 wiki <c3d2@example.net>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
MIME-Version: 1.0
To: Herr F Steinel <fsteinel@example.com>
Subject: test
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

test

IPv6

Return-Path: <c3d2@example.net>
Delivered-To: <fsteinel@example.com>
Received: from server.example.com
        by example.com (Dovecot) with LMTP id abc1De23F4G5HIJKlMNopq
        for <fsteinel@example.com>; Thu, 09 Apr 2015 19:19:41 +0200
Received: from [IPv6:2a00:1828:a008:103:6883:eefe:4240:6042] (unknown [IPv6:2a00:1828:a008:103:6883:eefe:4240:6042])
        (Authenticated sender: c3d2)
        by server.example.com (Postfix) with ESMTPSA id 12ABC3D4567
        for <fsteinel@example.com>; Thu,  9 Apr 2015 19:19:41 +0200 (CEST)
Message-ID: <1234A5B6.7890123@example.net>
Date: Thu, 09 Apr 2015 19:19:37 +0200
From: c3d2 wiki <c3d2@example.net>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
MIME-Version: 1.0
To: Herr F Steinel <fsteinel@example.com>
Subject: test
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

test

Tests

Testen der Einstellungen mit postmap -hmq - pcre:/etc/postfix/header_checks_auth.pcre < testdatei

Parameter Erläuterung
-h Enable message header query mode.
-m Enable MIME parsing
-q Search the specified maps
- If a key value of - is specified, the program reads key values from the standard input stream and writes one line of key value output for each key that was found.