Hello All,
I am using the example sh script mentioned in "man procmail"
about postprocessing an already filled system mailbox.
#!/bin/sh
ORGMAIL=/usr/spool/mail/$LOGNAME
if cd $HOME &&
test -s $ORGMAIL &&
lockfile -r0 -l3600 .newmail.lock 2>/dev/null
then
trap "rm -f .newmail.lock" 1 2 3 15
umask 077
lockfile -l3600 -ml
cat $ORGMAIL >>.newmail &&
cat /dev/null >$ORGMAIL
lockfile -mu
formail -s procmail <.newmail &&
rm -f .newmail
rm -f .newmail.lock
fi
exit 0
The cron entries are working and the mail is being moved,
however, /usr/spool/mail/spicano mail messages appear to be
moving as a group rather than by individual messages?
Here is my .procmailrc:
$ more .procmailrc
PATH=/usr/bin:/usr/ucb:/bin:/usr/local/bin:.
MAILDIR=$HOME/Mail
DEFAULT=$HOME/Mail/INBOX.spool
LOGFILE=$HOME/.procmail/log-file
LOCKFILE=$HOME/.procmail/lock-file
# Set on when debugging
VERBOSE=on
:0
* ^Subject:.*passdown
passdown.spool
:0
* ^Subject:.*about nbm
netbatch.spool
# Anything that has not been delivered by now will go to $DEFAULT
# using LOCKFILE=$DEFAULT$LOCKEXT
I thought the "-s" option in formail takes care of this,
however, all my mail is moving in the the 1st matched
Subject line.
[1] if I have 2 emails in my system spool with the subjects
"passdown" and "about nbm", these 2 messages go into
passdown.spool
procmail: [221598] Fri Oct 11 20:11:55 1996
procmail: Match on "^Subject:.*passdown"
procmail: Assigning "LASTFOLDER=passdown.spool"
procmail: Opening "passdown.spool"
From spicano Fri Oct 11 20:11:38 1996
Subject: passdown
Folder: passdown.spool 962
procmail: [221598] Fri Oct 11 20:11:56 1996
procmail: Notified comsat:
"spicano(_at_)5051:/usr/guest/spicano/Mail/passdown.spool"
procmail: Unlocking "/usr/guest/spicano/.procmail/lock-file"
[2] if I have 2 emails in my system with the subjects "about
nbm" and "passdown", these 2 messages go into
passdown.spool
procmail: [116291] Fri Oct 11 20:13:27 1996
procmail: No match on "^Subject:.*passdown"
procmail: No match on "^Subject:.*nbm status"
procmail: Match on "^Subject:.*about nbm"
procmail: Assigning "LASTFOLDER=netbatch.spool"
procmail: Opening "netbatch.spool"
From spicano Fri Oct 11 20:13:15 1996
Subject: about nbm
Folder: netbatch.spool 971
procmail: [116291] Fri Oct 11 20:13:28 1996
procmail: Notified comsat:
"spicano(_at_)5378:/usr/guest/spicano/Mail/netbatch.spool"
procmail: Unlocking "/usr/guest/spicano/.procmail/lock-file"
I tried using "formail -ds procmail", but with the same
results. Here is the contents of my raw spool mail file
before the shell script runs:
$ cat /usr/spool/mail/spicano
From spicano Fri Oct 11 20:16:34 1996
Received: from ptdis47 (ptdis47.ra.intel.com) by ptdcs2.intel.com with SMTP
id AA09465
(5.65c+/IDA-1.4.4 for <spicano>); Fri, 11 Oct 1996 20:16:33 -0700
From: Silvio Picano <spicano(_at_)ptdcs2(_dot_)intel(_dot_)com>
Received: by ptdis47 (5.65c/SCDT-RS6000)
id AA32239; Fri, 11 Oct 1996 20:16:32 -0700
Date: Fri, 11 Oct 1996 20:16:32 -0700
Message-Id: <199610120316(_dot_)AA32239(_at_)ptdis47>
To: spicano(_at_)ptdcs2(_dot_)intel(_dot_)com
Subject: about nbm
about nbm
From spicano Fri Oct 11 20:16:43 1996
Received: from ptdis47 (ptdis47.ra.intel.com) by ptdcs2.intel.com with SMTP
id AA09470
(5.65c+/IDA-1.4.4 for <spicano>); Fri, 11 Oct 1996 20:16:41 -0700
From: Silvio Picano <spicano(_at_)ptdcs2(_dot_)intel(_dot_)com>
Received: by ptdis47 (5.65c/SCDT-RS6000)
id AA20979; Fri, 11 Oct 1996 20:16:41 -0700
Date: Fri, 11 Oct 1996 20:16:41 -0700
Message-Id: <199610120316(_dot_)AA20979(_at_)ptdis47>
To: spicano(_at_)ptdcs2(_dot_)intel(_dot_)com
Subject: passdown
passdown
passdown
passdown
passdown
passdown
$
Actually I tried the -d, -e, and -b options w/o any luck??
Any help is much appreciated.
Thanks.
Silvio