procmail
[Top] [All Lists]

Re: spawning an external app

2001-02-17 22:36:22
Justin Shore <listuser(_at_)vinnie(_dot_)ksu(_dot_)ksu(_dot_)edu> writes:
...
Excellent.  I see now.  I just changed everything around to fix the 
variable expanding problem and all seems to be working well.  Here's 
the current recipe:

VIRUSADDR=virus-alert(_at_)sktc(_dot_)net
:0 h
* !   ^FROM_DAEMON
* ! $ ^X-Loop: $\VIRUSADDR
*     ^(Subject: Here you have, \;o\)|Subject: Neues von Ihrem 
Internetdienstleister - Robert T. Online informiert)
| (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

Semicolons are not special in regexps, so don't escape them.  You can
also 'factor out' the "Subject: " bit:

*     ^Subject: (Here you have, ;o\)|Neues von Ihrem Internetdienstleister - 
Robert T. Online informiert)


It still wraps, but not as badly, as it's clearer that it's just a match
against the Subject: header.


I think I'll migrate my generic Sendmail subject line filters to this 
later tonight (for Melissa and the original Hybris variant).  This 
leaves me with two questions.  If I wanted to send the form letter 
like it does now and dump the incoming message (matching message) 
into a different mail spool (like a quarantine) what would be the 
best way to do that?  I imagine I can find a way, just curious if 
there's a recommended way that causes the least overhead.

        
        :0 ch
        * current recipes stuff
        | (formail -r .....

        :0 A
        alternate/mail/spool/$LOGNAME


      The last question is about logging.  I turned off verbose 
logging once the recipe was working correctly and watched the 
logfile.  Is there any way to make it only log message that match a 
recipe?  The log file is currently logging all messages, matching a 
recipe or not.  I could probably set LOGFILE to /dev/null, but I'd 
like to know when procmail actually does something.

Procmail outputs the log message after performing the recipe action.
If you set LOGFILE to /dev/null before a recipe, it won't be logged
(well, it'll be logged to /dev/null...).


Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail