From xemacs-m  Sun Mar 23 14:24:41 1997
Received: from news1.ucsd.edu (news1.ucsd.edu [132.239.1.55])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id OAA08710
	for <xemacs-beta@xemacs.org>; Sun, 23 Mar 1997 14:24:41 -0600 (CST)
Received: (from news@localhost) by news1.ucsd.edu (8.8.5/8.6.9) id MAA27733; Sun, 23 Mar 1997 12:24:39 -0800 (PST)
To: gnu-emacs-bug@archive.cis.ohio-state.edu
Path: not-for-mail
From: David Moore <dmoore@ucsd.edu>
Newsgroups: gnu.emacs.bug
Subject: rmail-dont-reply-to doesn't handle rfc 822 addresses
Followup-To: gnu.emacs.bug
Date: 23 Mar 1997 12:26:24 -0800
Organization: UCSD Peripheral Nerve Research Group
Lines: 75
Message-ID: <rvzpvus6bz.fsf@sdnp5.ucsd.edu>
NNTP-Posting-Host: sdnp5.ucsd.edu
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: multipart/mixed;
 boundary="Multipart_Sun_Mar_23_12:26:24_1997-1"
Content-Transfer-Encoding: 7bit
To: Lars Magne Ingebrigtsen <gnus-bug@ifi.uio.no>,
        XEmacs Beta Mailing List <xemacs-beta@xemacs.org>
X-Face: "oX;zS#-JU$-,WKSzG.1gGE]x^cIg!hW.dq>.f6pzS^A+(k!T|M:}5{_%>Io<>L&{hO7W4cicOQ|>/lZ1G(m%7iaCf,6Qgk0%%Bz7b2-W3jd0m_UG\Y;?]}4s0O-U)uox>P3JN)9cm]O\@,vy2e{`3pb!"pqmRy3peB90*2L
Mail-Copies-To: never
X-Newsreader: Gnus v5.4.33/XEmacs 19.15(beta103)

--Multipart_Sun_Mar_23_12:26:24_1997-1
Content-Type: text/plain; charset=US-ASCII


[ This message is going to gnu.emacs.bug, xemacs-beta, and gnus-bug so,
  please watch the followup which I've set to gnu.emacs.bug for lack of
  a better idea. ]

There have been multiple bug reports about rmail-dont-reply-to-names not
working correctly posted to gnu.emacs.gnus, and sent to the gnus bug
list.  Some people say it doesn't work, others say it does.  It turns
out that the function rmail-dont-reply-to uses a horrible algorithm to
determine the matching names.  If you don't notice it broken, it's
probably because you tend to use () instead of <> email address for your
address.

The function rmail-dont-reply-to only compares the regexp at the start
of non-whitespace following the beginning of the recipients or after a
comma.

vm uses it's own stripping function, both because it has the addresses
in a list rather than a string, but also I suspect because
rmail-dont-reply-to loses miserably.  The only way you can get it to
match <> addresses like `David Moore <dmoore@ucsd.edu>' is to stick in
rules like '.*dmoore@ucsd.edu'.  The default options don't even work.
Since it'll make it be `info-\\|dmoore\\>', which doesn't match `David
Moore <dmoore@ucsd.edu>' either.

Maybe having rmail-dont-reply-to split on commas and then compare each
piece more intelligently against each component would be good.  But be
careful about willy-nilly splitting on commas, since `"foo, bar"
<foo@bar.com>' is a legal address.

Here is a patch against mail-utils to make rmail-dont-reply-to apply the
rmail-dont-reply-to-names regexp as either matching immediately (modulo
whitespace) following a comma, or immediately following a '!' or '<' in
the same address slot.


--Multipart_Sun_Mar_23_12:26:24_1997-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="mail-utils.diff"
Content-Transfer-Encoding: 7bit

--- mail-utils.el.orig	Sun Mar 23 11:56:39 1997
+++ mail-utils.el	Sun Mar 23 12:23:10 1997
@@ -144,7 +144,7 @@
 		        "")
 		    (concat (regexp-quote (user-login-name))
 			    "\\>"))))
-  (let ((match (concat "\\(^\\|,\\)[ \t\n]*\\([^,\n]*!\\|\\)\\("
+  (let ((match (concat "\\(^\\|,\\)[ \t\n]*\\([^,\n]*[!<]\\|\\)\\("
 		       rmail-dont-reply-to-names
 		       "\\)"))
 	(case-fold-search t)

--Multipart_Sun_Mar_23_12:26:24_1997-1
Content-Type: text/plain; charset=US-ASCII



This patch makes the default setting for rmail-dont-reply-to-names work
with rfc 822 acceptable email addresses, as well as meeting people's
expectations that the can set rmail-dont-reply-to-names to things such
as `dmoore@ucsd.edu\\|dmoore@sdnp?\\|info-\\|\\w*-request' and have it
work.  Or even just `rikt@\\|rik456@', etc.


-- 
David Moore <dmoore@ucsd.edu>       | Computer Systems Lab      __o
UCSD Dept. Computer Science - 0114  | Work: (619) 534-8604    _ \<,_
La Jolla, CA 92093-0114             | Fax:  (619) 534-1445   (_)/ (_)
<URL:http://oj.egbt.org/dmoore/>    | In a cloud bones of steel.

--Multipart_Sun_Mar_23_12:26:24_1997-1--

