According to the courierfilter.sgml documentation, mail is filtered only if
its source is listed in the enablefiltering configuration file.  However my
enablefiltering file contains only "esmtp" and mail originating locally is
still filtered:
[EMAIL PROTECTED]:~$ cat /etc/courier/enablefiltering
esmtp
[EMAIL PROTECTED]:~$ cat sample-virus-simple.txt | /usr/lib/sendmail [EMAIL 
PROTECTED]
550 5.7.1 Message content rejected, id=30786-6 - VIRUS: EICAR-AV-Test, 
EICAR-AV-Test
sendmail: Unable to submit message.

Looking at courier/submit{,2}.C, it appears that the enablefiltering file is
used to set the nofilter variable.  I did a text search for nofilter, and it
is used only to determine whether or not to run the rewrite library's
rw_filter_msg function.  When the global filter is run in
SubmitFile::MessageEnd, there is a hardcoded check for the dsn sending
module, but no check on the enablefiltering file.

Here is a patch to fix this:
--- courier/submit.C.orig       2005-01-30 05:22:52.000000000 +0000
+++ courier/submit.C    2005-02-08 19:54:36.000000000 +0000
@@ -1739,7 +1739,7 @@
                /* Make sure bounces go through */
 
                mf->flag=my_rcptinfo.submitfile.MessageEnd(my_rcptinfo.rcptnum,
-                       my_rcptinfo.whitelisted_only, mf->module->name);
+                       my_rcptinfo.whitelisted_only, !nofilter);
        }
 }
 
--- courier/submit.h.orig       2004-05-16 03:43:31.000000000 +0100
+++ courier/submit.h    2005-02-08 19:54:36.000000000 +0000
@@ -130,7 +130,7 @@
 
        void MessageStart();
        void Message(const char *);
-       int MessageEnd(unsigned, int, const char *);
+       int MessageEnd(unsigned, int, int);
 static CString get_msgid_for_filtering(unsigned, void *);
 
 static void interrupt();
--- courier/submit2.C.orig      2005-01-30 05:22:52.000000000 +0000
+++ courier/submit2.C   2005-02-08 19:54:36.000000000 +0000
@@ -820,7 +820,7 @@
 /* ------------ */
 
 int SubmitFile::MessageEnd(unsigned rcptnum, int iswhitelisted,
-                          const char *sending_module)
+                          int filter_enabled)
 {
 int    is8bit=0, dorewrite=0, rwmode=0;
 const  char *mime=getenv("MIME");
@@ -945,7 +945,7 @@
 
 SubmitFile *voidp=this;
 
-       if (strcmp(sending_module, "dsn") &&
+       if (filter_enabled &&
            run_filter(dfile, num_control_files_created,
                       iswhitelisted,
                       &SubmitFile::get_msgid_for_filtering, &voidp))

-- 
Martin Orr
Linux Administrator,
Methodist College Belfast


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to