Except that you lose the ability for the message to be hardlinked into
each folder. rcvstore doesn't help either, as it accepts only one
destination.
Anyway, I added the functionality I wanted (extending LASTFOLDER) and
have submitted a patch to Stephen (at his request).
I understand the limitations. My original "pf_save.rc" *did* do the
hardlink for MH-style folder saving, but it didn't do unseen sequence
maintenance. My original pf-save.rc is below; it *does* do hard links,
it *does not* do rcvstore.
In order to do the unseen sequence maintenance correctly, procmail would
have to read the user's ~/.mh_profile file for the tag: Unseen-Sequence:
and use the corresponding value as the name of the sequence.
I have some questions, asked with some bit of incredulity:
* Does your patch cause procmail to read the user's ~/.mh_profile?
* Does it update the unseen sequence for each folder?
Don't get me wrong: I really like MH (I use it almost exclusively), but
I would find it very interesting if Stephen supported this highly
specific MH_related patch, and yet not support a more generic patch to
implement functions.
Alan
============================= cut here ===================================
# pf-save.rc
#
# $Id: pf-save.rc,v 1.1.1.1 1996/08/16 18:27:12 stebbens Exp $
#
# Author: Alan K. Stebbens <stebbens(_at_)sgi(_dot_)com>
#
# Procmail recipe file to save the current message to
# a list of one or more folders set by pf-check.rc.
#
# You may wish to set the variable PF_DEST before invoking.
#
# INCLUDERC=pf-save.rc
#
# If the message is filed into a folder, LOGABSTRACT is
# set to "off" so a duplicate log is not created.
:0
* PF_DEST ?? .
{
# Add a new X-Filed if necessary
:0 fh
* !^X-Filed:
| formail -A "X-Filed: $PF_DEST"
# Else, if there is already a header, possibly append to it
:0 E
{
OLD_PF_DEST=`formail -zxX-Filed:`
:0 fh
* $!^X-Filed:.*$PF_DEST
|formail -I"X-Filed: $OLD_PF_DEST $PF_DEST"
}
# If filing into MH folders, use one copy and procmail will take
# care of linking.
:0 c
* PF_DEST ?? /\.$
$PF_DEST
# If not filing into MH folders, use recursive filing
:0 E
{
DEST=`echo $PF_DEST | cut -d' ' -f1`
PF_DEST=`echo $PF_DEST' ' | cut -d' ' -f2-`
# File into the first folder now
:0 c:
$DEST
# Possibly file into the 2nd and other folders with recursion
# It must be non-blanks, and not identical to the already filed DEST
:0 c
* PF_DEST ?? [^ ]
* $! DEST ?? $PF_DEST
|procmail -pm PF_RECURSE=yes pf-save.rc
# If we were recursing, don't file multiple copies into DEFAULT
:0
* PF_RECURSE ?? yes
{ HOST=_stop_now_ }
}
LOGABSTRACT=off
}