Update error message for unknown ACL verb.
[exim.git] / src / src / acl.c
index 1ad01ea74e9fd90bf9e39ab5c4e93c2feb715855..033291b0cd864d37d232f37ee709907b1fbced96 100644 (file)
@@ -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.60 2006/06/27 14:04:29 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -720,7 +720,8 @@ while ((s = (*func)()) != NULL)
     {
     if (this == NULL)
       {
-      *error = string_sprintf("unknown ACL verb in \"%s\"", saveline);
+      *error = string_sprintf("unknown ACL verb \"%s\" in \"%s\"", name,
+        saveline);
       return NULL;
       }
     }
@@ -2035,6 +2036,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 +2046,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 +2265,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 +2878,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: