Subject: Re: Cleaning up an existing mailfile

From: Roman Czyborra <[email-masked]>
Date: Sun, 20 Feb 1994 22:26:57 GMT

> I have an existing mailfile, /usr/mail/collins I want to go through
> it and save alll the messages where the "Resent-from:" line =
> "Resent-from: procmail-request*" and save them to a file,
> /var/tmp/procmail, and remove them from my mailfile.  What should my
> .procmailrc file read to do this?

If you change your .procmailrc then this will only have an effect on
the mails that come in and are processed by procmail from then on.
For that purpose /var/tmp is a bad place to store mail to because it
will only be local to the mail host and may get erased.

Here's how you can sift out the list mails from your current mailbox:

	cat > /tmp/siftrc << EOF
		:
		^Resent-From: procmail-request
		/var/tmp/procmail
	EOF
	lockfile -ml
	formail < /usr/mail/collins -s \
			procmail /tmp/siftrc DEFAULT=/tmp/collins
	cp /tmp/collins /usr/mail/collins
	rm -f /usr/mail/collins.lock /tmp/siftrc /tmp/collins