summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTony Finch <dot@dot.at>2006-06-07 15:06:25 +0000
committerTony Finch <dot@dot.at>2006-06-07 15:06:25 +0000
commit90fc3069076c77a9b7b9f8c1112f62ca280cc8bc (patch)
tree792691c11dcaa54310127f5c984c5781518492ab /src
parentc59f578128f0f5a4c5338f26b6ea6314ea33bd47 (diff)
Fix from Dean Brooks for ratelimit per_rcpt in acl_not_smtp.
Diffstat (limited to 'src')
-rw-r--r--src/ACKNOWLEDGMENTS3
-rw-r--r--src/src/acl.c10
2 files changed, 9 insertions, 4 deletions
diff --git a/src/ACKNOWLEDGMENTS b/src/ACKNOWLEDGMENTS
index 4fb6c922d..ce4bf787c 100644
--- a/src/ACKNOWLEDGMENTS
+++ b/src/ACKNOWLEDGMENTS
@@ -1,4 +1,4 @@
-$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.45 2006/04/04 09:09:45 ph10 Exp $
+$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.46 2006/06/07 15:06:26 fanf2 Exp $
EXIM ACKNOWLEDGEMENTS
@@ -77,6 +77,7 @@ Matt Bernstein LMTP over socket
Mike Bethune Help with debugging an elusive ALRM signal bug
Ard Biesheuvel Lookup code for accessing an Interbase database
Richard Birkett Fix for empty -f address crash
+Dean Brooks Fix for ratelimit per_rcpt in acl_not_smtp.
Nick Burrett Patch for CONFIGURE_FILE_USE_EUID in exicyclog
Matthew Byng-Maddick Patch for qualify_domain in redirect router
Patch for ignore_target_hosts in ipliteral router
diff --git a/src/src/acl.c b/src/src/acl.c
index 1ad01ea74..a8db4a75f 100644
--- a/src/src/acl.c
+++ b/src/src/acl.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/acl.c,v 1.58 2006/04/04 17:05:45 fanf2 Exp $ */
+/* $Cambridge: exim/src/src/acl.c,v 1.59 2006/06/07 15:06:26 fanf2 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -2035,6 +2035,7 @@ ACL clauses like: defer ratelimit = 15 / 1h
Arguments:
arg the option string for ratelimit=
+ where ACL_WHERE_xxxx indicating which ACL this is
log_msgptr for error messages
Returns: OK - Sender's rate is above limit
@@ -2044,7 +2045,7 @@ Returns: OK - Sender's rate is above limit
*/
static int
-acl_ratelimit(uschar *arg, uschar **log_msgptr)
+acl_ratelimit(uschar *arg, int where, uschar **log_msgptr)
{
double limit, period;
uschar *ss, *key;
@@ -2263,6 +2264,9 @@ else
if (per_byte)
dbd->rate = (message_size < 0 ? 0.0 : (double)message_size)
* (1 - a) / i_over_p + a * dbd->rate;
+ else if (per_cmd && where == ACL_WHERE_NOTSMTP)
+ dbd->rate = (double)recipients_count
+ * (1 - a) / i_over_p + a * dbd->rate;
else
dbd->rate = (1 - a) / i_over_p + a * dbd->rate;
}
@@ -2873,7 +2877,7 @@ for (; cb != NULL; cb = cb->next)
#endif
case ACLC_RATELIMIT:
- rc = acl_ratelimit(arg, log_msgptr);
+ rc = acl_ratelimit(arg, where, log_msgptr);
break;
case ACLC_RECIPIENTS: