stable now but there are GIANT PIECES MISSING
[citadel.git] / citadel / modules / spam / serv_spam.c
index 77365b16c3844735e16340dcb3d6f463d9a8a962..479ea5fecf93be76c2edd76668bcabba212b2877 100644 (file)
@@ -4,21 +4,15 @@
  * http://www.spamassassin.org (the SpamAssassin project is not in any way
  * affiliated with the Citadel project).
  *
- * Copyright (c) 1998-2012 by the citadel.org team
+ * Copyright (c) 1998-2015 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
- * 
- * 
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * 
- * 
- * 
  */
 
 #define SPAMASSASSIN_PORT       "783"
 #include <pwd.h>
 #include <errno.h>
 #include <sys/types.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
+#include <time.h>
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
@@ -70,7 +53,7 @@
 /*
  * Connect to the SpamAssassin server and scan a message.
  */
-int spam_assassin(struct CtdlMessage *msg) {
+int spam_assassin(struct CtdlMessage *msg, recptypes *recp) {
        int sock = (-1);
        char sahosts[SIZ];
        int num_sahosts;
@@ -141,8 +124,8 @@ int spam_assassin(struct CtdlMessage *msg) {
                 goto bail;
         }
         syslog(LOG_DEBUG, "<%s\n", buf);
-        syslog(LOG_DEBUG, "c_spam_flag_only setting %d\n", config.c_spam_flag_only);
-        if (config.c_spam_flag_only) {
+        syslog(LOG_DEBUG, "c_spam_flag_only setting %d\n", CtdlGetConfigInt("c_spam_flag_only"));
+        if (CtdlGetConfigInt("c_spam_flag_only")) {
                int headerlen;
                char *cur;
                char sastatus[10];