Gnus development mailing list
 help / color / mirror / Atom feed
* [Patch] Make message-user-mail-address use From header
@ 2003-02-24 21:13 Vasily Korytov
  2003-02-25  1:34 ` Jesper Harder
  0 siblings, 1 reply; 4+ messages in thread
From: Vasily Korytov @ 2003-02-24 21:13 UTC (permalink / 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-02-25  9:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-24 21:13 [Patch] Make message-user-mail-address use From header Vasily Korytov
2003-02-25  1:34 ` Jesper Harder
2003-02-25  3:33   ` Jesper Harder
2003-02-25  9:11     ` Vasily Korytov

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).