Compiler quietening
[exim.git] / src / src / spam.c
index 05a51f636547a7d9fcfade9996052a65b9ae4394..457aa3a36113097be0e86a024924beabec23cb2b 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) Tom Kistner <tom@duncanthrax.net> 2003-???? */
+/* Copyright (c) Tom Kistner <tom@duncanthrax.net> 2003 - 2015 */
 /* License: GPL */
 
 /* Code for calling spamassassin's spamd. Called from acl.c. */
@@ -28,6 +28,7 @@ static int
 spamd_param_init(spamd_address_container *spamd)
 {
 /* default spamd server weight, time and priority value */
+spamd->is_rspamd = FALSE;
 spamd->is_failed = FALSE;
 spamd->weight = SPAMD_WEIGHT;
 spamd->timeout = SPAMD_TIMEOUT;
@@ -38,7 +39,7 @@ return 0;
 
 
 static int
-spamd_param(const uschar *param, spamd_address_container *spamd)
+spamd_param(const uschar * param, spamd_address_container * spamd)
 {
 static int timesinceday = -1;
 const uschar * s;
@@ -46,10 +47,10 @@ const uschar * name;
 
 /*XXX more clever parsing could discard embedded spaces? */
 
-if (sscanf(param, "pri=%u", &spamd->priority))
+if (sscanf(CCS param, "pri=%u", &spamd->priority))
   return 0; /* OK */
 
-if (sscanf(param, "weight=%u", &spamd->weight))
+if (sscanf(CCS param, "weight=%u", &spamd->weight))
   {
   if (spamd->weight == 0) /* this server disabled: skip it */
     return 1;
@@ -202,7 +203,6 @@ uschar *p,*q;
 int override = 0;
 time_t start;
 size_t read, wrote;
-struct sockaddr_un server;
 #ifndef NO_POLL_H
 struct pollfd pollfd;
 #else                               /* Patch posted by Erik ? for OS X */
@@ -297,7 +297,7 @@ start = time(NULL);
     sd = (spamd_address_container *)store_get(sizeof(spamd_address_container));
 
     for (sublist = address, args = 0, spamd_param_init(sd);
-        s = string_nextinlist(&sublist, &sublist_sep, NULL, 0);
+        (s = string_nextinlist(&sublist, &sublist_sep, NULL, 0));
         args++
         )
       {
@@ -340,7 +340,7 @@ start = time(NULL);
     {
     uschar * errstr;
 
-    debug_printf("trying server %s\n", sd->hostspec);
+    DEBUG(D_acl) debug_printf("spamd: trying server %s\n", sd->hostspec);
 
     for (;;)
       {
@@ -348,7 +348,7 @@ start = time(NULL);
          || sd->retry <= 0
         )
        break;
-      debug_printf("server %s: retry conn\n", sd->hostspec);
+      DEBUG(D_acl) debug_printf("sspamd: erver %s: retry conn\n", sd->hostspec);
       while (sd->retry > 0) sd->retry = sleep(sd->retry);
       }
     if (spamd_sock >= 0)
@@ -384,8 +384,8 @@ if (sd->is_rspamd)
   const uschar * authid;
 
   req_str = string_sprintf("CHECK RSPAMC/1.3\r\nContent-length: %lu\r\n"
-    "Queue-Id: %s\r\nFrom: <%s>\r\nRecipient-Number: %d\r\n", mbox_size,
-    message_id, sender_address, recipients_count);
+    "Queue-Id: %s\r\nFrom: <%s>\r\nRecipient-Number: %d\r\n",
+    mbox_size, message_id, sender_address, recipients_count);
   for (i = 0; i < recipients_count; i ++)
     req_str = string_sprintf("%sRcpt: <%s>\r\n", req_str, recipients_list[i].address);
   if ((helo = expand_string(US"$sender_helo_name")) != NULL && *helo != '\0')