aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1994-11-30 22:03:35 +0000
committerKarl Heuer1994-11-30 22:03:35 +0000
commitea9ceb343eac9d8246c69beada8d5566a90dbba7 (patch)
treee9ecc0bd4c27aa41ab9178633d94fbd0f2e7129a
parent2d325322c176230621467967c18fec13f7ba47ac (diff)
downloademacs-ea9ceb343eac9d8246c69beada8d5566a90dbba7.tar.gz
emacs-ea9ceb343eac9d8246c69beada8d5566a90dbba7.zip
(sendmail-send-it): Add `From:' header.
(mail-from-style): New variable.
-rw-r--r--lisp/mail/sendmail.el23
1 files changed, 23 insertions, 0 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 9d0f998df18..63b0b646c19 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -29,6 +29,17 @@
29;;; Code: 29;;; Code:
30 30
31;;;###autoload 31;;;###autoload
32(defvar mail-from-style 'angles "\
33*Specifies how \"From:\" fields look.
34
35If `nil', they contain just the return address like:
36 king@grassland.com
37If `parens', they look like:
38 king@grassland.com (Elvis Parsley)
39If `angles', they look like:
40 Elvis Parsley <king@grassland.com>")
41
42;;;###autoload
32(defvar mail-self-blind nil "\ 43(defvar mail-self-blind nil "\
33Non-nil means insert BCC to self in messages to be sent. 44Non-nil means insert BCC to self in messages to be sent.
34This is done when the message is initialized, 45This is done when the message is initialized,
@@ -488,6 +499,18 @@ the user from the mailer."
488 (goto-char (point-min)) 499 (goto-char (point-min))
489 (if (re-search-forward "^Subject:[ \t]*\n" delimline t) 500 (if (re-search-forward "^Subject:[ \t]*\n" delimline t)
490 (replace-match "")) 501 (replace-match ""))
502 ;; Put the "From:" field in unless for some odd reason
503 ;; they put one in themselves.
504 (goto-char (point-min))
505 (if (not (re-search-forward "^From:" delimline t))
506 (let* ((login (user-login-name))
507 (fullname (user-full-name)))
508 (cond ((eq mail-from-style 'angles)
509 (insert "From: " fullname " <" login ">\n"))
510 ((eq mail-from-style 'parens)
511 (insert "From: " login " (" fullname ")\n"))
512 ((null mail-from-style)
513 (insert "From: " login "\n")))))
491 ;; Insert an extra newline if we need it to work around 514 ;; Insert an extra newline if we need it to work around
492 ;; Sun's bug that swallows newlines. 515 ;; Sun's bug that swallows newlines.
493 (goto-char (1+ delimline)) 516 (goto-char (1+ delimline))