sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
* mailbox commands
@ 1995-04-21 19:00 Mark H. Wilkinson
  0 siblings, 0 replies; only message in thread
From: Mark H. Wilkinson @ 1995-04-21 19:00 UTC (permalink / raw)
  To: sam mailing list

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
		# delete


Mark H. Wilkinson <>  : Research student in user
University of York, England                 : interface management systems

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-04-21 18:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-04-21 19:00 mailbox commands Mark H. Wilkinson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).