Gnus development mailing list
 help / color / mirror / Atom feed
From: "Jochen Küpper" <jochen-+It19tn3Rl9sbm7dSapR3bNAH6kLmebB@public.gmane.org>
Subject: Re: Unprintable characters
Date: Mon, 10 Jan 2005 13:51:06 +0100	[thread overview]
Message-ID: <9emzvhfnwl.fsf@gowron.rz-berlin.mpg.de> (raw)
In-Reply-To: <87mzvhh3g2.fsf-wnzGKDmzZYLQT0dZR+AlfA@public.gmane.org> (Norman Walsh's message of "Mon, 10 Jan 2005 07:30:05 -0500")

[-- Attachment #1: Type: text/plain, Size: 3753 bytes --]

Norman Walsh <ndw-wnzGKDmzZYLQT0dZR+AlfA@public.gmane.org> writes:

> Additionally, is there any way to process-mark a bunch of articles and
> then have them each individually forwarded to a particular address?

I send them as a digest instead of individual messages, but here we go:
,----
| (defvar jk/spam-report-address "spam@somewhere"
|   "Email-address to report ill-classified spam.")
| (defvar jk/ham-report-address "nospam@somewhere"
|   "Email-address to report ill-classified ham.")
| (defvar jk/spam-target "nnimap+some:spam/misc"
|   "Group to move reported spam too.")
| 
| (defun jk/ham-spam-report (to-address)
|   "Digest and forward all articles in this series to the specified address."
|   (let
|       ((gnus-uu-digest-headers nil)
|        (gnus-uu-save-in-digest t)
|        (file (mm-make-temp-file (nnheader-concat gnus-uu-tmp-dir "spam-report")))
|        (message-forward-as-mime t)
|        (mail-parse-charset gnus-newsgroup-charset)
|        (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets)
|        gnus-uu-digest-buffer subject from)
|     (let ((gnus-article-reply (gnus-summary-work-articles nil)))
|       (gnus-setup-message 'forward
| 	(setq gnus-uu-digest-from-subject nil)
| 	(setq gnus-uu-digest-buffer
| 	      (gnus-get-buffer-create " *gnus spam-report*"))
| 	(gnus-uu-decode-save nil file)
| 	(switch-to-buffer gnus-uu-digest-buffer)
| 	(let ((message-forward-decoded-p t))
| 	  (message-forward nil t))))
|     (setq gnus-uu-digest-from-subject nil)
|     ;; Ok, finish mail
|     ;; Subject:
|     (goto-char (point-min))
|     (when (re-search-forward "^Subject: ")
|       (delete-region (point) (point-at-eol))
|       (insert "ham/spam report"))
|     ;; From: (Heinz only accepts reports from internal address)
|     (goto-char (point-min))
|     (when (re-search-forward "^From:")
|       (delete-region (point) (point-at-eol))
|       (insert " jochen-xIDITz2oXuw@public.gmane.org"))
|     ;; Reply-To: (Heinz only accepts reports from internal address)
|     (goto-char (point-min))
|     (when (re-search-forward "^Reply-To:" (point-max) t)
|       (delete-region (point) (point-at-eol))
|       (insert " jochen-xIDITz2oXuw@public.gmane.org"))
|     ;; To:
|     (goto-char (point-min))
|     (when (re-search-forward "^To:")
|       (delete-region (point) (point-at-eol))
|       (insert " " to-address))
|     ;; Gcc
|     (goto-char (point-min))
|     (when (re-search-forward "^Gcc:" (point-max) t)
|       (delete-region (point-at-bol) (point-at-eol))
|       (insert "Gcc: nnimap+some:sent/" (format-time-string "%Y/%m")
|               " nnimap+some:spam/reported"))
|     ;; remove signature
|     (when (message-goto-signature)
|       (delete-region (- (point) 4) (point-max)))
|     ;; and send
|     (message-send-and-exit)))
| 
| (defun jk/ham-report ()
|   "Digest and forward all articles in this series to nospam@somewhere."
|   (interactive)
|   (jk/ham-spam-report  jk/ham-report-address))
| 
| (defun jk/spam-report ()
|   "Digest and forward all articles in this series to spam@somewhere.
| In addition move the marked articles to a different group (specified in
| `jk/spam-target')."
|   (interactive)
|   (gnus-summary-save-process-mark)
|   (jk/ham-spam-report jk/spam-report-address)
|   (gnus-summary-yank-process-mark)
|   (gnus-summary-move-article nil jk/spam-target))
`----

Some more minor features, but it should work for you as well.

Greetings,
Jochen
-- 
Einigkeit und Recht und Freiheit                http://www.Jochen-Kuepper.de
    Liberté, Égalité, Fraternité                GnuPG key: CC1B0B4D
        (Part 3 you find in my messages before fall 2003.)

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

  parent reply	other threads:[~2005-01-10 12:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-10 12:30 Norman Walsh
     [not found] ` <87mzvhh3g2.fsf-wnzGKDmzZYLQT0dZR+AlfA@public.gmane.org>
2005-01-10 12:51   ` Jochen Küpper [this message]
2005-01-10 13:10 ` Francis Litterio
2005-01-10 13:19   ` Romain Francoise
2005-01-10 13:18 ` Romain Francoise

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9emzvhfnwl.fsf@gowron.rz-berlin.mpg.de \
    --to=jochen-+it19tn3rl9sbm7dsapr3bnah6klmebb@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).