[Avcheck] Patch: do not send warnings to mailing list etc.

Juri Haberland haberland@altus.de
Mon, 24 Sep 2001 15:20:29 +0200


This is a multi-part message in MIME format.
--------------B2D8BD95F925D0F78B7085BE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

I just finished a little patch to the infected template that will check
for mailing list specific headers and senders and if found will not send
a virus information back to the list.

Comments welcome!

Cheers,
Juri

-- 
  If each of us have one object, and we exchange them,
     then each of us still has one object.
  If each of us have one idea,   and we exchange them,
     then each of us now has two ideas.
--------------B2D8BD95F925D0F78B7085BE
Content-Type: text/plain; charset=us-ascii;
 name="template.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="template.diff"

--- infected.ex2/template.org	Mon Sep 24 14:57:13 2001
+++ infected.ex2/template	Mon Sep 24 14:59:41 2001
@@ -35,6 +35,7 @@
 #  4.. - recipients of a message
 shift 3 # $@/$* are original recipients.  Always enclose in ""!
 
+EGREP="/bin/egrep"
 HOST=`/bin/hostname`
 FROM=Antivirus-Daemon
 VIRUS_ALERT=virus-alert # set to empty to skip administrator email
@@ -95,10 +96,11 @@
 
 
 ################ send alert to sender
+$EGREP -iq "(^x-loop|^x-listname|^x-listmember|^mailing-list|^x-mailing-list|^list|^x-mailman|^precedence: (bulk|list|junk))" \
+    $MAIL && INFORM_SENDER="n"
+echo $SENDER | $EGREP -iq "(^$|daemon|request|bounce|mailer|postm|owner|lists|words|majordom|experts|\-(return|error))" \
+    && INFORM_SENDER="n"
 if [ ".$INFORM_SENDER" = .y ] ; then
-case "$SENDER" in
- ""|MAILER-DAEMON@*) ;; # do not send to special addresses
- *)
 
 (
   boundary="avcheck-sender-$$-`/bin/date '+%Y%m%d%H%M%S'`@$HOST"
@@ -148,7 +150,6 @@
   exit $EX_TEMPFAIL
 fi
 
-esac
 fi # INFORM_SENDER
 
 ################ send alert to recipients

--------------B2D8BD95F925D0F78B7085BE--