From be603724586383e851e0098e5d0b01b8a1c8ced5 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 7 Jun 2004 22:17:41 +0000 Subject: [PATCH] Synch to No Gnus 200406071711. --- lisp/ChangeLog | 14 ++++++++++++++ lisp/gnus.el | 23 ++++++++++++++++++++++- lisp/spam-report.el | 14 ++++++++++---- lisp/spam.el | 26 ++++++++++++++++++-------- 4 files changed, 64 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a05155a..da11acf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2004-06-07 Teodor Zlatanov + + * spam.el (spam-report-articles-resend) + (spam-report-resend-register-routine): allow ham reporting + (spam-report-resend-register-ham-routine): simple wrapper + (spam-registration-functions): add ham resending functions + (spam-list-of-processors): add ham resend processor + + * gnus.el (ham-resend-to): new group parameter + (spam-process): add ham resend option + + * spam-report.el (spam-report-resend): allow reporting ham + (spam-report-resend-ham): simple wrapper + 2004-06-06 Lars Magne Ingebrigtsen * message.el (message-cite-articles-with-x-no-archive): New diff --git a/lisp/gnus.el b/lisp/gnus.el index f8508e7..81aa98c 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1879,6 +1879,24 @@ When a spam group is entered, all unread articles are marked as spam.") :parameter-document "The address to get spam resent (through spam-report-resend).") + (gnus-define-group-parameter + ham-resend-to + :type list + :function-document + "The address to get ham resent (through spam-report-resend)." + :variable gnus-ham-resend-to + :variable-default nil + :variable-document + "The address to get ham resent (through spam-report-resend)." + :variable-group spam + :variable-type '(repeat + (list :tag "Group address for resending ham" + (regexp :tag "Group") + (string :tag "E-mail address for resending ham (requires the spam-use-resend exit processor)"))) + :parameter-type 'string :tag "E-mail address for resending ham (requires the spam-use-resend exit processor)" + :parameter-document + "The address to get ham resent (through spam-report-resend).") + (defvar gnus-group-spam-exit-processor-ifile "ifile" "OBSOLETE: The ifile summary exit spam processor.") @@ -1949,6 +1967,7 @@ Only applicable to non-spam (unclassified and ham) groups.") (const :tag "Ham: Bogofilter" (ham spam-use-bogofilter)) (const :tag "Ham: Bsfilter" (ham spam-use-bsfilter)) (const :tag "Ham: Copy" (ham spam-use-ham-copy)) + (const :tag "Ham: Resend Message" (ham spam-use-resend)) (const :tag "Ham: ifile" (ham spam-use-ifile)) (const :tag "Ham: Spam Oracle" (ham spam-use-spamoracle)) (const :tag "Ham: Spam-stat" (ham spam-use-stat)) @@ -1987,8 +2006,9 @@ spam processing, associated with the appropriate processor." (const :tag "Spam: Bogofilter" (spam spam-use-bogofilter)) (const :tag "Spam: Blacklist" (spam spam-use-blacklist)) (const :tag "Spam: Bsfilter" (spam spam-use-bsfilter)) - (const :tag "Spam: ifile" (spam spam-use-ifile)) (const :tag "Spam: Gmane Report" (spam spam-use-gmane)) + (const :tag "Spam: Resend Message"(spam spam-use-resend)) + (const :tag "Spam: ifile" (spam spam-use-ifile)) (const :tag "Spam: Spam-stat" (spam spam-use-stat)) (const :tag "Spam: Spam Oracle" (spam spam-use-spamoracle)) (const :tag "Spam: SpamAssassin" (spam spam-use-spamassassin)) @@ -1997,6 +2017,7 @@ spam processing, associated with the appropriate processor." (const :tag "Ham: Bogofilter" (ham spam-use-bogofilter)) (const :tag "Ham: Bsfilter" (ham spam-use-bsfilter)) (const :tag "Ham: Copy" (ham spam-use-ham-copy)) + (const :tag "Ham: Resend Message" (ham spam-use-resend)) (const :tag "Ham: ifile" (ham spam-use-ifile)) (const :tag "Ham: Spam-stat" (ham spam-use-stat)) (const :tag "Ham: Spam Oracle" (ham spam-use-spamoracle)) diff --git a/lisp/spam-report.el b/lisp/spam-report.el index a441fc4..b98598e 100644 --- a/lisp/spam-report.el +++ b/lisp/spam-report.el @@ -92,16 +92,18 @@ This variable will store the value of `spam-report-url-ping-function' from before `spam-report-agentize' was run, so that `spam-report-deagentize' can undo that change.") -(defun spam-report-resend (articles) - "Report an article as spam by resending via email." +(defun spam-report-resend (articles &optional ham) + "Report an article as spam by resending via email. +Reports is as ham when HAM is set." (dolist (article articles) (gnus-message 6 - "Reporting spam article %d to <%s>..." + "Reporting %s article %d to <%s>..." + (if ham "ham" "spam") article spam-report-resend-to) (unless spam-report-resend-to (customize-set-variable spam-report-resend-to - (read-from-minibuffer "email address to resend SPAM to? "))) + (read-from-minibuffer "email address to resend SPAM/HAM to? "))) ;; This is ganked from the `gnus-summary-resend-message' function. ;; It involves rendering the SPAM, which is undesirable, but there does ;; not seem to be a nicer way to achieve this. @@ -112,6 +114,10 @@ undo that change.") (set-buffer gnus-original-article-buffer) (message-resend spam-report-resend-to)))) +(defun spam-report-resend-ham (articles) + "Report an article as ham by resending via email." + (spam-report-resend articles t)) + (defun spam-report-gmane (&rest articles) "Report an article as spam through Gmane" (dolist (article articles) diff --git a/lisp/spam.el b/lisp/spam.el index 945e010..af3c838 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -730,6 +730,8 @@ finds ham or spam.") (gnus-group-spam-exit-processor-spamoracle spam spam-use-spamoracle) (nil spam spam-use-crm114) (gnus-group-spam-exit-processor-spamassassin spam spam-use-spamassassin) + + (nil ham spam-use-resend) (gnus-group-ham-exit-processor-ifile ham spam-use-ifile) (gnus-group-ham-exit-processor-bogofilter ham spam-use-bogofilter) (gnus-group-ham-exit-processor-bsfilter ham spam-use-bsfilter) @@ -775,17 +777,19 @@ Respects the process/prefix convention." (gnus-summary-remove-process-mark article) (spam-report-gmane article))) -(defun spam-report-articles-resend (n) +(defun spam-report-articles-resend (n &optional ham) "Report the current message as spam by resending it. Respects the process/prefix convention. Also see -`spam-report-resend-to'." +`spam-report-resend-to'. Operates as ham when HAM is set." (interactive "P") (let* ((gp - (gnus-parameter-spam-resend-to gnus-newsgroup-name)) + (if ham + (gnus-parameter-ham-resend-to gnus-newsgroup-name) + (gnus-parameter-spam-resend-to gnus-newsgroup-name))) (spam-report-resend-to (or (car-safe gp) spam-report-resend-to)) (articles (gnus-summary-work-articles n))) - (spam-report-resend articles) + (spam-report-resend articles ham) (dolist (article articles) (gnus-summary-remove-process-mark article)))) @@ -1383,7 +1387,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." ;; does Gmane support unregistration? nil nil) - (spam-use-resend nil + (spam-use-resend spam-report-resend-register-ham-routine spam-report-resend-register-routine nil nil) @@ -2120,11 +2124,17 @@ REMOVE not nil, remove the ADDRESSES." (when articles (apply 'spam-report-gmane articles))) -(defun spam-report-resend-register-routine (articles) - (let* ((resend-to-gp (gnus-parameter-spam-resend-to gnus-newsgroup-name)) +(defun spam-report-resend-register-ham-routine (articles) + (spam-report-resend-register-routine articles t)) + +(defun spam-report-resend-register-routine (articles &optional ham) + (let* ((resend-to-gp + (if ham + (gnus-parameter-ham-resend-to gnus-newsgroup-name) + (gnus-parameter-spam-resend-to gnus-newsgroup-name))) (spam-report-resend-to (or (car-safe resend-to-gp) spam-report-resend-to))) - (spam-report-resend articles))) + (spam-report-resend articles ham))) ;;;; Bogofilter -- 1.7.10.4