Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!gem.mps.ohio-state.edu!ginosko!uunet!lll-winken!arisia!cutting From: cutting@bopp.PARC.xerox.com (Doug Cutting) Newsgroups: gnu.emacs.bug Subject: sendmail.el: problems with user-specified "From" fields Message-ID: Date: 15 Sep 89 19:22:36 GMT Sender: news@arisia.Xerox.COM Distribution: gnu Organization: Xerox PARC, Palo Alto, CA Lines: 33 When one specifies a "From" line in a messge being sent a "Sender" line is inserted unless one is already present. This has two problems: (1) if the "From" line contains the same address as the current user then the "Sender" line is annoyingly redundant; and (2) users are allowed to specify "Sender" lines. Following are diffs for emacs 18.54 sendmail.el which fix these. First, user-provided "Sender" fields are prohibited. Second, "Sender" fields are only inserted when the address on the "From" line (if present) is different than the current user. Doug 207a208,210 > (goto-char (point-min)) > (if (re-search-forward "^Sender:" delimline t) > (error "Sender may not be specified.")) 212c215 < ;; If there is a From and no Sender, put it a Sender. --- > ;; If the From is different than current user, insert Sender 215,217c218,224 < (not (save-excursion < (goto-char (point-min)) < (re-search-forward "^Sender:" delimline t))) --- > (require 'mail-utils) > (not (string-equal > (mail-strip-quoted-names > (save-restriction > (narrow-to-region (point-min) delimline) > (mail-fetch-field "From"))) > (user-login-name)))