Re: [Exim] local_scan timeout

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Physicman
Fecha:  
A: exim-users
Asunto: Re: [Exim] local_scan timeout
--
--
On Mon, 23 Jun 2003 10:09:53 +0100 (BST)
Philip Hazel <ph10@???> wrote:

>
> On Fri, 20 Jun 2003, Christopher Bodenstein wrote:
>
> > I just noticed that when the local_scan timeouts, exim will then
> > defer the mail.
> > Is there a way to tell exim to accept the mail instead of deferring
> > it?
>
> No. Idea noted.
>

Ok, here is a very ugly hack that probably breaks a lot of things, but
strangely enough it seems to work for me.

It just adds a configuration option (boolean)
local_scan_accept_on_timeout which defaults to false.

I don't know if this is of some use for you, but just in case here is
the diff ;)

> --
> Philip Hazel            University of Cambridge Computing Service,
> ph10@???      Cambridge, England. Phone: +44 1223 334714.
> Get the Exim 4 book:    http://www.uit.co.uk/exim-book

>
>


Best regards,

Chris

--
 ,''`.  Christopher `Physicman' Bodenstein <cb@???>
 : :' :  Physicman.Net     :   http://www.physicman.net/
 `. `'   Debian GNU/Linux  :   http://www.debian.org/
   `-    Debian IPv6       :   http://people.debian.org/~csmall/ipv6/
--
diff -Nur exim-4.20/src/globals.c exim-4.20-modified/src/globals.c
--- exim-4.20/src/globals.c    Mon May 12 15:39:19 2003
+++ exim-4.20-modified/src/globals.c    Mon Jun 23 21:27:04 2003
@@ -286,6 +286,7 @@
 uschar *auth_defer_msg         = US"reason not recorded";
 uschar *auth_defer_user_msg    = US"";
 int     auto_thaw              = 0;
+uschar *av_scanner             = US"sophie:/var/run/sophie";


 BOOL    background_daemon      = TRUE;
 uschar *base62_chars=
@@ -400,6 +401,8 @@
 BOOL    deliver_selectstring_regex = FALSE;
 uschar *deliver_selectstring_sender = NULL;
 BOOL    deliver_selectstring_sender_regex = FALSE;
+int     demime_errorlevel      = 0;
+uschar *demime_reason          = NULL;
 BOOL    disable_logging        = FALSE;


 uschar *dns_again_means_nonexist = NULL;
@@ -443,6 +446,7 @@
 uschar *filter_test            = NULL;
 uschar *filter_thisaddress     = NULL;
 int     finduser_retries       = 0;
+uschar *found_extension        = NULL;
 uschar *freeze_tell            = NULL;


 uschar *gecos_name             = NULL;
@@ -516,6 +520,7 @@
 ip_address_item  *local_interface_data = NULL;
 uschar *local_scan_data        = NULL;
 int     local_scan_timeout     = 5*60;
+BOOL    local_scan_accept_on_timeout    = FALSE;
 BOOL    local_sender_retain    = FALSE;
 tree_node *localpartlist_anchor= NULL;
 int     localpartlist_count    = 0;
@@ -565,6 +570,7 @@
 uschar *lookup_value           = NULL;


 macro_item  *macros            = NULL;
+uschar *malware_name           = NULL;
 int     max_username_length    = 0;
 int     message_age            = 0;
 uschar *message_body           = NULL;
@@ -680,6 +686,7 @@
 const pcre *regex_PIPELINING   = NULL;
 const pcre *regex_SIZE         = NULL;
 const pcre *regex_ismsgid      = NULL;
+uschar *regex_match_string     = NULL;
 int     remote_delivery_count  = 0;
 int     remote_max_parallel    = 2;
 uschar *remote_sort_domains    = NULL;
@@ -846,6 +853,11 @@
 int     smtp_rlr_threshold     = INT_MAX;
 BOOL    smtp_use_pipelining    = FALSE;
 BOOL    smtp_use_size          = FALSE;
+uschar *spamd_address          = US"127.0.0.1 783";
+uschar *spam_bar               = NULL;
+uschar *spam_report            = NULL;
+uschar *spam_score             = NULL;
+uschar *spam_score_int         = NULL;
 BOOL    split_spool_directory  = FALSE;
 uschar *spool_directory        = US SPOOL_DIRECTORY
                "\0<--------------Space to patch spool_directory->";
diff -Nur exim-4.20/src/globals.h exim-4.20-modified/src/globals.h
--- exim-4.20/src/globals.h    Mon May 12 15:39:19 2003
+++ exim-4.20-modified/src/globals.h    Mon Jun 23 21:27:04 2003
@@ -129,6 +129,7 @@
 extern uschar *auth_defer_msg;         /* Error message for log */
 extern uschar *auth_defer_user_msg;    /* Error message for user */
 extern int     auto_thaw;              /* Auto-thaw interval */
+extern uschar *av_scanner;             /* AntiVirus scanner to use for the malware condition */


 extern BOOL    background_daemon;      /* Set FALSE to keep in foreground */
 extern uschar *base62_chars;           /* Table of base-62 characters */
@@ -210,6 +211,8 @@
 extern BOOL    deliver_selectstring_regex; /* String is regex */
 extern uschar *deliver_selectstring_sender; /* For selecting by sender */
 extern BOOL    deliver_selectstring_sender_regex; /* String is regex */
+extern int     demime_errorlevel;      /* Severity of MIME error */
+extern uschar *demime_reason;          /* Reason for broken MIME container */
 extern BOOL    disable_logging;        /* Disables log writing when TRUE */


 extern uschar *dns_again_means_nonexist; /* Domains that are badly set up */
@@ -250,6 +253,7 @@
 extern uschar *filter_test;            /* Run as a filter tester on this file */
 extern uschar *filter_thisaddress;     /* For address looping */
 extern int     finduser_retries;       /* Retry count for getpwnam() */
+extern uschar *found_extension;        /* demime acl condition: file extension found */
 extern uschar *freeze_tell;            /* Message on (some) freezings */


 extern uschar *gecos_name;             /* To be expanded when pattern matches */
@@ -303,6 +307,7 @@
 extern optionlist local_scan_options[];/* Option list for local_scan() */
 extern int     local_scan_options_count; /* Size of the list */
 extern int     local_scan_timeout;     /* Timeout for local_scan() */
+extern BOOL    local_scan_accept_on_timeout;    /* Accept mail when the local_scan timeouts */
 extern BOOL    local_sender_retain;    /* Retain Sender: (with no From: check) */
 extern tree_node *localpartlist_anchor;/* Tree of defined localpart lists */
 extern int     localpartlist_count;    /* Number defined */
@@ -322,6 +327,7 @@
 extern uschar *lookup_value;           /* Value looked up from file */


 extern macro_item *macros;             /* Configuration macros */
+extern uschar *malware_name;           /* Name of virus or malware ("W32/Klez-H") */
 extern int     max_username_length;    /* For systems with broken getpwnam() */
 extern int     message_age;            /* In seconds */
 extern uschar *message_body;           /* Start of message body for filter */
@@ -421,6 +427,7 @@
 extern const pcre  *regex_PIPELINING;  /* For recognizing PIPELINING */
 extern const pcre  *regex_SIZE;        /* For recognizing SIZE settings */
 extern const pcre  *regex_ismsgid;     /* Compiled r.e. for message it */
+extern uschar *regex_match_string;     /* regex that matched a line (regex ACL condition) */
 extern int     remote_delivery_count;  /* Number of remote addresses */
 extern int     remote_max_parallel;    /* Maximum parallel delivery */
 extern uschar *remote_sort_domains;    /* Remote domain sorting order */
@@ -511,6 +518,11 @@
 extern BOOL    smtp_use_pipelining;    /* Global for passed connections */
 extern BOOL    smtp_use_size;          /* Global for passed connections */
 extern BOOL    split_spool_directory;  /* TRUE to use multiple subdirs */
+extern uschar *spamd_address;          /* address for the spamassassin daemon */
+extern uschar *spam_bar;               /* the spam "bar" (textual representation of spam_score) */
+extern uschar *spam_report;            /* the spamd report (multiline) */
+extern uschar *spam_score;             /* the spam score (float) */
+extern uschar *spam_score_int;         /* spam_score * 10 (int) */
 extern uschar *spool_directory;        /* Name of spool directory */
 extern int     string_datestamp_offset;/* After insertion by string_format */
 extern BOOL    strip_excess_angle_brackets; /* Surrounding route-addrs */
diff -Nur exim-4.20/src/readconf.c exim-4.20-modified/src/readconf.c
--- exim-4.20/src/readconf.c    Mon May 12 15:39:21 2003
+++ exim-4.20-modified/src/readconf.c    Mon Jun 23 21:27:56 2003
@@ -152,6 +152,7 @@
   { "allow_utf8_domains",       opt_bool,        &allow_utf8_domains },
   { "auth_advertise_hosts",     opt_stringptr,   &auth_advertise_hosts },
   { "auto_thaw",                opt_time,        &auto_thaw },
+  { "av_scanner",               opt_stringptr,   &av_scanner },
   { "bi_command",               opt_stringptr,   &bi_command },
   { "bounce_message_file",      opt_stringptr,   &bounce_message_file },
   { "bounce_message_text",      opt_stringptr,   &bounce_message_text },
@@ -212,6 +213,7 @@
   { "local_from_prefix",        opt_stringptr,   &local_from_prefix },
   { "local_from_suffix",        opt_stringptr,   &local_from_suffix },
   { "local_interfaces",         opt_stringptr,   &local_interfaces },
+  { "local_scan_accept_on_timeout", opt_bool,     &local_scan_accept_on_timeout },
   { "local_scan_timeout",       opt_time,        &local_scan_timeout },
   { "local_sender_retain",      opt_bool,        &local_sender_retain },
   { "localhost_number",         opt_stringptr,   &host_number_string },
@@ -297,6 +299,7 @@
   { "smtp_receive_timeout",     opt_time,        &smtp_receive_timeout },
   { "smtp_reserve_hosts",       opt_stringptr,   &smtp_reserve_hosts },
   { "smtp_return_error_details",opt_bool,        &smtp_return_error_details },
+  { "spamd_address",            opt_stringptr,   &spamd_address },
   { "split_spool_directory",    opt_bool,        &split_spool_directory },
   { "spool_directory",          opt_stringptr,   &spool_directory },
   { "strip_excess_angle_brackets", opt_bool,     &strip_excess_angle_brackets },
diff -Nur exim-4.20/src/receive.c exim-4.20-modified/src/receive.c
--- exim-4.20/src/receive.c    Mon May 12 15:39:21 2003
+++ exim-4.20-modified/src/receive.c    Mon Jun 23 21:27:18 2003
@@ -294,19 +294,27 @@
 function.


 Argument:  the signal number
-Returns:   nothing
+Returns:   TRUE if local_scan_accept_on_timeout is set to TRUE
+       FALSE if anything else.
 */


-static void
+BOOL
 local_scan_timeout_handler(int sig)
 {
 sig = sig;    /* Keep picky compilers happy */
+if(local_scan_accept_on_timeout)
+{
+    log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() function timed out, but configured to accept mail (local_scan_accept_on_timeout = TRUE)"); /* Does not return */
+    return TRUE;
+}
+else
+{
 log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() function timed out - "
   "message temporarily rejected (size %d)", message_size);
 receive_bomb_out(US"local verification problem");   /* Does not return */
+return FALSE;
+}
 }
-
-


 /*************************************************
 *            local_scan() crashed                *
--
[ Content of type application/pgp-signature deleted ]
--