Gnus development mailing list
 help / color / mirror / Atom feed
From: "Rupa Schomaker (list)" <rupa-list@rupa.com>
Subject: [patch] Use user-mail-address as set by posting-styles
Date: 19 Nov 1999 07:01:45 -0800	[thread overview]
Message-ID: <m3bt8qikyu.fsf@gw.rupa.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

Attached is a patch that uses the user-mail-address (as set from
posting-styles) as an argument to senmdail -f.  This ensures that the
envelope matches the From: which is preferable in all cases for me.

Mail list managers, funky mail programs (like outlook), and mail
gateways (notes<-->smtp) seem to place more trust in the envelope than 
the From: header.

Lars, I noticed that message-generate-new-buffer-clone-locals takes an 
optional second argument according to the documentation.  However, the 
actual code doesn't work that way -- the actual argument is ignored.
This isn't used much so it probably isn't a big deal, but maybe the
arg list should be modified to reflect the real behavior.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Use user-mail-address from posting-styles --]
[-- Type: text/x-patch, Size: 1992 bytes --]

Index: gnus-msg.el
===================================================================
RCS file: /home/cvs/cvsroot/elisp/pgnus/lisp/gnus-msg.el,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 gnus-msg.el
--- gnus-msg.el	1999/07/20 18:20:36	1.1.1.2
+++ gnus-msg.el	1999/11/18 20:10:57
@@ -1192,6 +1192,8 @@
       (when (or name address)
 	(add-hook 'message-setup-hook
 		  `(lambda ()
+		     (set (make-local-variable 'user-mail-address)
+			  ,(or (cdr address) user-mail-address))
 		     (let ((user-full-name ,(or (cdr name) user-full-name))
 			   (user-mail-address
 			    ,(or (cdr address) user-mail-address)))
Index: message.el
===================================================================
RCS file: /home/cvs/cvsroot/elisp/pgnus/lisp/message.el,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 message.el
--- message.el	1999/09/03 18:17:37	1.1.1.4
+++ message.el	1999/11/18 21:03:20
@@ -2130,7 +2130,7 @@
 (defun message-send-mail-with-sendmail ()
   "Send off the prepared buffer with sendmail."
   (let ((errbuf (if message-interactive
-		    (generate-new-buffer " sendmail errors")
+		    (message-generate-new-buffer-clone-locals " sendmail errors")
 		  0))
 	resend-to-addresses delimline)
     (let ((case-fold-search t))
@@ -2167,7 +2167,11 @@
 		     ;; But some systems are more broken with -f, so
 		     ;; we'll let users override this.
 		     (if (null message-sendmail-f-is-evil)
-			 (list "-f" (user-login-name)))
+			 (list "-f"
+			       (if (null user-mail-address)
+				   (user-login-name)
+				 (user-mail-address))
+			       ))
 		     ;; These mean "report errors by mail"
 		     ;; and "deliver in background".
 		     (if (null message-interactive) '("-oem" "-odb"))
@@ -4088,7 +4092,7 @@
   (let ((locals (save-excursion
 		  (set-buffer buffer)
 		  (buffer-local-variables)))
-	(regexp "^gnus\\|^nn\\|^message"))
+	(regexp "^gnus\\|^nn\\|^message\\|^user-mail-address"))
     (mapcar
      (lambda (local)
        (when (and (consp local)

[-- Attachment #3: Type: text/plain, Size: 81 bytes --]


-- 
Rupa (rupa@rupa.com for normal email)
Please don't email duplicate replies.

             reply	other threads:[~1999-11-19 15:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-19 15:01 Rupa Schomaker (list) [this message]
1999-12-01 18:49 ` Lars Magne Ingebrigtsen
1999-12-02 21:56   ` Raymond Scholz
1999-12-03  0:22     ` Lars Magne Ingebrigtsen

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=m3bt8qikyu.fsf@gw.rupa.com \
    --to=rupa-list@rupa.com \
    /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).