X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fspam%2Fserv_spam.c;h=2b9331f93c0e1cd9a823d8fcf18f41c3ff28c830;hb=882ff5a53c3b4e440520a073cf07dc60b2671876;hp=c0ced7eeb1dc86332c9439274c972e4ad0d09365;hpb=848934c1722edc208c4df49c571586b72c3fc486;p=citadel.git diff --git a/citadel/modules/spam/serv_spam.c b/citadel/modules/spam/serv_spam.c index c0ced7eeb..2b9331f93 100644 --- a/citadel/modules/spam/serv_spam.c +++ b/citadel/modules/spam/serv_spam.c @@ -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" @@ -32,18 +26,7 @@ #include #include #include - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - +#include #include #include #include @@ -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, struct 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]; @@ -176,9 +159,6 @@ int spam_assassin(struct CtdlMessage *msg) { } if (is_spam) { - if (msg->cm_fields[eErrorMsg] != NULL) { - free(msg->cm_fields[eErrorMsg]); - } CM_SetField(msg, eErrorMsg, HKEY("message rejected by spam filter")); } }