Subject: Re: Forwarding and Saving Messages

From: [email-masked] (David W. Tamkin)
Date: Fri, 5 Aug 1994 18:06:13 -0500 (CDT)

Jerry Alexandratos asked,

| I get a piece of mail, and ...  in my maillog file, all it shows is the
| forwarding process, and not the fact that it also saved a copy of the file
| in a folder.

procmail, unless you have VERBOSE turned on, logs only errors and the
last thing done with an incoming letter.  If a letter triggers two recipes
to do two things (the first of which has a 'c' or an implied 'c'), only
the second one will show in the log, normally.

| Is there any way that I can have it show both (just so I don't have to
| remember that forwarding to this person means it's saved in one folder,
| while forwarding to another person means it's saved in another).

There's always a way.  The easiest might be to do the forwarding first and
the save to a folder second, so that your log will show the folder (which
seems to be more important) rather than the forwarding address.  The next
might be to give the folders names that reflect the forwarding addresses so
that you'll associate them more easily.  But yes, you can log both actions,
even with VERBOSE off.

| I think that it's possible to do if I have two recipes (one to save,
| and one to forward).  But is it possible in one nested recipe?

The format of the recipes doesn't make a difference.

Here's one way to do it:

	TARGET STASH

	:0
	* conditions for person 1
	{ TARGET=address1 STASH=folder1 }

	:0
	* conditions for person 2
	{ TARGET=address2 STASH=folder2 }

	:0
	* conditions for person 3
	{ TARGET=address3 STASH=folder3 }

	:
	$!${STASH+!}
	{
	 :0c:
	 $STASH

	 LOG="Saved to $STASH
"

	 :0
	 ! $TARGET
        }

David W. Tamkin  P. O. Box 3284  Skokie IL  60076-6284
[email-masked]   MCI Mail: 426-1818   +1 312 714 5610