projects
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a whole pile of casts to get rid of compiler warnings in Tom's DK
[exim.git]
/
src
/
src
/
acl.c
diff --git
a/src/src/acl.c
b/src/src/acl.c
index a96e2d1882a6cf8101681548825e779511f8ae39..980d3ab2dbd03e46319a41967e35bb31b6c02b64 100644
(file)
--- a/
src/src/acl.c
+++ b/
src/src/acl.c
@@
-1,4
+1,4
@@
-/* $Cambridge: exim/src/src/acl.c,v 1.3
5 2005/05/25 09:58:16
fanf2 Exp $ */
+/* $Cambridge: exim/src/src/acl.c,v 1.3
9 2005/06/10 19:27:05
fanf2 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/*************************************************
* Exim - an Internet mail transport agent *
@@
-1143,6
+1143,7
@@
Ustrcpy(t->name, domain);
/* Now we are ready to do the actual DNS lookup(s). */
/* Now we are ready to do the actual DNS lookup(s). */
+found = domain;
switch (dns_special_lookup(&dnsa, domain, T_CSA, &found))
{
/* If something bad happened (most commonly DNS_AGAIN), defer. */
switch (dns_special_lookup(&dnsa, domain, T_CSA, &found))
{
/* If something bad happened (most commonly DNS_AGAIN), defer. */
@@
-1512,6
+1513,11
@@
while ((ss = string_nextinlist(&list, &sep, big_buffer, big_buffer_size))
else if (strcmpic(opt, US"use_postmaster") == 0)
verify_options |= vopt_callout_recippmaster;
else if (strcmpic(opt, US"postmaster") == 0) pm_mailfrom = US"";
else if (strcmpic(opt, US"use_postmaster") == 0)
verify_options |= vopt_callout_recippmaster;
else if (strcmpic(opt, US"postmaster") == 0) pm_mailfrom = US"";
+ else if (strcmpic(opt, US"fullpostmaster") == 0)
+ {
+ pm_mailfrom = US"";
+ verify_options |= vopt_callout_fullpm;
+ }
else if (strncmpic(opt, US"mailfrom", 8) == 0)
{
else if (strncmpic(opt, US"mailfrom", 8) == 0)
{
@@
-1915,7
+1921,7
@@
static int
acl_ratelimit(uschar *arg, uschar **log_msgptr)
{
double limit, period;
acl_ratelimit(uschar *arg, uschar **log_msgptr)
{
double limit, period;
-uschar *ss, *key
= arg
;
+uschar *ss, *key;
int sep = '/';
BOOL have_key = FALSE, leaky = FALSE, strict = FALSE;
BOOL per_byte = FALSE, per_cmd = FALSE, per_conn = FALSE, per_mail = FALSE;
int sep = '/';
BOOL have_key = FALSE, leaky = FALSE, strict = FALSE;
BOOL per_byte = FALSE, per_cmd = FALSE, per_conn = FALSE, per_mail = FALSE;
@@
-1951,6
+1957,12
@@
if (limit < 0.0 || *ss != 0)
return ERROR;
}
return ERROR;
}
+/* We use the rest of the argument list following the limit as the
+lookup key, because it doesn't make sense to use the same stored data
+if the period or options are different. */
+
+key = arg;
+
/* Second is the rate measurement period and exponential smoothing time
constant. This must be strictly greater than zero, because zero leads to
run-time division errors. */
/* Second is the rate measurement period and exponential smoothing time
constant. This must be strictly greater than zero, because zero leads to
run-time division errors. */
@@
-1991,9
+2003,7
@@
if (leaky + strict > 1 || per_byte + per_cmd + per_conn + per_mail > 1)
if (!strict) leaky = TRUE;
if (!per_byte && !per_cmd && !per_conn) per_mail = TRUE;
if (!strict) leaky = TRUE;
if (!per_byte && !per_cmd && !per_conn) per_mail = TRUE;
-/* We use the whole of the argument list as the lookup key, because it doesn't
-make sense to use the same stored data if any of the arguments are different.
-If there is no explicit key, use the sender_host_address. If there is no
+/* If there is no explicit key, use the sender_host_address. If there is no
sender_host_address (e.g. -bs or acl_not_smtp) then we simply omit it. */
if (!have_key && sender_host_address != NULL)
sender_host_address (e.g. -bs or acl_not_smtp) then we simply omit it. */
if (!have_key && sender_host_address != NULL)
@@
-2002,8
+2012,7
@@
if (!have_key && sender_host_address != NULL)
HDEBUG(D_acl) debug_printf("ratelimit condition limit=%.0f period=%.0f key=%s\n",
limit, period, key);
HDEBUG(D_acl) debug_printf("ratelimit condition limit=%.0f period=%.0f key=%s\n",
limit, period, key);
-/* If we are dealing with rate limits per connection, per message, or per byte,
-see if we have already computed the rate by looking in the relevant tree. For
+/* See if we have already computed the rate by looking in the relevant tree. For
per-connection rate limiting, store tree nodes and dbdata in the permanent pool
so that they survive across resets. */
per-connection rate limiting, store tree nodes and dbdata in the permanent pool
so that they survive across resets. */
@@
-2015,8
+2024,10
@@
if (per_conn)
anchor = &ratelimiters_conn;
store_pool = POOL_PERM;
}
anchor = &ratelimiters_conn;
store_pool = POOL_PERM;
}
-if (per_mail || per_byte)
+
else
if (per_mail || per_byte)
anchor = &ratelimiters_mail;
anchor = &ratelimiters_mail;
+else if (per_cmd)
+ anchor = &ratelimiters_cmd;
if (anchor != NULL && (t = tree_search(*anchor, key)) != NULL)
{
if (anchor != NULL && (t = tree_search(*anchor, key)) != NULL)
{
@@
-3316,6
+3327,7
@@
address_item *addr;
*user_msgptr = *log_msgptr = NULL;
sender_verified_failed = NULL;
*user_msgptr = *log_msgptr = NULL;
sender_verified_failed = NULL;
+ratelimiters_cmd = NULL;
if (where == ACL_WHERE_RCPT)
{
if (where == ACL_WHERE_RCPT)
{