From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/52366 Path: main.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.gnus.general Subject: [Eric Knauel] spam.el and spamoracle Date: Tue, 06 May 2003 17:57:38 +0200 Sender: ding-owner@lists.math.uh.edu Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1052241787 29044 80.91.224.249 (6 May 2003 17:23:07 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 6 May 2003 17:23:07 +0000 (UTC) Original-X-From: ding-owner+M910@lists.math.uh.edu Tue May 06 19:23:04 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19D69M-0007WZ-00 for ; Tue, 06 May 2003 19:22:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19D6AY-0007NT-00; Tue, 06 May 2003 12:23:58 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19D4pW-00074S-00 for ding@lists.math.uh.edu; Tue, 06 May 2003 10:58:10 -0500 Original-Received: (qmail 86467 invoked by alias); 6 May 2003 15:58:09 -0000 Original-Received: (qmail 86462 invoked from network); 6 May 2003 15:58:09 -0000 Original-Received: from quimbies.gnus.org (80.91.231.2) by sclp3.sclp.com with SMTP; 6 May 2003 15:58:09 -0000 Original-Received: from larsi by quimbies.gnus.org with local (Exim 3.35 #1 (Debian)) id 19D4pS-0005jk-00 for ; Tue, 06 May 2003 17:58:06 +0200 X-Now-Playing: Pram's _Helium_: "Gravity" Original-To: ding@gnus.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEULChEHBg1aHSbvRDig Oy/0cjtIuhErAAACW0lEQVR4nGWUwbKkIAxFkfbt8X0BHel9l4G9g3H/qjH//ytzgzo1U0OVts0h 94YEde4c0W4+uv9Gn0rrv5Ph/PF+O8HkwhScp/Tt3RP/x5HXKdjsNAzBjUlGX+MTYV9tdRNGsMth lmqNWOJebX0aGOzmvPNPcs/hEd3c1ommEE7gQsJDWL+qe5X3ufoEbksA8ljcQ3/CdGsZ4GH6/jw+ LpUfN/0dATANX4c3cEuFDpBLeKk2gDMv+BuQX0ilg487aMA+Qo9I+uub/K6q/CGViPXBAtysH6+Z i0WQHqjX4Dp4lI9vjIDGmZTfmEIKLgwjv8e2GShZdH/3AgM4n+quHbBK03xFOL9ty0u7VFOGnKcL zLzAfDNzbmXjStGkJreZM1sI92EAXQjD3FPS7s6F80LU/S/QcBWs35AzTLCVsPEdYVrKUiE1YZcv tm13qQbSYOJ6EV+8i1UKSsIsTaT6Dmb+aAeaVsg24Q4G9GN/lRsQYjY6wcyXhbaUKSMvohtcSR07 84KcI9y71B1h+15220g/DPNStgs0A1koAgxTqqVdIYlLLUvqAI2qfJSzJnHmulc6NxjnhU/7olU5 HyhuOBt1z7931pKzROevRl3k/bISpiJkjaLRgJnvhy4jUypVzFyqSXXS9GdevKikig6KzPmUatoO lDxtLNRBktuktLZSQn0rCiJ13IRLKThB4OSTbJLw2gvNaE5GNXDgSo5EaFRCd1H+LGguqo2mVhfx fpuPAcnww8BDhhSJ7wAjCw6NVK4iMSaqkS7AJmX3jNOaCJ8EvsGfoZCsq2f+DY2Jv2hgfG80AAAA AElFTkSuQmCC User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3.50 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:52366 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:52366 --=-=-= Content-Type: message/rfc822 Content-Disposition: inline X-From-Line: knauel@informatik.uni-tuebingen.de Tue May 06 16:40:17 2003 Received: from sclp3.sclp.com (sclp3.sclp.com [64.157.176.121]) by hermes.netfonds.no (8.12.8p1/8.12.8) with SMTP id h46EexRo027064 for ; Tue, 6 May 2003 16:41:00 +0200 (CEST) Received: (qmail 81829 invoked by alias); 6 May 2003 14:40:59 -0000 Delivered-To: alias-larsi@gnus.org Received: (qmail 81824 invoked from network); 6 May 2003 14:40:58 -0000 Received: from mx3.informatik.uni-tuebingen.de (134.2.12.26) by sclp3.sclp.com with SMTP; 6 May 2003 14:40:58 -0000 Received: from jimi.informatik.uni-tuebingen.de (jimi [134.2.12.83]) by mx3.informatik.uni-tuebingen.de (Postfix) with ESMTP id 3C967147 for ; Tue, 6 May 2003 16:40:27 +0200 (MST) Received: from jimi.informatik.uni-tuebingen.de (localhost [127.0.0.1]) by jimi.informatik.uni-tuebingen.de (8.12.7/8.12.2) with ESMTP id h46EeRRS012372 for ; Tue, 6 May 2003 16:40:27 +0200 (CEST) Received: (from knauel@localhost) by jimi.informatik.uni-tuebingen.de (8.12.7/8.12.2/Submit) id h46EeRC5012371; Tue, 6 May 2003 16:40:27 +0200 (CEST) X-Authentication-Warning: jimi.informatik.uni-tuebingen.de: knauel set sender to knauel@informatik.uni-tuebingen.de using -f To: larsi@gnus.org Subject: spam.el and spamoracle From: Eric Knauel Date: Tue, 06 May 2003 16:40:17 +0200 Message-ID: User-Agent: Gnus/5.1001 (Gnus v5.10.1) XEmacs/21.4 (Portable Code, darwin) X-Content-Length: 3279 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===-=-=" --===-=-= Hi Lars, here is a little patch that adds support for Xavier Leroy's spamoracle (see ) to spam.el. I found it quite useful when using IMAP server or other servers where I can't start spamoracle via procmail. --===-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=spamoracle.patch Content-Description: spamoracle for spam.el --- spam.el.orig Tue Apr 29 00:36:31 2003 +++ spam.el Tue May 6 16:22:39 2003 @@ -182,6 +182,11 @@ :type 'boolean :group 'spam) +(defcustom spam-use-spamoracle nil + "Whether spamoracle should be used by spam-split." + :type 'boolean + :group 'spam) + (defcustom spam-split-group "spam" "Group name where incoming spam should be put by spam-split." :type 'string @@ -290,6 +295,18 @@ (const :tag "Use the default")) :group 'spam-ifile) +(defcustom spam-spamoracle-database nil + "Location of spamoracle database file." + :type '(choice (directory :tag "Location of spamoracle database file.") + (cons :tag "Use the default")) + :group 'spam-spamoracle) + +(defcustom spam-spamoracle-binary "spamoracle" + "Location of the spamoracle binary." + :type '(choice (directory :tag "Location of the spamoracle binary") + (const :tag "Use the default")) + :group 'spam-spamoracle) + ;;; Key bindings for spam control. (gnus-define-keys gnus-summary-mode-map @@ -593,7 +610,8 @@ (spam-use-blackholes . spam-check-blackholes) (spam-use-hashcash . spam-check-hashcash) (spam-use-bogofilter-headers . spam-check-bogofilter-headers) - (spam-use-bogofilter . spam-check-bogofilter)) + (spam-use-bogofilter . spam-check-bogofilter) + (spam-use-spamoracle . spam-check-spamoracle)) "The spam-list-of-checks list contains pairs associating a parameter variable with a spam checking function. If the parameter variable is true, then the checking function is called, and its value decides what @@ -607,7 +625,7 @@ definitely a spam.") (defvar spam-list-of-statistical-checks - '(spam-use-ifile spam-use-stat spam-use-bogofilter) + '(spam-use-ifile spam-use-stat spam-use-bogofilter spam-use-spamoracle) "The spam-list-of-statistical-checks list contains all the mail splitters that need to have the full message body available.") @@ -1062,6 +1080,25 @@ (lambda (article) (spam-bogofilter-register-with-bogofilter (spam-get-article-as-string article) nil)))) + +^L +;;; spamoracle +(defun spam-check-spamoracle () + "Run spamoracle on an article to determine whether it's spam." + (let ((article-buffer-name (buffer-name))) + (with-temp-buffer + (let ((temp-buffer-name (buffer-name))) + (save-excursion + (set-buffer article-buffer-name) + (when (zerop (apply 'call-process-region (point-min) (point-max) + spam-spamoracle-binary nil temp-buffer-name nil + (if spam-spamoracle-database + `("-f" ,spam-spamoracle-database "mark") + "mark"))) + (set-buffer temp-buffer-name) + (goto-char (point-min)) + (when (re-search-forward "^X-Spam: yes;" nil t) + spam-split-group))))))) (provide 'spam) --===-=-= -Eric -- "Excuse me --- Di Du Du Duuuuh Di Dii --- Huh Weeeheeee" (Albert King) --===-=-=-- --=-=-= -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen --=-=-=--