Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Jay Belanger <belanger@truman.edu>
Subject: Re: spam assassin filtering
Date: Mon, 27 Jan 2003 09:19:34 -0600	[thread overview]
Message-ID: <m3n0lm4o3d.fsf@vh213602.truman.edu> (raw)
In-Reply-To: <874r7vclji.fsf@ibook.optushome.com.au>


Alain Picard <apicard+die-spammer-die@optushome.com.au> writes:

> Hello all,
>
> Does anyone have a working setup of GNUS/spam assassin working?
> The setup described in the manual (Oort v.7) doesn't seem to
> work for me.

The method in the cvs manual is to use fancy splitting with

(setq nnmail-split-fancy '(| (: kevin-spamassassin)
                             ...))
(defun kevin-spamassassin ()
  (save-excursion
    (let ((buf (or (get-buffer " *nnmail incoming*")
                   (get-buffer " *nnml move*"))))
      (if (not buf)
          (progn (message "Oops, cannot find message buffer") nil)
        (set-buffer buf)
        (if (eq 1 (call-process-region (point-min) (point-max)
                                       "spamc" nil nil nil "-c"))
            "spam")))))

This didn't work for me either.  The output of spamc with the -c
switch is 1 if the article is spam, but the function above seems to
assume that the value of 'call-process-region' is the same as the
output of spamc. I don't think that's the case, particularly here.
If I'm right, this should probably be changed in the manual.

> Any example of a configuration known to work in real life
> would be helpful.

There are a couple of ways of doing it in the lisp files on
http://my.gnus.org/Lisp
I have it set up the following way (with help from the above function,
and the functions on my.gnus.org); it works for me.

==== from my .gnus =======
(setq nnmail-split-methods 'nnmail-split-fancy)

(defun jpb-spamassassin ()
  (with-temp-buffer
    (if (get-buffer " *nnmail incoming*")
        (insert-buffer " *nnmail incoming*")
      (insert-buffer gnus-original-article-buffer))
    (call-process-region (point-min) (point-max)
                         "spamc" t t nil "-f")
    (goto-char (point-min))
    (when (re-search-forward "^X-Spam-Status: Yes" nil t)
      "Spam")))

(setq nnmail-split-fancy
  '(|
     <... a bunch of splits ...>
     (: jpb-spamassassin)
     "Misc"))
==========================

Jay


       reply	other threads:[~2003-01-27 15:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <874r7vclji.fsf@ibook.optushome.com.au>
2003-01-27 15:19 ` Jay Belanger [this message]
     [not found] ` <87ptqiodvb.fsf@unix.home>
2003-01-29 11:06   ` Alain Picard
2003-01-29 15:35     ` Michael Below
     [not found]       ` <87u1fr7lwn.fsf@jan.korger>
2003-01-29 21:14         ` Vasily Korytov
2003-01-29 21:52           ` Tim Haynes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3n0lm4o3d.fsf@vh213602.truman.edu \
    --to=belanger@truman.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).