Added STATFAIL_HELO and STATFAIL_NOHELO configuration directives.
authorMatthew Mondor <mmondor@pulsar-zone.net>
Mon, 17 Sep 2007 04:03:58 +0000 (04:03 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Mon, 17 Sep 2007 04:03:58 +0000 (04:03 +0000)
mmsoftware/mmmail/src/mmpop3d/mmpop3d.h
mmsoftware/mmmail/src/mmsmtpd/mmsmtpd.c
mmsoftware/mmmail/src/mmsmtpd/mmsmtpd.h

index 2aa5b4f..8d1f1d8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mmpop3d.h,v 1.23 2007/06/28 12:55:33 mmondor Exp $ */
+/* $Id: mmpop3d.h,v 1.24 2007/09/17 04:03:56 mmondor Exp $ */
 
 /*
  * Copyright (C) 2001-2007, Matthew Mondor
@@ -64,7 +64,7 @@
 /* DEFINITIONS */
 
 #define DAEMON_NAME    "mmpop3d"
-#define DAEMON_VERSION "mmmail-0.2.3/mmondor"
+#define DAEMON_VERSION "mmmail-0.2.4/mmondor"
 
 /* Negative states are used by the state swapper, others are real states */
 #define STATE_ERROR    -3
index 6c22785..a870762 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mmsmtpd.c,v 1.89 2007/07/11 05:24:24 mmondor Exp $ */
+/* $Id: mmsmtpd.c,v 1.90 2007/09/17 04:03:58 mmondor Exp $ */
 
 /*
  * Copyright (C) 2001-2007, Matthew Mondor
@@ -82,7 +82,7 @@
 
 MMCOPYRIGHT("@(#) Copyright (c) 2001-2007\n\
 \tMatthew Mondor. All rights reserved.\n");
-MMRCSID("$Id: mmsmtpd.c,v 1.89 2007/07/11 05:24:24 mmondor Exp $");
+MMRCSID("$Id: mmsmtpd.c,v 1.90 2007/09/17 04:03:58 mmondor Exp $");
 
 
 
@@ -304,6 +304,8 @@ main(int argc, char **argv)
        {CAT_BOOL, CAF_NONE, 0, 0, "RESOLVE_MX_RCPT", &CONF.RESOLVE_MX_RCPT},
        {CAT_BOOL, CAF_NONE, 0, 0, "REQUIRE_HELO", &CONF.REQUIRE_HELO},
        {CAT_BOOL, CAF_NONE, 0, 0, "FLOOD_PROTECTION", &CONF.FLOOD_PROTECTION},
+       {CAT_BOOL, CAF_NONE, 0, 0, "STATFAIL_HELO", &CONF.STATFAIL_HELO},
+       {CAT_BOOL, CAF_NONE, 0, 0, "STATFAIL_NOHELO", &CONF.STATFAIL_HELO},
        {CAT_BOOL, CAF_NONE, 0, 0, "STATFAIL_ADDRESS", &CONF.STATFAIL_ADDRESS},
        {CAT_BOOL, CAF_NONE, 0, 0, "STATFAIL_RELAY", &CONF.STATFAIL_RELAY},
        {CAT_BOOL, CAF_NONE, 0, 0, "STATFAIL_FLOOD", &CONF.STATFAIL_FLOOD},
@@ -377,6 +379,8 @@ main(int argc, char **argv)
     CONF.RESOLVE_MX_RCPT = FALSE;
     CONF.REQUIRE_HELO = FALSE;
     CONF.FLOOD_PROTECTION = TRUE;
+    CONF.STATFAIL_HELO = TRUE;
+    CONF.STATFAIL_NOHELO = TRUE;
     CONF.STATFAIL_ADDRESS = TRUE;
     CONF.STATFAIL_RELAY = TRUE;
     CONF.STATFAIL_FLOOD = TRUE;
@@ -687,6 +691,10 @@ all_helo(clientenv *clenv)
                    DEBUG_PRINTF("all_helo", "mmstrdup(%s)", args[1]);
                reply(fdb, 250, FALSE, "%s ok", clenv->iface->hostname);
            } else {
+               if (CONF.STATFAIL_HELO)
+                   mmstat(&clenv->pstat, STAT_UPDATE, 1,
+                           "mmsmtpd|failed|helo|%s",
+                           clenv->c_ipaddr);
                reply(fdb, 501, FALSE, "Invalid hostname");
                REGISTER_ERROR(clenv);
            }
@@ -747,6 +755,10 @@ all_mail(clientenv *clenv)
        }
 
     } else {
+       if (CONF.STATFAIL_NOHELO)
+           mmstat(&clenv->pstat, STAT_UPDATE, 1,
+                   "mmsmtpd|failed|nohelo|%s",
+                   clenv->c_ipaddr);
        reply(fdb, 503, FALSE, "Use HELO first");
        REGISTER_ERROR(clenv);
     }
index 6dfe166..53d7db7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mmsmtpd.h,v 1.41 2007/06/28 12:55:35 mmondor Exp $ */
+/* $Id: mmsmtpd.h,v 1.42 2007/09/17 04:03:58 mmondor Exp $ */
 
 /*
  * Copyright (C) 2001-2007, Matthew Mondor
@@ -64,7 +64,7 @@
 
 /* DEFINITIONS */
 #define DAEMON_NAME    "mmsmtpd"
-#define DAEMON_VERSION "mmmail-0.2.3/mmondor"
+#define DAEMON_VERSION "mmmail-0.2.4/mmondor"
 
 /* Negative states are used by the state swapper, others are real states */
 #define STATE_ERROR    -3
@@ -137,9 +137,10 @@ typedef struct config {
        MAX_DATA_LINES, MAX_DATA_SIZE, MAX_HOPS, FLOOD_MESSAGES,
        FLOOD_EXPIRES, FLOOD_CACHE, ASYNC_PROCESSES;
     bool RESOLVE_HOSTS, RESOLVE_HELO, RESOLVE_MX_MAIL, RESOLVE_MX_RCPT,
-       REQUIRE_HELO, FLOOD_PROTECTION, STATFAIL_ADDRESS, STATFAIL_RELAY,
-       STATFAIL_FLOOD, STATFAIL_FULL, STATFAIL_TIMEOUT, STATFAIL_EOF,
-       STATFAIL_FILTER, DELAY_ON_ERROR, RELAYING;
+       REQUIRE_HELO, FLOOD_PROTECTION, STATFAIL_HELO, STATFAIL_NOHELO,
+       STATFAIL_ADDRESS, STATFAIL_RELAY, STATFAIL_FLOOD, STATFAIL_FULL,
+       STATFAIL_TIMEOUT, STATFAIL_EOF, STATFAIL_FILTER, DELAY_ON_ERROR,
+       RELAYING;
 } CONFIG;