+2004-06-07 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * 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 <larsi@gnus.org>
* message.el (message-cite-articles-with-x-no-archive): New
: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.")
(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))
(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))
(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))
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.
(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)
(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)
(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))))
;; 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)
(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)))
\f
;;;; Bogofilter