Gnus development mailing list
 help / color / mirror / Atom feed
From: deskpot@myrealbox.com (Vasily Korytov)
Subject: [Patch] Make message-user-mail-address use From header
Date: Tue, 25 Feb 2003 00:13:51 +0300	[thread overview]
Message-ID: <87of51xtyo.fsf@unix.home> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 391 bytes --]

I was annoyed, message-user-mail-address function uses the
user-mail-address variable only. It may be desireable in some cases to
have it derived from the From header (esp, in the
message-send-mail-with-sendmail function).

This patch seems to do it. But I'm really not sure, if it breaks
something.

BTW, maybe, we should add a check for Errors-To header prior to From?
Opinions?

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: message.el.patch --]
[-- Type: text/x-patch, Size: 783 bytes --]

--- message.el~	Wed Feb  5 00:07:25 2003
+++ message.el	Tue Feb 25 00:01:30 2003
@@ -4473,10 +4473,15 @@
 
 (defun message-user-mail-address ()
   "Return the pertinent part of `user-mail-address'."
-  (when user-mail-address
-    (if (string-match " " user-mail-address)
-	(nth 1 (mail-extract-address-components user-mail-address))
-      user-mail-address)))
+  (let ((from (message-fetch-field "From")))
+    (if from
+	(if (string-match " " from)
+	    (nth 1 (mail-extract-address-components from))
+	  from)
+      (when user-mail-address
+	(if (string-match " " user-mail-address)
+	    (nth 1 (mail-extract-address-components user-mail-address))
+	  user-mail-address)))))
 
 (defun message-make-fqdn ()
   "Return user's fully qualified domain name."

[-- Attachment #1.3: Type: text/plain, Size: 141 bytes --]

-- 
       I accept RFC3156 and RFC1991-compatible encrypted mail.
PGP key fingerprint: 123A 7CCE 6E26 6233 0D87 E01A A0F8 3524 FCD8 1841

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

             reply	other threads:[~2003-02-24 21:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-24 21:13 Vasily Korytov [this message]
2003-02-25  1:34 ` Jesper Harder
2003-02-25  3:33   ` Jesper Harder
2003-02-25  9:11     ` Vasily Korytov

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=87of51xtyo.fsf@unix.home \
    --to=deskpot@myrealbox.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).