+2004-05-20 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * spam.el (spam-list-of-processors, spam-registration-functions):
+ add spam-use-resend
+ (spam-group-spam-processor-report-resend-p): utility wrapper
+ (spam-report-articles-gmane): doc fix
+ (spam-report-articles-resend,
+ spam-report-resend-register-routine): wrappers around
+ spam-report-resend-to
+
+ * spam-report.el (spam-report-resend-to, spam-report-resend):
+ support for resending spam
+ (spam-report-gmane): line length >80 fix
+
+ * gnus.el (spam-process): add spam-use-resend
+
2004-05-20 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
* spam.el (spam-mark-spam-as-expired-and-move-routine): Return the
(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))
: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)
(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))
;; 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
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)
(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))
(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)
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
(when articles
(apply 'spam-report-gmane articles)))
+(defun spam-report-resend-register-routine (articles)
+ (spam-report-resend articles))
+
\f
;;;; Bogofilter
(defun spam-check-bogofilter-headers (&optional score)