info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: spam.el recipie


From: Hubert Chan
Subject: Re: spam.el recipie
Date: Mon, 24 May 2004 15:54:41 -0400
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

>>>>> "Michael" == Michael Slass <miknrene@drizzle.com> writes:

Michael> Could anyone post/point me to a .gnus that's using spam.el?
Michael> I'm ready to migrate away from my home-rolled version.

Here's what I use.  To use SpamAssassin with spam.el, you need a recent
version of spam.el.  Obviously, the values for the variables depends on
your setup.

(setq spam-use-spamassassin t)
(setq spam-split-group "spamkill")
(setq spam-spamassassin-path "spamc")
(setq spam-spamassassin-arguments '("-U" "/var/run/spamd_sock"))
(setq spam-process-ham-in-spam-groups t)
(require 'spam)
(spam-initialize)

Then just add

  (: spam-split)

to your fancy-split.

(Actually, I whitelist everyone in my BBDB database before passing to
spam-split -- details for how I do that are at
http://www.uhoreg.ca/programming/emacs.html)

Michael> BTW:

Michael> I've recently written this to look for .exe or .scr attachments
Michael> which are usually some Win32 virus.  It seems to work OK, and a
Michael> brief look at spam.el doesn't show similar functionality.  Did
Michael> I miss it, or would this still be useful?

I've got a spam.el addition that uses clamav for virus scanning, which
will probably go into a future version of spam.el.  It works, but the
code isn't as clean as it should be (i.e. duplicate code between this
and other stuff in spam.el).  Ted, have you made any progress on that
yet?  <sigh> I need to get back to work on my development projects --
I've left them for too long.

(defcustom spam-use-clamav nil
  "Whether clamav should be invoked by `spam-split'.
Enable this if you want Gnus to invoke Clam AntiVirus on new messages."
  :type 'boolean
  :group 'spam)
(defgroup spam-clamav nil
  "Spam Clam AntiVirus configuration."
  :group 'spam)
(defcustom spam-clamav-path (executable-find "clamscan")
  "File path of the clamscan executable program."
  :type '(choice (file :tag "Location of clamscan")
                 (const :tag "Clam AntiVirus is not installed"))
  :group 'spam-clamav)
(defcustom spam-clamav-arguments '("--mbox")
  "Arguments to pass to the clamscan executable.
This must be a list of arguments.  For example, `(\"-l\" \"logfile\")'."
  :type '(restricted-sexp :match-alternatives (listp))
  :group 'spam-clamav)

(add-to-list 'spam-list-of-checks
             '(spam-use-clamav . spam-check-clamav))
(add-to-list 'spam-list-of-statistical-checks
             'spam-use-clamav)

(defun spam-check-clamav ()
  "Check the Clam AntiVirus backend for viruses."
  (if (= (apply 'call-process-region
                (point-min) (point-max) spam-clamav-path
                nil nil nil (append spam-clamav-arguments '("-"))) 1)
      spam-split-group))

-- 
Hubert Chan <hubert@uhoreg.ca> - http://www.uhoreg.ca/
PGP/GnuPG key: 1024D/124B61FA
Fingerprint: 96C5 012F 5F74 A5F7 1FF7  5291 AF29 C719 124B 61FA
Key available at wwwkeys.pgp.net.   Encrypted e-mail preferred.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]