🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #725

sendmail.el - FCC output doesn't have "From: " header field

#725
From: Kevin Broadey
Date: Fri, 28 Aug 1992 17:40
53 lines
2429 bytes
When running Rmail on the file I do FCC output to, the rmail-summary
buffer didn't show anything in the "From/To" field.  It should show the
address the message went to.

While the fix could be made in Rmail, to get it to recognise sendmail's
"From" line (which doesn't have a colon and has the date tagged on), I
decided to get sendmail to output a correctly-formatted header.

The following code is from the emacs 18.58 sendmail.el file.  The lines
I've changed are preceded by "!".

Emacs 18.57 didn't have the "timezone" handling - I've marked these
lines with "*" for those wishing to upgrade this version.

-- snip -- snip -- snip -- snip -- snip -- snip -- snip -- snip --

(defun mail-do-fcc (header-end)
  (let (fcc-list
	(rmailbuf (current-buffer))
*	timezone
	(tembuf (generate-new-buffer " rmail output"))
	(case-fold-search t))
    (save-excursion
      (goto-char (point-min))
      (while (re-search-forward "^FCC:[ \t]*" header-end t)
	(setq fcc-list (cons (buffer-substring (point)
					       (progn
						 (end-of-line)
						 (skip-chars-backward " \t")
						 (point)))
			     fcc-list))
	(delete-region (match-beginning 0)
		       (progn (forward-line 1) (point))))
      (set-buffer tembuf)
      (erase-buffer)
*     (call-process "date" nil t nil)
*     (end-of-line)
*     (forward-word -1)
*     (delete-region (1- (point)) (point-max))
*     (forward-word -1)
*     (setq timezone (buffer-substring (point) (point-max)))
*     (erase-buffer)
!     (insert "Date: " (current-time-string) " " timezone "\n"
!	      "From: " (user-login-name) "\n")
      (insert-buffer-substring rmailbuf)

-- snip -- snip -- snip -- snip -- snip -- snip -- snip -- snip --

--
Kevin Broadey <kbroadey@edscom.demon.co.uk>
EDS-Scicon, Wavendon Tower, Wavendon, Milton Keynes, MK17 8LX, England.
Phone: +44 908 284198 (direct) or +44 908 585858 ext 4198
These opinions are mine: others available on request.
Technical Details
Message-ID: <KEVIN.92Aug28174043@runningbear.edscom.demon.co.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!edscom.demon.co.uk!kevin

Show Full Headers
Complete Article Headers
Newsgroups: gnu.emacs.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!edscom.demon.co.uk!kevin
From: kevin@edscom.demon.co.uk (Kevin Broadey)
Subject: sendmail.el - FCC output doesn't have "From: " header field
Message-ID: <KEVIN.92Aug28174043@runningbear.edscom.demon.co.uk>
Sender: gnulists@ai.mit.edu
Organization: EDS-Scicon, Milton Keynes, UK
Distribution: gnu
Date: Fri, 28 Aug 1992 17:40:43 GMT
Approved: bug-gnu-emacs@prep.ai.mit.edu
Lines: 54