i'm experimenting with removing certain "internal" received headers, and am
having trouble constructing a proper header check to match headers which span multiple
lines.
cat test_message
Delivered-To: [email protected]
Return-Path: <[email protected]>
Received: from localhost (localhost [127.0.0.1])
by mta.example.com (Postfix) with ESMTP id 76ABF40DF1
for <[email protected]>; Tue, 19 Apr 2011 22:50:30 -0400 (EDT)
From: "[email protected]" <[email protected]>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: tuesday's meeting
Date: Thu, 21 Apr 2011 21.47.30 -0400
To: "[email protected]" <[email protected]>
Mime-Version: 1.0
X-Mailer: mail client
today's meeting will be today
cat header_checks-ignored
/^Received: from localhost \(localhost \[127\.0\.0\.1\]\)\s+by
mta\.example\.com \(Postfix\) with ESMTP id/ IGNORE
#/^Received: from localhost \(localhost \[127\.0\.0\.1\]\)/
IGNORE
postmap -q - regexp:./header_checks-ignored < test_message
if i use the shorter version, it works, so i believe i'm using proper syntax
and test method. how can i construct a header check for a header in which it
may not be known where exactly in the string a newline will be found, and how
much whitespace might be interspersed?
thanks
-ben