From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62092 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Re: spam-check-spamassassin-headers with spamassasin 3.0/3.1 Date: Sat, 25 Feb 2006 22:33:06 +0100 Message-ID: References: <873biqwtf5.fsf@puyo.nijino.com> <874q2owb1f.fsf%irie@t.email.ne.jp> Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1140911596 3077 80.91.229.2 (25 Feb 2006 23:53:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 25 Feb 2006 23:53:16 +0000 (UTC) Cc: ding@gnus.org Original-X-From: ding-owner+m10620@lists.math.uh.edu Sun Feb 26 00:53:15 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FD9Dq-00031i-L1 for ding-account@gmane.org; Sun, 26 Feb 2006 00:53:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1FD9Di-0008R0-00; Sat, 25 Feb 2006 17:53:02 -0600 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FD9A3-0008Qv-00 for ding@lists.math.uh.edu; Sat, 25 Feb 2006 17:49:15 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1FD99z-0000aS-Fm for ding@lists.math.uh.edu; Sat, 25 Feb 2006 17:49:15 -0600 Original-Received: from mail.uni-ulm.de ([134.60.1.1]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FD99y-0001o8-00 for ; Sun, 26 Feb 2006 00:49:10 +0100 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by mail.uni-ulm.de (8.13.4/8.13.4) with ESMTP id k1PNmvBp023319; Sun, 26 Feb 2006 00:48:57 +0100 (MET) Original-Received: from viandante.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by bridgekeeper.physik.uni-ulm.de (Postfix) with SMTP id 073A711028; Sun, 26 Feb 2006 00:48:55 +0100 (CET) Original-Received: (nullmailer pid 20740 invoked by uid 170); Sat, 25 Feb 2006 21:33:06 -0000 Original-To: IRIE Tetsuya Mail-Followup-To: IRIE Tetsuya , ding@gnus.org X-Face: mtjf/D:es1T0wHO:&CJ'ZXe"l;3C--rw\z!{`eFwL){|]RpI+4{u25L=5C /0>KuGeTsk<~<&NE-AKV1560e!+RJeyWmSskkrJm?[vUV#66{T_m|Ae<||Ku#Mk5`y&O`n~z2;n8eP J5#2h@2eQgV@E70IY_0WlEx!"&giy{+\%h1LJox$zv@/l%ZmU4^tZA>xQpnkUBVC5.jpg#0'(+2?Rs )NAr:>3<=WxHE$ktbLysDIM5TbmHu*3 (IRIE Tetsuya's message of "Sat, 25 Feb 2006 09:47:09 +0900") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-DCC-MessageCare-Metrics: gemini 1108; Body=2 Fuz1=2 Fuz2=2 X-Spam-Score: -2.6 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:62092 Archived-At: On Sat, Feb 25 2006, IRIE Tetsuya wrote: [ "hits=" vs. "score=" ] > Score displayed in summary buffer becomes incorrect if using with > spamassassin 3.x. > (info "(gnus)Spam ELisp Package Sorting and Score Display in Summary > Buffer") > > I think that a similar change is necessary also for > `spam-extra-header-to-number'. Could you try the following patch, please? --8<---------------cut here---------------start------------->8--- --- spam.el 14 Feb 2006 15:57:49 +0100 7.78 +++ spam.el 25 Feb 2006 22:26:08 +0100 @@ -1173,6 +1173,11 @@ (return)))) result)) +(defvar spam-spamassassin-score-regexp "\\(?:score\\|hits\\)=\\(-?[0-9.]+\\)" + "Regexp matching SpamAssassin score header. +The first group must match the number.") +;; "score" for Spamassassin 3.0 or later. + (defun spam-extra-header-to-number (header headers) "Transform an extra HEADER to a number, using list of HEADERS. Note this has to be fast." @@ -1181,7 +1186,8 @@ ((eq header 'X-Spam-Status) (string-to-number (gnus-replace-in-string (gnus-extra-header header headers) - ".*hits=" ""))) + spam-spamassassin-score-regexp + "\\1"))) ;; for CRM checking, it's probably faster to just do the string match ((and spam-use-crm114 (string-match "( pR: \\([0-9.-]+\\)" header)) (match-string 1 header)) @@ -2615,8 +2621,7 @@ (if score ; scoring mode (let ((header (message-fetch-field spam-spamassassin-spam-status-header))) (when header - (if (string-match "\\(?:score\\|hits\\)=\\(-?[0-9.]+\\)" header) - ;; "score" for Spamassassin 3.0 or later. + (if (string-match spam-spamassassin-score-regexp header) (match-string 1 header) "0"))) ;; spam detection mode --8<---------------cut here---------------end--------------->8--- Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/