procmail
[Top] [All Lists]

Re: spawning an external app

2001-02-17 20:47:07
At 7:53 PM -0600 2/17/01, Philip Guenther wrote:
Justin Shore <listuser(_at_)vinnie(_dot_)ksu(_dot_)ksu(_dot_)edu> writes:
I'm having getting an external app to spawn as an action.  Could
someone take a peak at my recipe and offer some advice?  Thanks
...
This one doesn't work though.  The error follows the recipe:

 >VIRUSADDR=virus-alert(_at_)blah(_dot_)net
 >:0 h c
* !^FROM_DAEMON
* !^X-Loop: $VIRUSADDR
* ^Subject: Test bounce message
| (formail -r \
-I"Precedence: junk" \
-I"From: SKTC Virus Alert Daemon <$VIRUSADDR>" \
-I"Subject: [Virus Alert]  You've been infected" \
-A"X-Loop: $VIRUSADDR" ; \
/bin/cat "/etc/mail/vbs.ss-txt") | $SENDMAIL -t
...
procmail: Assigning "LASTFOLDER= (formail -r \
-I"Precedence: junk" \
-I"From: SKTC Virus Alert Daemon <$VIRUSADDR>" \
-I"Subject: [Virus Alert]  You've been infected" \
-A"X-Loop: $VIRUSADDR" ; \
procmail: Skipped "/bin/cat "/etc/mail/vbs.ss-txt") | $SENDMAIL -t"

Procmail doesn't think the "cat" line is part of the action.  That implies
that the newline before it (on the X-Loop: line) is not preceeded by
a backslash.  _That_ implies that there are spaces or tabs after the
backslash on that line.  Remove them and give it another try (check the
rest of your rcfile for other occurences while you're at it).

Whitespace... I never thought of that. That actually prompted me to try something else. I checked there wasn't any whitespace after the slash on the X-Loop line but... there were a few lines in my recipe that I had commented out and didn't include. I thought that commenting my test lines out were enough. I wasn't thinking about the comments coming up in the middle of a command. Stupid me! This is how it really reads:

VIRUSADDR=virus-alert(_at_)sktc(_dot_)net
:0 h c
* !^FROM_DAEMON
* !^X-Loop: $VIRUSADDR
* ^Subject: Test bounce message
#| (formail -r -I"Precedence: junk" \
| (formail -r \
-I"Precedence: junk" \
-I"From: SKTC Virus Alert Daemon <$VIRUSADDR>" \
-I"Subject: [Virus Alert]  You've been infected" \
-A"X-Loop: $VIRUSADDR" ; \
#echo "Mail received.") | $SENDMAIL -t
#echo "Mail received.") > /tmp/blah
`/bin/cat "/etc/mail/vbs.ss-txt"`) | $SENDMAIL -t
# -F SKTC Virus Alert Daemon -f $VIRUSADDR

I removed the two echo lines. Playing around after I sent my plea for help I added back ticks. They stopped it from working, as expected. I removed those and it worked like a champ. Here's my final recipe:

VIRUSADDR=virus-alert(_at_)sktc(_dot_)net
:0 h c
* !^FROM_DAEMON
* !^X-Loop: $VIRUSADDR
* ^Subject: Test bounce message
| (formail -r \
-I"From: SKTC Virus Alert Daemon <$VIRUSADDR>" \
-I"Subject: [Virus Alert]  You've been infected" \
-A"X-Loop: $VIRUSADDR" ; \
/bin/cat "/etc/mail/vbs.ss-txt") | $SENDMAIL -t

If you'd like to test it, send a message to shorej(_at_)maple(_dot_)sktc(_dot_)net, subject: "Test bounce message". Are there any better ways of doing this? Can anyone think of any downsides to doing this? I think this is more helpful to virus ridden users than a 553. Thanks for your help, Philip! It's much appreciated

Justin
--

--
Justin Shore       K-State Linux Distro Mirror, Sysadmin
macdaddy(_at_)vinnie(_dot_)ksu(_dot_)ksu(_dot_)edu
<http://vinnie.ksu.ksu.edu/mirror/rpm2html>
<ftp://vinnie.ksu.ksu.edu/pub/mirror/linux>

*Internet2 Users*
<ftp://quest.ksu.ksu.edu/pub/mirror/linux>
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail