2005-03-08 Juergen Kreileder <jk@blackdown.de> (tiny change)
[gnus] / lisp / spam-report.el
index b3aa3ec..b331164 100644 (file)
@@ -43,7 +43,7 @@ If you are using spam.el, consider setting gnus-spam-process-newsgroups
 or the gnus-group-spam-exit-processor-report-gmane group/topic parameter
 instead."
   :type '(radio (const nil)
-               (regexp :format "%t: %v\n" :size 0 :value "^nntp\+.*:gmane\."))
+               (regexp :value "^nntp\+.*:gmane\."))
   :group 'spam-report)
 
 (defcustom spam-report-gmane-spam-header
@@ -79,11 +79,10 @@ The function must accept the arguments `host' and `report'."
   :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."
+(defcustom spam-report-resend-to nil
+  "Email address that spam articles are resent to when reporting.
+If not set, the user will be prompted to enter a value which will be
+saved for future use."
   :type 'string
   :group 'spam-report)
 
@@ -93,12 +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/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.
@@ -109,8 +114,13 @@ 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"
+  "Report an article as spam through Gmane."
+  (interactive (gnus-summary-work-articles current-prefix-arg))
   (dolist (article articles)
     (when (and gnus-newsgroup-name
               (or (null spam-report-gmane-regex)
@@ -134,6 +144,7 @@ undo that change.")
            (gnus-message 3 "Could not find X-Report-Spam in article %d..."
                          article)))))))
 
+
 (defun spam-report-url-ping (host report)
   "Ping a host through HTTP, addressing a specific GET resource using
 the function specified by `spam-report-url-ping-function'."