#!/usr/bin/perl -s @delete = qw( Received: In-Reply-To: User-Agent: X-[-\w]*: Mailing-List: Delivered-To: List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Thread-[-\w]*: Importance: Precedence: Priority: Sensitivity: Auto-Submitted: Disposition-Notification-To: Status: DomainKey-Signature: Comment: Comments: HOP-COUNT: Expiry-Date: DKIM-[-\w]*: Seal-Send-Time: Accept-Language: acceptlanguage: Path: Organization: Lines: ACategory: Slugword: Threadword: Approved: NNTP-[-\w]*: Originator: ); @mime = qw( MIME-[-\w]*: Content-[-\w]*: ); # minhdr - filter out commonly unwanted message header lines # Steve Kinzler, kinzler@cs.indiana.edu, Jun 03 # http://www.cs.indiana.edu/~kinzler/home.html#unix $usage = "usage: $0 [ -m ] [ file ... ] -m also filter out MIME header lines\n"; die $usage if $h; $delete = '^(' . join('|', @delete, ($m) ? @mime : ()) . ')$'; study $delete; $fld = ''; while (<>) { print, last if /^$/; 1 while s/^(\t*) {8}/$1\t/; $fld = $& if /^\S+/; print unless $fld =~ /$delete/io; } while (<>) { print }