{
unsigned int i;
spamd_address_container * sd;
-long rnd, weights;
+long weights;
unsigned pri;
static BOOL srandomed = FALSE;
if (weights == 0) /* all servers failed */
return -1;
-for (rnd = random() % weights, i = 0; i < num_servers; i++)
+for (long rnd = random() % weights, i = 0; i < num_servers; i++)
{
sd = spamds[i];
if (!sd->is_failed && sd->priority == pri)
uschar * s;
DEBUG(D_acl) debug_printf_indent("spamd: addr entry '%s'\n", address);
- sd = (spamd_address_container *)store_get(sizeof(spamd_address_container));
+ sd = store_get(sizeof(spamd_address_container), FALSE);
for (sublist = address, args = 0, spamd_param_init(sd);
(s = string_nextinlist(&sublist, &sublist_sep, NULL, 0));
"\r\nFrom: <", sender_address,
">\r\nRecipient-Number: ", string_sprintf("%d\r\n", recipients_count));
- for (i = 0; i < recipients_count; i ++)
+ for (int i = 0; i < recipients_count; i++)
req_str = string_append(req_str, 3,
"Rcpt: <", recipients_list[i].address, ">\r\n");
if ((s = expand_string(US"$sender_helo_name")) && *s)
while ((i = ip_recv(&spamd_cctx,
spamd_buffer + offset,
sizeof(spamd_buffer) - offset - 1,
- sd->timeout - time(NULL) + start)) > 0)
+ sd->timeout + start)) > 0)
offset += i;
spamd_buffer[offset] = '\0'; /* guard byte */
}
Ustrcpy(spam_action_buffer,
- spamd_score >= spamd_threshold ? "reject" : "no action");
+ spamd_score >= spamd_threshold ? US"reject" : US"no action");
}
/* Create report. Since this is a multiline string,