changeset 290:bb69fdc3acaa

Unique ip connection limits only apply to authenticated connections
author Carl Byington <carl@five-ten-sg.com>
date Fri, 21 Mar 2014 13:55:46 -0700
parents 6497944a9bd9
children 9f0d9fcb58dd
files configure.in dnsbl.spec.in src/dnsbl.cpp
diffstat 3 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Fri Mar 21 12:36:52 2014 -0700
+++ b/configure.in	Fri Mar 21 13:55:46 2014 -0700
@@ -1,6 +1,6 @@
 
 AC_PREREQ(2.59)
-AC_INIT(dnsbl,6.40,carl@five-ten-sg.com)
+AC_INIT(dnsbl,6.41,carl@five-ten-sg.com)
 AC_CONFIG_SRCDIR([config.h.in])
 AC_CONFIG_HEADER([config.h])
 
--- a/dnsbl.spec.in	Fri Mar 21 12:36:52 2014 -0700
+++ b/dnsbl.spec.in	Fri Mar 21 13:55:46 2014 -0700
@@ -103,6 +103,9 @@
 
 
 %changelog
+* Fri Mar 21 2014 Carl Byington <carl@five-ten-sg.com> - 6.41-1
+- Unique ip connection limits only apply to authenticated connections.
+
 * Wed Feb 05 2014 Carl Byington <carl@five-ten-sg.com> - 6.40-1
 - Fix possible segfault in mlfi_connect, hostaddr might be null.
 
--- a/src/dnsbl.cpp	Fri Mar 21 12:36:52 2014 -0700
+++ b/src/dnsbl.cpp	Fri Mar 21 13:55:46 2014 -0700
@@ -1203,15 +1203,14 @@
     if (dccifd_port) {
         priv.dccifd = new DccInterface(dccifd_port, &priv, priv.ip, priv.helo, priv.mailaddr);
     }
-    const char *uid = (priv.authenticated) ? priv.authenticated : priv.mailaddr;
-    if (priv.authenticated || dc.default_context->is_unauthenticated_limited(priv.mailaddr)) {
+    if (priv.authenticated) {
         int hourly, daily;
-        add_auth_address(uid, hourly, daily, priv.ip);
-        int h_limit = dc.default_context->find_address_limit(uid);
+        add_auth_address(priv.authenticated, hourly, daily, priv.ip);
+        int h_limit = dc.default_context->find_address_limit(priv.authenticated);
         int d_limit = dc.default_context->get_daily_address_multiple() * h_limit;
         if (debug_syslog > 1) {
             char msg[maxlen];
-            snprintf(msg, sizeof(msg), "connect for %s (%d %d addresses, %d %d limits)", uid, hourly, daily, h_limit, d_limit);
+            snprintf(msg, sizeof(msg), "connect for %s (%d %d addresses, %d %d limits)", priv.authenticated, hourly, daily, h_limit, d_limit);
             my_syslog(&priv, msg);
         }
         if ((hourly > h_limit) || (daily > d_limit)){