Gnus development mailing list
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
Subject: [PATCH] Removing headers from message when resending.
Date: Tue, 23 Apr 2002 09:45:47 +0200	[thread overview]
Message-ID: <vpq1yd6zwlw.fsf@montrose.imag.fr> (raw)

Hi ! 

I have made a slight modification to gnus-summary-resend-message-edit,
which  I  had written  some  time ago.  It  now  removes headers  like
forwarding does. Can someone apply it ?

-- 
Matthieu

(defcustom message-resend-ignored-headers "^Content-Transfer-Encoding:\\|^X-Gnus\\|^Received:\\|^X-"
  "*All headers that match this regexp will be deleted when forwarding a message."
  :version "21.1"
  :group 'message-forwarding
  :type '(choice (const :tag "None" nil)
		 regexp))

;;;###autoload
(defun gnus-summary-resend-article-edit ()
  "In gnus summary mode, resend an article that has already been sent.
A new buffer will be created to allow the user to modify body and
contents of the message, and then, everything will happen as when
composing a new message."
  (interactive)
  (let ((article (gnus-summary-article-number)))
    (gnus-setup-message 'reply-yank
      (gnus-summary-select-article t)
      (set-buffer gnus-original-article-buffer)
      (let ((cur (current-buffer))
	    (to (message-fetch-field "to")))
	;; Get a normal message buffer.
	(message-pop-to-buffer (message-buffer-name "Resend" to))
	(insert-buffer-substring cur)
	(mime-to-mml)
	(message-narrow-to-head-1)
	;; Gnus will generate a new one when sending.
	(message-remove-header "Message-ID")
	(message-remove-header message-resend-ignored-headers t)
	;; Remove unwanted headers.
	(goto-char (point-max))
	(insert mail-header-separator)
	(goto-char (point-min))
 	(re-search-forward "^To: *\\|^Newsgroups: *" nil 'move)
	(widen)
	)
      )))




             reply	other threads:[~2002-04-23  7:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-23  7:45 Matthieu Moy [this message]
2002-04-23 16:06 ` Kai Großjohann
2002-04-23 16:42   ` Matthieu Moy

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=vpq1yd6zwlw.fsf@montrose.imag.fr \
    --to=matthieu.moy@imag.fr \
    /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).