Function: gnus-summary-resend-message

gnus-summary-resend-message is an autoloaded, interactive and byte-compiled function defined in gnus-msg.el.gz.

Signature

(gnus-summary-resend-message ADDRESS N &optional NO-SELECT)

Documentation

Resend the current article to ADDRESS.

Uses the process/prefix convention. If NO-SELECT, don't display the message before resending.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-msg.el.gz
(defun gnus-summary-resend-message (address n &optional no-select)
  "Resend the current article to ADDRESS.
Uses the process/prefix convention.  If NO-SELECT, don't display
the message before resending."
  (interactive
   (list (message-read-from-minibuffer
	  "Resend message(s) to: "
	  (when (and gnus-summary-resend-default-address
		     (gnus-buffer-live-p gnus-original-article-buffer))
	    ;; If some other article is currently selected, the
	    ;; initial-contents is wrong. Whatever, it is just the
	    ;; initial-contents.
	    (with-current-buffer gnus-original-article-buffer
	      (nnmail-fetch-field "to"))))
	 current-prefix-arg)
   gnus-summary-mode)
  (let ((message-header-setup-hook (copy-sequence message-header-setup-hook))
	(message-sent-hook (copy-sequence message-sent-hook))
	;; Honor posting-style for `name' and `address' in Resent-From header.
	(styles (gnus-group-find-parameter gnus-newsgroup-name
					   'posting-style t))
	(user-full-name user-full-name)
	(user-mail-address user-mail-address)
	(group gnus-newsgroup-name)
	tem)
    (dolist (style styles)
      (when (stringp (cadr style))
	(setcdr style (list (decode-coding-string (cadr style) 'utf-8)))))
    (dolist (style (if styles
		       (append gnus-posting-styles (list (cons ".*" styles)))
		     gnus-posting-styles))
      (when (and (stringp (car style))
		 (string-match (pop style) gnus-newsgroup-name))
	(when (setq tem (cadr (assq 'name style)))
	  (setq user-full-name tem))
	(when (setq tem (cadr (assq 'address style)))
	  (setq user-mail-address tem))))
    ;; `gnus-summary-resend-message-insert-gcc' must run last.
    (add-hook 'message-header-setup-hook
	      #'gnus-summary-resend-message-insert-gcc t)
    (add-hook 'message-sent-hook
	      (let ((agent gnus-agent))
		(lambda ()
		  (let ((rfc2047-encode-encoded-words nil))
		    (if agent
			(gnus-agent-possibly-do-gcc)
		      (gnus-inews-do-gcc))))))
    (dolist (article (gnus-summary-work-articles n))
      (if no-select
	  (with-current-buffer " *nntpd*"
	    (erase-buffer)
	    (gnus-request-article article group)
	    (let ((gnus-gcc-externalize-attachments nil)
		  (message-inhibit-body-encoding t))
	      (message-resend address)))
	(gnus-summary-select-article nil nil nil article)
	(with-current-buffer gnus-original-article-buffer
	  (let ((gnus-gcc-externalize-attachments nil)
		(message-inhibit-body-encoding t))
	    (message-resend address))))
      (gnus-summary-mark-article-as-forwarded article))))