procmail
[Top] [All Lists]

formail khacks only in .procmailrc

1996-05-29 16:02:00
I'm having problems with formail.  I get the following error, only when
it's called from within .procmailrc:
   >Usage: formail [-bczfrktqY] [-D nnn idcache] [-p prefix] [-l folder]
   >        [-xXaAiIuU field] [-R ofield nfield]
   >   Or: formail [+nnn] [-nnn] [-bczfrktnedqBY] [-D nnn idcache] [-p prefix]
   >        [-m nnn] [-l folder] [-xXaAiIuU field] [-R ofield nfield]
   >        -s [prg [arg ...]]

The line from .procmailrc:
      | formail -i"Subject: "$USCSSSUBJECT | sendmail -io 
degennar(_at_)bmsrs(_dot_)usc(_dot_)edu
works fine when used from the commandline (in both csh and sh).

But it get even weirder.  If I replace the line:
        USCSSSUBJECT=USCSS:$SUBJECT
with a fixed assignment, like:
        USCSSSUBJECT=FixedTestSubject
I don't get an error, but I only get the mail from the #Temp recipe.

So, I am completely stumped.

Ok, here's my entire (just in case it's something stupid further up) procmailrc:

#!/bin/sh

PATH=$HOME/bin:/usr/bin:/usr/sbin:/usr/ucb:/bin:/usr/local/bin:.
MAILDIR=$HOME/Mail                # You'd better make sure it exists
DEFAULT=/var/spool/mail/$LOGNAME  # Let's store things in the system mailbox
LOGFILE=$MAILDIR/logfile
LOCKFILE=$HOME/.lockmail

SUBJECT=`formail -z -x"Subject:"`
USCSSSUBJECT=USCSS:$SUBJECT

# The next two recipies form a "Safety Net" that preserves
# the last 32 messages in the directory $MAILDIR/backup
:0 c
backup

:0 ic
| cd backup && rm -f dummy `ls -t msg.* | sed -e 1,32d`
# End of the "Saftey Net"

#This is the bad recipe
:0 c
| formail -i"Subject: "$USCSSSUBJECT | sendmail -oi 
degennar(_at_)bmsrs(_dot_)usc(_dot_)edu

#Temp -- Until I get the new subject stuff working
:0 c
!degennar(_at_)bmsrs(_dot_)usc(_dot_)edu
#END Temp Stuff

# Since I can't create lockfiles in the /var/spool/mail directory,
# I need to use a local one.
:0:default.lock
$DEFAULT

-----
Ray DeGennaro
degennar(_at_)bmsrs(_dot_)usc(_dot_)edu
-----
Those who swap freedom for safety, deserve neither. (Benjamin Franklin)


<Prev in Thread] Current Thread [Next in Thread>