procmail
[Top] [All Lists]

Re: pipe through clamav problem

2006-02-25 16:58:27
On Sat, February 25, 2006 23:36, Dallman Ross said:
----------------------------------------------------
  :0  # don't bother calling clamscan if neither condition true
  * ! ^Content-Type:.*(attachment|multipart)
  * ! ^FROM_MAILER
  { SWITCHRC }

  NL = '
' VIRUS = ${VIRUS:-${TRASH:-VIRUS}}

  CS_OUT=`clamdscan --mbox --no-summary --stdout -`
  CS_EXIT = $?

  :0:  # look for any clamscan problems ( exit code > 1 )
  *          -1^0
  * $  $CS_EXIT^0
  clamscan_problem

  :0 D  # capture right side of var; isolate virus name
  * CS_OUT ?? : \/.* FOUND$
  * MATCH  ?? ^^\/.* ()
  # below brackets contain a caret, a space, and a tab
  * MATCH  ?? ^^\/.*[^        ]
  {
      LOG = "$NL Clamscan identified $MATCH $NL"

      :0 fw h  # attach an X-header telling us what matched
      | formail -I "X-Clamscan: $MATCH"

      :0:  # leave off second ':' for maildir/directory saves
      $VIRUS
  }

Is there a reason you use clamdscan instead of clamscan?
Also are there advantages over using clamsmtpd?

Just curious...  ;-)

-- 
Francesco Peeters
----
GPG Key = AA69 E7C6 1D8A F148 160C  D5C4 9943 6E38 D5E3 7704
If your program doesn't recognize my signature, please visit
http://www.CAcert.org/index.php?id=3 to retrieve the Root CA certificate.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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