Subject: Re: Misc. questions

From: Roman Czyborra <[email-masked]>
Date: Mon, 6 Feb 1995 16:45:23 +0100 (MET)

> DATE=`date "+%m %d %y %H:%M"`
> FROM=`formail -rt -xTo:`
> SUBJECT=`formail -xSubject:`

> The problem is that this causes three processes to be forked for
> each message that is received and unnecessarily loads the system.

You have procmail 3.10?  You can use its $MATCH facility:

	LOGFILE=.maillog

	:0
	* ^^From .* \/[0-9]+$
	{ YEAR=$MATCH }

	:0
	* ^^From .* \/... .. ..:..
	{ DATE="$YEAR $MATCH" }

	:0
	* ^^From \/[^ ]+
	{ SENDER="$MATCH" }

	:0
	* ^Subject:\/.+
	{ SUBJECT="$MATCH" }

	LOG="$DATE $SENDER $SUBJECT
"
	LOGABSTRACT=no

Looks a lot longer but should run faster.