Re: [EXIM] A couple of wish-list items - filter files and in…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Joe Vaughan
Date: 1998-01-05 17:55 -000
À: Philip Hazel
CC: Alistair Young, exim-users
Sujet: Re: [EXIM] A couple of wish-list items - filter files and intermittent connections...
> Suggestions noted, but I've just started on the major reorganization of
> the code to modularize lookup types, so it will be a while before I get
> to think about other new features.
>


On the first request,

I took the liberty of adding an 'excuse' command to the filtering
commands some time ago just for this reason...

Here is a patch against 1.80 (it's just against filter.c which is the
only file affected.

I use it simply as follows (one simple example from my *huge* spam filter )

# <example>
if ($h_X-Advertisement is not "")
        then excuse "Header X-Advertisement is set: $h_X-Advertisement" 
endif


#</example>

This puts X-FilterExcuse: header(s) (more than one if called multiple
times) into the message headers

Later in my (site wide) filter I check for X-FilterExcuse and keep or
drop the mail as appropriate...

Regards

JoeV.
*  Joe Vaughan, Systems Manager, EUnet Ireland     joev@???  *
*  Phone:+353-1-6790832  Fax:+353-1-6799634  http://www.EUnet.ie  *
 -------------------------------------------------------


Here's the patch. (very small so don't freak!)

 --------------------- cut here -----------------------
--- filter.c.orig       Tue Dec  9 13:35:15 1997
+++ filter.c    Tue Dec  9 13:44:48 1997
@@ -63,6 +63,9 @@
 of command words which follows. */


 enum { deliver_command, elif_command, else_command, endif_command,
+       /* JoeV - 17-Nov-97 - Quick hack for spam reject excuse support */
+       excuse_command,
+
        finish_command, fail_command, freeze_command, if_command,
        log_command, logfile_command,
        mail_command, noerror_command, pipe_command, save_command,
@@ -73,6 +76,7 @@
   "elif",
   "else",
   "endif",
+  "excuse",
   "finish",
   "fail",
   "freeze",
@@ -731,6 +735,7 @@
   case pipe_command:
   case save_command:
   case testprint_command:
+  case excuse_command:


   ptr = nextitem(ptr, buffer, sizeof(buffer), FALSE);
   if (*buffer == 0)
@@ -1686,6 +1691,14 @@
       }
     break;


+    /* JoeV - 17-Nov-97 - Hack for spam excuse handling */
+    case excuse_command:
+         
+    s = expand_string((char *)(commands->args[0]));
+    header_add(htype_other,
+               "X-FilterExcuse: %s\n",s);
+    break;
+ 
     /* Freeze and fail are available only when there is somewhere to pass
     back the action; this is the case only for system filtering. These
     commands are rejected at parse time otherwise. */
@@ -1942,6 +1955,7 @@
     case pipe_command:
     case save_command:
     case testprint_command:
+    case excuse_command:
     if (this->args[0] != NULL) store_free(this->args[0]);
     break;




--
*** Exim information can be found at http://www.exim.org/ ***