-/* $Cambridge: exim/src/src/acl.c,v 1.57 2006/03/06 16:05:12 ph10 Exp $ */
+/* $Cambridge: exim/src/src/acl.c,v 1.59 2006/06/07 15:06:26 fanf2 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
checking functions. */
static uschar cond_expand_at_top[] = {
- TRUE, /* add_header */
TRUE, /* acl */
+ TRUE, /* add_header */
FALSE, /* authenticated */
#ifdef EXPERIMENTAL_BRIGHTMAIL
TRUE, /* bmi_optin */
/* Flags to identify the modifiers */
static uschar cond_modifiers[] = {
- TRUE, /* add_header */
FALSE, /* acl */
+ TRUE, /* add_header */
FALSE, /* authenticated */
#ifdef EXPERIMENTAL_BRIGHTMAIL
TRUE, /* bmi_optin */
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
*/
static int
-acl_ratelimit(uschar *arg, uschar **log_msgptr)
+acl_ratelimit(uschar *arg, int where, uschar **log_msgptr)
{
double limit, period;
uschar *ss, *key;
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;
}
#endif
case ACLC_RATELIMIT:
- rc = acl_ratelimit(arg, log_msgptr);
+ rc = acl_ratelimit(arg, where, log_msgptr);
break;
case ACLC_RECIPIENTS: