summaryrefslogtreecommitdiff
path: root/src/fh
blob: 0907aba9fa216d6adfba5cbb453ef27c4f3bf419 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl -p

# fh -- filter headers

BEGIN {
	sub header { $_ =~ shift .. not $next =~ /^[ \t]/ }
	sub skip { $_ = '' }
}

($_, $next) = ($next, $_);
skip if header qr/^X-\S+:/i and not header qr/^(
	  X-Mailer
	| X-Virus-Scanned
):/x;
skip if header qr/^(
	  Received
	| Received-SPF
	| (DKIM|DomainKey)-Signature
	| ARC-Message-Signature
	| IronPort-\S+
):/x;

END { print $next }