? resend.patch Index: gnus.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus.el,v retrieving revision 7.18 diff -u -r7.18 gnus.el --- gnus.el 12 May 2004 21:00:54 -0000 7.18 +++ gnus.el 18 May 2004 20:13:20 -0000 @@ -1896,6 +1896,7 @@ (const :tag "Spam: Blacklist" (spam spam-use-blacklist)) (const :tag "Spam: Bsfilter" (spam spam-use-bsfilter)) (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 Oracle" (spam spam-use-spamoracle)) (const :tag "Spam: Spam-stat" (spam spam-use-stat)) Index: spam-report.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/spam-report.el,v retrieving revision 7.7 diff -u -r7.7 spam-report.el --- spam-report.el 25 Feb 2004 23:53:49 -0000 7.7 +++ spam-report.el 18 May 2004 20:13:20 -0000 @@ -79,12 +79,36 @@ :type 'file :group 'spam-report) +(defcustom spam-report-resend-to (or + (when (length user-mail-address) + user-mail-address) + "nonexistent-user-please-fix@invalid.domain") + "Email address that spam articles are resent to when reporting." + :type 'string + :group 'spam-report) + (defvar spam-report-url-ping-temp-agent-function nil "Internal variable for `spam-report-agentize' and `spam-report-deagentize'. 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 (&rest articles) + "Report an article as spam by resending via email." + (dolist (article articles) + (gnus-message 6 + "Reporting spam article %d to <%s>..." + article spam-report-resend-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. + ;; select this particular article + (gnus-summary-select-article nil nil nil article) + ;; resend it to the destination address + (save-excursion + (set-buffer gnus-original-article-buffer) + (message-resend spam-report-resend-to)))) + (defun spam-report-gmane (&rest articles) "Report an article as spam through Gmane" (dolist (article articles) @@ -93,10 +117,11 @@ (string-match spam-report-gmane-regex gnus-newsgroup-name))) (gnus-message 6 "Reporting spam article %d to spam.gmane.org..." article) (if spam-report-gmane-use-article-number - (spam-report-url-ping "spam.gmane.org" - (format "/%s:%d" - (gnus-group-real-name gnus-newsgroup-name) - article)) + (spam-report-url-ping + "spam.gmane.org" + (format "/%s:%d" + (gnus-group-real-name gnus-newsgroup-name) + article)) (with-current-buffer nntp-server-buffer (gnus-request-head article gnus-newsgroup-name) (goto-char (point-min)) Index: spam.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/spam.el,v retrieving revision 7.37 diff -u -r7.37 spam.el --- spam.el 17 May 2004 14:28:21 -0000 7.37 +++ spam.el 18 May 2004 20:13:20 -0000 @@ -55,7 +55,8 @@ ;; autoload spam-report (eval-and-compile - (autoload 'spam-report-gmane "spam-report")) + (autoload 'spam-report-gmane "spam-report") + (autoload 'spam-report-resend "spam-report")) ;; autoload gnus-registry (eval-and-compile @@ -659,7 +660,9 @@ nil)) (defvar spam-list-of-processors + ;; note the resend and gmane processors are not defined in gnus.el '((gnus-group-spam-exit-processor-report-gmane spam spam-use-gmane) + (gnus-group-spam-exit-processor-report-resend spam spam-use-resend) (gnus-group-spam-exit-processor-bogofilter spam spam-use-bogofilter) (gnus-group-spam-exit-processor-bsfilter spam spam-use-bsfilter) (gnus-group-spam-exit-processor-blacklist spam spam-use-blacklist) @@ -705,6 +708,9 @@ (defun spam-group-spam-processor-report-gmane-p (group) (spam-group-processor-p group 'gnus-group-spam-exit-processor-report-gmane)) +(defun spam-group-spam-processor-report-resend-p (group) + (spam-group-processor-p group 'gnus-group-spam-exit-processor-report-resend)) + (defun spam-group-spam-processor-bogofilter-p (group) (spam-group-processor-p group 'gnus-group-spam-exit-processor-bogofilter)) @@ -742,13 +748,23 @@ (spam-group-processor-p group 'gnus-group-ham-exit-processor-spamoracle)) (defun spam-report-articles-gmane (n) - "Report the current message as spam. + "Report the current message as spam via Gmane. Respects the process/prefix convention." (interactive "P") (dolist (article (gnus-summary-work-articles n)) (gnus-summary-remove-process-mark article) (spam-report-gmane article))) +(defun spam-report-articles-resend (n) + "Report the current message as spam by resending it. +Respects the process/prefix convention. Also see +`spam-report-resend-to'." + (interactive "P") + (let ((articles (gnus-summary-work-articles n))) + (spam-report-resend articles) + (dolist (article articles) + (gnus-summary-remove-process-mark article)))) + (defun spam-necessary-extra-headers () "Return the extra headers spam.el thinks are necessary." (let (list) @@ -1323,12 +1339,16 @@ spam-stat-register-spam-routine spam-stat-unregister-ham-routine spam-stat-unregister-spam-routine) - ;; note that spam-use-gmane is not a legitimate check + ;; note that spam-use-gmane and spam-use-resend are not legitimate checks (spam-use-gmane nil spam-report-gmane-register-routine ;; does Gmane support unregistration? nil nil) + (spam-use-resend nil + spam-report-resend-register-routine + nil + nil) (spam-use-spamassassin spam-spamassassin-register-ham-routine spam-spamassassin-register-spam-routine spam-spamassassin-unregister-ham-routine @@ -2055,6 +2075,9 @@ (defun spam-report-gmane-register-routine (articles) (when articles (apply 'spam-report-gmane articles))) + +(defun spam-report-resend-register-routine (articles) + (spam-report-resend articles)) ;;;; Bogofilter