[Exim] Trivial patch

Etusivu
Poista viesti
Vastaa
Lähettäjä: michael
Päiväys:  
Vastaanottaja: exim-users
Aihe: [Exim] Trivial patch
Hello,

the following trivial patch allows to configure the maximum number of
unrecognised SMTP commands. I don't know why 5 was used as default.
To me, it seems as if a lower value might keep more spam away.

Michael
----------------------------------------------------------------------
--- globals.h.orig    2002-12-16 15:55:55.000000000 +0100
+++ globals.h    2002-12-16 15:57:20.000000000 +0100
@@ -460,6 +460,7 @@
 extern BOOL    smtp_input;             /* TRUE if input is via SMTP */
 extern int     smtp_load_reserve;      /* Only from reserved if load > this */
 extern int     smtp_mailcmd_count;     /* Count of MAIL commands */
+extern int     smtp_max_unrecognized;  /* Maximum number of unrecognized cmds */
 extern FILE   *smtp_out;               /* Incoming SMTP output file */
 extern int     smtp_port;              /* Alternate SMTP port number */
 extern uschar *smtp_ratelimit_hosts;   /* Rate limit these hosts */
--- globals.c.orig    2002-12-16 16:03:49.000000000 +0100
+++ globals.c    2002-12-16 15:58:00.000000000 +0100
@@ -753,6 +753,7 @@
 BOOL    smtp_input             = FALSE;
 int     smtp_load_reserve      = -1;
 int     smtp_mailcmd_count     = 0;
+int    smtp_max_unrecognized  = 5;
 FILE   *smtp_out               = NULL;
 int     smtp_port              = -1;
 uschar *smtp_etrn_command      = NULL;
--- readconf.c.orig    2002-12-16 16:00:05.000000000 +0100
+++ readconf.c    2002-12-16 16:00:38.000000000 +0100
@@ -175,6 +175,7 @@
   { "smtp_etrn_command",        opt_stringptr,   &smtp_etrn_command },
   { "smtp_etrn_serialize",      opt_bool,        &smtp_etrn_serialize },
   { "smtp_load_reserve",        opt_fixed,       &smtp_load_reserve },
+  { "smtp_max_unrecognized",    opt_int,     &smtp_max_unrecognized },
   { "smtp_ratelimit_hosts",     opt_stringptr,   &smtp_ratelimit_hosts },
   { "smtp_ratelimit_mail",      opt_stringptr,   &smtp_ratelimit_mail },
   { "smtp_ratelimit_rcpt",      opt_stringptr,   &smtp_ratelimit_rcpt },
--- smtp_in.c.orig    2002-12-16 16:00:49.000000000 +0100
+++ smtp_in.c    2002-12-16 16:00:58.000000000 +0100
@@ -2827,7 +2827,7 @@



     default:
-    if (unknown_command_count++ >= smtp_max_unrecognized)
+    if (unknown_command_count++ >= 5)
       {
       /* Just logs */
       synprot_error(L_smtp_syntax_error, 0, NULL, US"unrecognized command");