]> code.citadel.org Git - citadel.git/commitdiff
serv_spam.c: removed the simplistic built-in scanner that
authorArt Cancro <ajc@citadel.org>
Tue, 10 Oct 2006 04:35:42 +0000 (04:35 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 10 Oct 2006 04:35:42 +0000 (04:35 +0000)
never went into production.  There's just no way we could do SpamAssassin's job
ourselves at this point so out it goes.

citadel/serv_spam.c

index 5a9ba94b1632700efd1a1c33ec86914fee9b6a13..5e76ed316f4b7e8b512fc0e7d4cd35565bc2285f 100644 (file)
 
 
 
-/* 
- * This is a scanner I had started writing before deciding to just farm the
- * job out to SpamAssassin.  It *does* work but it's not in use.  We've
- * commented it out so it doesn't even compile.
- */
-#ifdef ___NOT_CURRENTLY_IN_USE___
-/* Scan a message for spam */
-int spam_filter(struct CtdlMessage *msg) {
-       int spam_strings_found = 0;
-       struct spamstrings_t *sptr;
-       char *ptr;
-
-       /* Bail out if there's no message text */
-       if (msg->cm_fields['M'] == NULL) return(0);
-
-
-       /* Scan! */
-       ptr = msg->cm_fields['M'];
-       while (ptr++[0] != 0) {
-               for (sptr = spamstrings; sptr != NULL; sptr = sptr->next) {
-                       if (!strncasecmp(ptr, sptr->string,
-                          strlen(sptr->string))) {
-                               ++spam_strings_found;
-                       }
-               }
-       }
-
-       if (spam_strings_found) {
-               if (msg->cm_fields['0'] != NULL) {
-                       free(msg->cm_fields['0']);
-               }
-               msg->cm_fields['0'] = strdup("Unsolicited spam rejected");
-               return(spam_strings_found);
-       }
-
-       return(0);
-}
-#endif
-
-
-
 /*
  * Connect to the SpamAssassin server and scan a message.
  */
@@ -189,12 +148,6 @@ bail:      close(sock);
 
 char *serv_spam_init(void)
 {
-
-/* (disabled built-in scanner, see above)
-       CtdlRegisterMessageHook(spam_filter, EVT_SMTPSCAN);
- */
-
        CtdlRegisterMessageHook(spam_assassin, EVT_SMTPSCAN);
-
         return "$Id$";
 }