After a few days of testing, it seems I missed some more strings that were not quoted, especially for the important testing part. Failure of these lines, is resulting in all reports marked as clean. Coders, have a look at the file, and see if you can make a better patch (easy), or nitpick mine, to see if I've missed anything. Non-coders.. just try applying the patch and test that it compiles and that spamassassin is working. Applying patch.. cd evolution-1.5.1 patch < patch_file then ./configure and install as usual I'm compiling it now, so I haven't tested it yet. --- mail/em-junk-filter.c.orig Thu Nov 13 19:33:26 2003 +++ mail/em-junk-filter.c Mon Jan 12 07:32:17 2004 @@ -174,7 +174,7 @@ int retval; d(fprintf (stderr, "test if spamd is running (port %d)\n", port);) - sac_args [2] = port > 0 ? g_strdup_printf ("spamc -x -p %d", port) : g_strdup_printf ("spamc -x"); + sac_args [2] = port > 0 ? g_strdup_printf ("'spamc -x -p %d'", port) : g_strdup_printf ("spamc -x"); retval = pipe_to_sa (NULL, "From test 127 0 0 1", 3, sac_args) == 0; g_free (sac_args [2]); @@ -189,7 +189,7 @@ static gchar *args [3] = { "/bin/sh", "-c", - "spamassassin --version" + "'spamassassin --version'" /* quoted command string */ }; if (pipe_to_sa (NULL, NULL, 3, args)) @@ -225,7 +225,7 @@ 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 --local -- daemonize'", port); /* quote command string */ if (!pipe_to_sa (NULL, NULL, 3, sad_args)) { g_free (sad_args [2]); em_junk_sa_use_spamc = TRUE; @@ -272,17 +272,19 @@ args [2] = em_junk_sa_use_spamc ? (em_junk_sa_spamd_port == -1 - ? g_strdup ("spamc -c") /* Exit with a non-zero exit code if the + ? g_strdup ("'spamc -c'") /* Exit with a non-zero exit code if the tested message was junk */ - : g_strdup_printf ("spamc" + : g_strdup_printf ("'" + "spamc" " -c" /* Exit with a non-zero exit code if the tested message was junk */ - " -p %d", em_junk_sa_spamd_port)) - : g_strdup ("spamassassin" + " -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) */ - + " --local" /* Local tests only (no online tests) */ + "'" + ); retval = pipe_to_sa (msg, NULL, 3, args); g_free (args [2]); @@ -296,11 +298,13 @@ static gchar *args [3] = { "/bin/sh", "-c", + "'" /* begin quote */ "sa-learn" " --no-rebuild" /* do not rebuild db */ " --spam" /* report junk */ " --single" /* single message */ " --local" /* local only */ + "'" /* end quote */ }; d(fprintf (stderr, "em_junk_sa_report_junk\n")); @@ -315,11 +319,13 @@ static gchar *args [3] = { "/bin/sh", "-c", + "'" /* begin quote */ "sa-learn" " --no-rebuild" /* do not rebuild db */ " --ham" /* report notjunk */ " --single" /* single message */ " --local" /* local only */ + "'" /* end quote */ }; d(fprintf (stderr, "em_junk_sa_report_notjunk\n")); @@ -334,9 +340,11 @@ static gchar *args [3] = { "/bin/sh", "-c", + "'" /* begin quote */ "sa-learn" " --rebuild" /* do not rebuild db */ " --local" /* local only */ + "'" /* end quote */ }; d(fprintf (stderr, "em_junk_sa_commit_reports\n");)
Attachment:
signature.asc
Description: This is a digitally signed message part