R. McPherson wrote:
I am trying to use a simple script to sendmail straight back to a known
address (rmcphers(_at_)mamba(_dot_)bio(_dot_)uci(_dot_)edu) which is my
alternate account.
Procmail will never run sendmail. I can run sendmail from the command
prompt and it works fine.
[snip]
.procmailrc:
PATH=usr/lib/:/bin:/usr/ucb:/usr/local/bin:/dcs/bin:/u5/ea/rjmcpher:usr/bin:
MAILDIR=$HOME/Mail #you'd better make sure it exists
LOGFILE=$HOME/from #recommended
VERBOSE=on
SENDMAIL=/usr/lib/sendmail
:0 h
* ^FROM:(_dot_)*(_at_)mamba*
* !^X-Loop: rjmcpher(_at_)uci(_dot_)edu
| (formail -r -A"Precedence: junk" \
-A "X-Loop: rjmcpher(_at_)uci(_dot_)edu" ; \
echo "Got it") | sendmail
rmcphers(_at_)mamba(_dot_)bio(_dot_)uci(_dot_)edu
^^^^^^^^
:0
* ^Subject:.*Victim*
/dev/null
Is sendmail in your path? Note that you're piping to sendmail
and not $SENDMAIL, so setting SENDMAIL did nothing. I saw another
post suggesting you set SHELL=/bin/sh (I think this is a good idea
since then you *know* what you're running), but I don't see anything
above that looks to me to be shell-specific.
You probably wanted:
echo "Got it") | $SENDMAIL
rmcphers(_at_)mamba(_dot_)bio(_dot_)uci(_dot_)edu
Aside from that, you should note that:
* ^FROM:(_dot_)*(_at_)mamba*
is the same as matching "^FROM:(_dot_)*(_at_)mamb"
and that:
* ^Subject:.*Victim*
will match "^Subject:.*victi"
and neither is probably what you intend.
You probably want to omit the trailing "*", since this is regexp and
not shell globbing, and "*" here means "zero or more occurrences
of the preceding".
Cheers,
Stan Ryckman (stanr(_at_)tiac(_dot_)net)