From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/50355 Path: main.gmane.org!not-for-mail From: deskpot@myrealbox.com (Vasily Korytov) Newsgroups: gmane.emacs.gnus.general Subject: [Patch] Make message-user-mail-address use From header Date: Tue, 25 Feb 2003 00:13:51 +0300 Sender: owner-ding@hpc.uh.edu Message-ID: <87of51xtyo.fsf@unix.home> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: main.gmane.org 1046121459 14809 80.91.224.249 (24 Feb 2003 21:17:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 24 Feb 2003 21:17:39 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18nPyj-0003qM-00 for ; Mon, 24 Feb 2003 22:17:37 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18nPuF-0005ac-00; Mon, 24 Feb 2003 15:12:59 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 24 Feb 2003 15:13:59 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id PAA07208 for ; Mon, 24 Feb 2003 15:13:45 -0600 (CST) Original-Received: (qmail 17956 invoked by alias); 24 Feb 2003 21:12:33 -0000 Original-Received: (qmail 17950 invoked from network); 24 Feb 2003 21:12:33 -0000 Original-Received: from ns1.telekom.ru (root@194.190.195.83) by 66.230.238.6 with SMTP; 24 Feb 2003 21:12:33 -0000 Original-Received: from unix.home (h84.37.elnet.msk.ru [195.58.37.84]) by ns1.telekom.ru (8.12.6/8.12.6) with SMTP id h1OLCJis030887 for ; Tue, 25 Feb 2003 00:12:19 +0300 Original-Received: (qmail 766 invoked from network); 24 Feb 2003 21:15:42 -0000 Original-Received: from localhost (alias@127.0.0.1) by localhost with QMTP; 24 Feb 2003 21:15:42 -0000 Original-Received: (qmail 711 invoked by uid 1000); 24 Feb 2003 21:13:53 -0000 Original-To: ding@gnus.org X-Attribution: VK Mail-Copies-To: never User-Agent: Gnus/5.090016 (Oort Gnus v0.16) XEmacs/21.4 (Portable Code, linux) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:50355 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:50355 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Transfer-Encoding: quoted-printable 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? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=message.el.patch Content-Transfer-Encoding: quoted-printable =2D-- message.el~ Wed Feb 5 00:07:25 2003 +++ message.el Tue Feb 25 00:01:30 2003 @@ -4473,10 +4473,15 @@ =20 (defun message-user-mail-address () "Return the pertinent part of `user-mail-address'." =2D (when user-mail-address =2D (if (string-match " " user-mail-address) =2D (nth 1 (mail-extract-address-components user-mail-address)) =2D 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))))) =20 (defun message-make-fqdn () "Return user's fully qualified domain name." --=-=-= Content-Transfer-Encoding: quoted-printable =2D-=20 I accept RFC3156 and RFC1991-compatible encrypted mail. PGP key fingerprint: 123A 7CCE 6E26 6233 0D87 E01A A0F8 3524 FCD8 1841 --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+WosRoPg1JPzYGEERAl2bAKD4HB6MJrURqQKTduSRlA8PZqrgKACg3HYt U5EutgY6wKEcuRAilMEjn5U= =vQlS -----END PGP SIGNATURE----- --==-=-=--