procmail
[Top] [All Lists]

RE: VirusSnag.rc - modify to clean & pass through

2004-02-20 07:15:04
from Dallman Ross...
The approach I would use would be via the NONDELIVER option 
that the INCLUDERC understands.  It then sets a flag on 
finding a virus, but otherwise send the message through.

After the INCLUDERC, you could have mores recipes including 
one with a filtering ("f"-flag) action.  E.g.,

  DROPPRIVS  = yes   # see "man procmailrc" for why
  NONDELIVER = on    # do not deliver viruses to virus folder
  VIRUSMSG   = /path/to/virusmsg.txt
  INCLUDERC  = /path/to/virussnag.rc
  :0
  * $ TRUE ?? ^^$VIR_A$VIR_B$VIR_Z^^
<SNIP><SNIP><SNIP>


Dallman,
It looks like you suggest putting the new recipes after INCLUDERC.
What I did was I set "NONDEL=yes" in virussnag.rc and I added the new
recipes (as shown below) inside the your virussnag.rc file at the end.
Same thing, right?

I now get this error in my log...

 "cat: /usr/local/etc/procmail_virussnag-msg.txt: Permission denied"

...when I have DROPPRIVS=yes. And the email is delivered as expected
with $HEADERS and $TENBODY printed, but $VIRUSMSG is missing.

But if I remove "DROPPRIVS=yes", then my lovely $VIRUSMSG is printed
in the email. What might be my trouble with DROPPRIVS=yes? And is
there a need to unset DROPPRIVS at the end?

#############################
# Dallman's virussnag.rc content is above
# Ken's new recopies below...

VIRUSMSG = /usr/local/etc/procmail_virussnag-msg.txt
DROPPRIVS = yes  # see "man procmailrc" for why

  :0  # "$TRUE" was defined inside virussnag.rc, as was any applicable
$VIR
  * $ TRUE ?? ^^$VIR_A$VIR_B$VIR_Z^^
    {
      :0 h  # this is an assignment recipe, not a delivering one
      HEADERS=| sed 's/^/> /'

      :0 b  #  this is an assignment recipe, not a delivering one
      #TENBODY=| head -10 | sed 's/^/> /'
      TENBODY=| sed 's/^/> /;15q'

      :0 fwbi
      | cat $VIRUSMSG; echo "$HEADERS"; echo ">"; echo "$TENBODY"
            
      LOG="VIRUSSNAG==>${TO} - "

      :0:
      $DEFAULT
    }

DROPPRIVS=


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