Fix typo in debug output
[exim.git] / src / src / spam.c
index 5bb973b4d0d757ca84cab301f1af1f4d0acc6a65..118fcfa8a76b5dcab17a3823dbc61dd6bb46d933 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++
         )
       {
@@ -348,7 +348,7 @@ start = time(NULL);
          || sd->retry <= 0
         )
        break;
-      DEBUG(D_acl) debug_printf("sspamd: erver %s: retry conn\n", sd->hostspec);
+      DEBUG(D_acl) debug_printf("spamd: server %s: retry conn\n", sd->hostspec);
       while (sd->retry > 0) sd->retry = sleep(sd->retry);
       }
     if (spamd_sock >= 0)
@@ -397,7 +397,7 @@ if (sd->is_rspamd)
   if ((authid = expand_string(US"$authenticated_id")) != NULL && *authid != '\0')
     req_str = string_sprintf("%sUser: %s\r\n", req_str, authid);
   req_str = string_sprintf("%s\r\n", req_str);
-  wrote = send(spamd_sock, req_str, Ustrlen(req_str), 0); 
+  wrote = send(spamd_sock, req_str, Ustrlen(req_str), 0);
   }
 else
   {                            /* spamassassin variant */