Subject: mailbox commands

From: [email-masked] (Mark H. Wilkinson)
Date: Fri, 21 Apr 1995 15:00:33 -0400

While we're on the subject of mail, here's a command I use fairly regularly
to strip the Received: lines out of mail headers. Obviously you can apply
it to all your mailing list archives using the X command, hence freeing
up lots of disk space.

,y/^[ 	]*\n/g/^From .*\n(^[a-zA-Z\-]+:.*\n((	| ).*\n)*)+/x/^Received: .*\n((	| ).*\n)*/d

or in other words,
,		# select the whole file
y/^[ 	]*\n/	# loop over the bits between all the blank lines
g/^From .*\n(^[a-zA-Z\-]+:.*\n((	| ).*\n)*)+/
		# ensure the current bit matches this regexp which
		# describes a mail header (I think!)
x/^Received: .*\n((	| ).*\n)*/
		# loop over Received: header lines, handling continuation
		# to subsequent lines
d
		# delete

-Mark.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Mark H. Wilkinson <[email-masked]>  : Research student in user
University of York, England                 : interface management systems