RSSyl: Allow use of .netrc by libcurl. Bug/enhancement #3309, by Vincent Pelletier
[claws.git] / src / plugins / spamassassin / spamassassin.c
index 4c6f564e1627a26a7ee2ac6952ea1ef218ce6a2a..41753d949a2307009304d0c3a899558fd9fec4f7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 the Claws Mail Team
+ * Copyright (C) 1999-2012 the Claws Mail Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
+#include "claws-features.h"
 #endif
 
 #include "defs.h"
@@ -267,6 +268,7 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
                
                if (whitelisted) {
                        debug_print("message is ham (whitelisted)\n");
+                       fclose(fp);
                        return FALSE;
                }
        }
@@ -441,9 +443,9 @@ int spamassassin_learn(MsgInfo *msginfo, GSList *msglist, gboolean spam)
                                                                spamc_wrapper, " ", file, NULL);
                        }
                } else {
-                       cmd = g_strdup_printf("sa-learn -u %s %s %s %s",
+                       cmd = g_strdup_printf("sa-learn -u %s%s %s %s",
                                                        config.username,
-                                                       prefs_common.work_offline?"-L":"",
+                                                       prefs_common.work_offline?" -L":"",
                                                        spam?"--spam":"--ham", file);
                }
        }
@@ -475,9 +477,9 @@ int spamassassin_learn(MsgInfo *msginfo, GSList *msglist, gboolean spam)
                        g_free(spamc_wrapper);
                        return 0;
                } else {
-                       cmd = g_strdup_printf("sa-learn -u %s %s %s",
+                       cmd = g_strdup_printf("sa-learn -u %s%s %s",
                                        config.username,
-                                       prefs_common.work_offline?"-L":"",
+                                       prefs_common.work_offline?" -L":"",
                                        spam?"--spam":"--ham");
 
                        /* concatenate all message tmpfiles to the sa-learn command-line */