Mail Filters Needed

jeff at heurikon.UUCP jeff at heurikon.UUCP
Fri Jan 6 18:05:46 AEST 1984


I've used 'sed' numerous times to make a filter of the type
you described ("Modify the Date field of a msg...").

For example, the following filter will force a particular machine
name to occupy the first position in a 'path' header:

	sed -e "s/^Path: foo!/Path: /" -e "s/^Path: /&foo!/"

In this case, if 'foo' is already at the beginning of the path it
removes it, then it adds 'foo' - thus assuring there is always one
'foo' (and only one) at the front of the path.

You could use 'sed' to adjust the date field in a similar fashion.
You may need a number of -e fields to cope with the various days
of the week (or one 'sfile'), but sed is very flexible - and it's fast.
Try it, you'll like.

Another idea: If all you need to do is *remove* a particular field from
a line, then you could feed the line in question to 'cut' and have it
deliver only the fields of the line you want.
-- 
	Jeffrey Mattox, Heurikon Corp, Madison, WI
	{harpo, hao, philabs}!seismo!uwvax!heurikon!jeff  (news & mail)
		ihnp4!uwvax!heurikon!jeff  (mail)
	(Those paths are correct, despite what the headers might show.)



More information about the Comp.unix mailing list