dammit, learn to spell
[citadel.git] / citadel / server / modules / spam / serv_spam.c
index 76a422d8524da1dbf82c2a16c02e4187203acf62..4f96f2b972579dc7773b5f98981be06d9f798f9e 100644 (file)
@@ -1,6 +1,6 @@
 // This module allows Citadel to use an external SpamAssassin service to filter incoming messages arriving via SMTP.
 //
-// Copyright (c) 1998-2022 by the citadel.org team
+// Copyright (c) 1998-2023 by the citadel.org team
 //
 // This program is open source software.  Use, duplication, or disclosure
 // is subject to the terms of the GNU General Public License, version 3.
@@ -22,7 +22,7 @@
 #include <limits.h>
 #include <sys/socket.h>
 #include <libcitadel.h>
-#include "../../citadel.h"
+#include "../../citadel_defs.h"
 #include "../../server.h"
 #include "../../citserver.h"
 #include "../../support.h"
@@ -87,8 +87,9 @@ int spam_assassin(struct CtdlMessage *msg, struct recptypes *recp) {
        FreeStrBuf(&msgtext);
 
        // Close one end of the socket connection; this tells SpamAssassin that we're done.
-       if (sock != -1)
-               sock_shutdown(sock, SHUT_WR);
+       if (sock != -1) {
+               shutdown(sock, SHUT_WR);
+       }
        
        // Response
        syslog(LOG_DEBUG, "Awaiting response\n");
@@ -129,7 +130,7 @@ int spam_assassin(struct CtdlMessage *msg, struct recptypes *recp) {
                                     "\r\nX-Spam-Status: %s, score=%s required=%s\r\n",
                                     sastatus, sascore, saoutof);
 
-               CM_PrependToField(msg, eMesageText, buf, headerlen);
+               CM_PrependToField(msg, eMessageText, buf, headerlen);
 
        }
        else {
@@ -139,7 +140,7 @@ int spam_assassin(struct CtdlMessage *msg, struct recptypes *recp) {
                }
 
                if (is_spam) {
-                       CM_SetField(msg, eErrorMsg, HKEY("message rejected by spam filter"));
+                       CM_SetField(msg, eErrorMsg, "message rejected by spam filter");
                }
        }