0.9.0claws81
authorChristoph Hohmann <reboot@gmx.ch>
Fri, 4 Jul 2003 22:19:09 +0000 (22:19 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Fri, 4 Jul 2003 22:19:09 +0000 (22:19 +0000)
* src/plugins/spamassassin/spamassassin.c
        set timeout for spam check

ChangeLog.claws
configure.ac
src/plugins/spamassassin/spamassassin.c

index 27f5072..66309e1 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-04 [christoph] 0.9.0claws81
+
+       * src/plugins/spamassassin/spamassassin.c
+               set timeout for spam check
+
 2003-07-04 [christoph] 0.9.0claws80
 
        * src/main.c
index 5bb14fb..318f887 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws80
+EXTRA_VERSION=claws81
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 10fe5d2..bbea649 100644 (file)
@@ -95,6 +95,7 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
        struct message m;
        gchar *oldlocale = NULL;
        struct sockaddr addr;
+       int ret;
 
        if (!config.enable)
                return FALSE;
@@ -106,26 +107,34 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
        setlocale(LC_ALL, "C");
 
        if (lookup_host(config.hostname, config.port, &addr) != EX_OK) {
-               debug_print("failed to look up spamd host");
+               debug_print("failed to look up spamd host\n");
                return FALSE;
        }
 
        m.type = MESSAGE_NONE;
        m.max_len = config.max_size * 1024;
+       m.timeout = 30;
 
        if ((fp = procmsg_open_message(msginfo)) == NULL) {
-               debug_print("failed to open message file");
+               debug_print("failed to open message file\n");
                return FALSE;
        }
 
        if (message_read(fileno(fp), flags, &m) != EX_OK) {
-               debug_print("failed to read message");
+               debug_print("failed to read message\n");
                fclose(fp);
                message_cleanup(&m);
                return FALSE;
        }
 
-       if ((message_filter(&addr, username, flags, &m) == EX_OK) && (m.is_spam == EX_ISSPAM))
+       if ((ret = message_filter(&addr, username, flags, &m)) != EX_OK) {
+               debug_print("filtering the message failed\n");
+               fclose(fp);
+               message_cleanup(&m);
+               return FALSE;
+       }
+
+       if (m.is_spam == EX_ISSPAM)
                is_spam = TRUE;
 
        message_cleanup(&m);
@@ -133,11 +142,11 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
        setlocale(LC_ALL, oldlocale);
 
        if (is_spam) {
+               debug_print("message is spam\n");
+                           
                if (config.receive_spam) {
                        FolderItem *save_folder;
 
-                       debug_print("message is spam\n");
-                           
                        if ((!config.save_folder) ||
                            (config.save_folder[0] == '\0') ||
                            ((save_folder = folder_find_item_from_identifier(config.save_folder)) == NULL))