aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-junk-filter.c
diff options
context:
space:
mode:
authorRadek Doulik <rodo@ximian.com>2004-01-13 01:11:18 +0800
committerRadek Doulik <rodo@src.gnome.org>2004-01-13 01:11:18 +0800
commit1c4599a82920d2ca4144517a32af9dfd453435be (patch)
treef7822948182b6906109a3b038e194b06a06522f0 /mail/em-junk-filter.c
parent5c78763efda4c70010f70350533e25b7c9d1c87f (diff)
downloadgsoc2013-evolution-1c4599a82920d2ca4144517a32af9dfd453435be.tar
gsoc2013-evolution-1c4599a82920d2ca4144517a32af9dfd453435be.tar.gz
gsoc2013-evolution-1c4599a82920d2ca4144517a32af9dfd453435be.tar.bz2
gsoc2013-evolution-1c4599a82920d2ca4144517a32af9dfd453435be.tar.lz
gsoc2013-evolution-1c4599a82920d2ca4144517a32af9dfd453435be.tar.xz
gsoc2013-evolution-1c4599a82920d2ca4144517a32af9dfd453435be.tar.zst
gsoc2013-evolution-1c4599a82920d2ca4144517a32af9dfd453435be.zip
added SA prefs (mail_session_get_sa_local_only): new helper method
2004-01-12 Radek Doulik <rodo@ximian.com> * mail-session.c: added SA prefs (mail_session_get_sa_local_only): new helper method (mail_session_set_sa_local_only): ditto (mail_session_get_sa_use_daemon): ditto (mail_session_set_sa_use_daemon): ditto (mail_session_check_junk_notify): fix the key comparison (mail_session_init): add gconf dir so that we get notified * mail-config.glade: added SA preferences * em-mailer-prefs.c (em_mailer_prefs_construct): added more junk prefs (em_mailer_prefs_apply): ditto * em-junk-filter.c: use preferences svn path=/trunk/; revision=24174
Diffstat (limited to 'mail/em-junk-filter.c')
-rw-r--r--mail/em-junk-filter.c61
1 files changed, 39 insertions, 22 deletions
diff --git a/mail/em-junk-filter.c b/mail/em-junk-filter.c
index 8c5888e7c5..d81b04feda 100644
--- a/mail/em-junk-filter.c
+++ b/mail/em-junk-filter.c
@@ -32,6 +32,7 @@
#include <camel/camel-data-wrapper.h>
#include <camel/camel-stream-fs.h>
+#include "mail-session.h"
#include "em-junk-filter.h"
#define LOCK(x) pthread_mutex_lock(&x)
@@ -228,7 +229,7 @@ em_junk_sa_test_spamd ()
for (i = 0; i < NPORTS; i ++) {
d(fprintf (stderr, "trying to run spamd at port %d\n", port));
- sad_args [2] = g_strdup_printf ("spamd --port %d --local --daemonize", port);
+ sad_args [2] = g_strdup_printf ("spamd --port %d %s--daemonize", port, mail_session_get_sa_local_only () ? "--local " : "");
if (!pipe_to_sa (NULL, NULL, 3, sad_args)) {
g_free (sad_args [2]);
em_junk_sa_use_spamc = TRUE;
@@ -282,10 +283,11 @@ em_junk_sa_check_junk (CamelMimeMessage *msg)
" -c" /* Exit with a non-zero exit code if the
tested message was junk */
" -p %d", em_junk_sa_spamd_port))
- : g_strdup ("spamassassin"
- " --exit-code" /* Exit with a non-zero exit code if the
- tested message was junk */
- " --local"); /* Local tests only (no online tests) */
+ : g_strdup_printf ("spamassassin"
+ " --exit-code%s", /* Exit with a non-zero exit code if the
+ tested message was junk */
+ mail_session_get_sa_local_only ()
+ ? " --local" : ""); /* Local tests only (no online tests) */
retval = pipe_to_sa (msg, NULL, 3, args);
@@ -300,18 +302,23 @@ em_junk_sa_report_junk (CamelMimeMessage *msg)
static gchar *args [4] = {
"/bin/sh",
"-c",
- "sa-learn"
- " --no-rebuild" /* do not rebuild db */
- " --spam" /* report junk */
- " --single" /* single message */
- " --local", /* local only */
+ NULL,
NULL
};
d(fprintf (stderr, "em_junk_sa_report_junk\n"));
- if (em_junk_sa_is_available ())
+ if (em_junk_sa_is_available ()) {
+ args [2] = g_strdup_printf
+ ("sa-learn"
+ " --no-rebuild" /* do not rebuild db */
+ " --spam" /* report junk */
+ " --single%s", /* single message */
+ mail_session_get_sa_local_only ()
+ ? " --local" : ""); /* local only */
pipe_to_sa (msg, NULL, 3, args);
+ g_free (args [2]);
+ }
}
static void
@@ -320,18 +327,23 @@ em_junk_sa_report_notjunk (CamelMimeMessage *msg)
static gchar *args [4] = {
"/bin/sh",
"-c",
- "sa-learn"
- " --no-rebuild" /* do not rebuild db */
- " --ham" /* report notjunk */
- " --single" /* single message */
- " --local", /* local only */
+ NULL,
NULL
};
d(fprintf (stderr, "em_junk_sa_report_notjunk\n"));
- if (em_junk_sa_is_available ())
+ if (em_junk_sa_is_available ()) {
+ args [2] = g_strdup_printf
+ ("sa-learn"
+ " --no-rebuild" /* do not rebuild db */
+ " --ham" /* report notjunk */
+ " --single%s", /* single message */
+ mail_session_get_sa_local_only ()
+ ? " --local" : ""); /* local only */
pipe_to_sa (msg, NULL, 3, args);
+ g_free (args [2]);
+ }
}
static void
@@ -340,16 +352,21 @@ em_junk_sa_commit_reports (void)
static gchar *args [4] = {
"/bin/sh",
"-c",
- "sa-learn"
- " --rebuild" /* do not rebuild db */
- " --local", /* local only */
+ NULL,
NULL
};
- d(fprintf (stderr, "em_junk_sa_commit_reports\n");)
+ d(fprintf (stderr, "em_junk_sa_commit_reports\n"));
- if (em_junk_sa_is_available ())
+ if (em_junk_sa_is_available ()) {
+ args [2] = g_strdup_printf
+ ("sa-learn"
+ " --rebuild%s", /* do not rebuild db */
+ mail_session_get_sa_local_only ()
+ ? " --local" : ""); /* local only */
pipe_to_sa (NULL, NULL, 3, args);
+ g_free (args [2]);
+ }
}
const EMJunkPlugin *