From: Reiner Steib <reinersteib+gmane@imap.cc>
Subject: gnus-copy-article-ignored-headers
Date: Sun, 17 Oct 2004 19:52:33 +0200 [thread overview]
Message-ID: <v9fz4ds04e.fsf@marauder.physik.uni-ulm.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 752 bytes --]
Hi,
when copying articles from say nnml to an IMAP server, the Xref:
header isn't removed. The new variable
`gnus-copy-article-ignored-headers' cares for this, see the attached
patch. I have committed it. I anyone can think of possible problems,
please let me know.
I found such a variable useful when I needed to train bogofilter from
my ham/spam collection (on nnml) by copying the collections to
corresponding IMAP folders. Keeping Xref, X-DCC-.*-Metrics and
X-Bogosity[1] headers would have been wrong because the articles
should be as close to the original as possible.
Bye, Reiner.
[1] Actually X-Bogosity is ignored by bogofilter, IIRC.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: rs-copy-ignore.patch --]
[-- Type: text/x-patch, Size: 1060 bytes --]
--- gnus-art.el 7 Oct 2004 13:54:59 -0000 7.56
+++ gnus-art.el 17 Oct 2004 17:40:22 -0000
@@ -564,6 +564,15 @@
:type 'hook
:group 'gnus-article-various)
+(defcustom gnus-copy-article-ignored-headers '("Xref")
+ "List of headers to be removed when copying an article.
+Each element is a regular expression."
+ :version "22.0" ;; No Gnus
+ :type '(choice :custom-show nil
+ regexp
+ (repeat regexp))
+ :group 'gnus-article-various)
+
(make-obsolete-variable 'gnus-article-hide-pgp-hook
"This variable is obsolete in Gnus 5.10.")
--- gnus-sum.el 12 Oct 2004 02:26:52 -0000 7.61
+++ gnus-sum.el 17 Oct 2004 17:40:23 -0000
@@ -9018,6 +9018,10 @@
(save-excursion
(set-buffer copy-buf)
(when (gnus-request-article-this-buffer article gnus-newsgroup-name)
+ (save-restriction
+ (nnheader-narrow-to-headers)
+ (dolist (hdr gnus-copy-article-ignored-headers)
+ (message-remove-header hdr t)))
(gnus-request-accept-article
to-newsgroup select-method (not articles) t))))
;; Crosspost the article.
next reply other threads:[~2004-10-17 17:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-17 17:52 Reiner Steib [this message]
2004-10-17 20:56 ` gnus-copy-article-ignored-headers Reiner Steib
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=v9fz4ds04e.fsf@marauder.physik.uni-ulm.de \
--to=reinersteib+gmane@imap.cc \
--cc=Reiner.Steib@gmx.de \
/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).