changeset 53968:d65998606b6d

(rmail-dont-reply-to): Anchor user login name and email address at the beginning and end of the address.
author Eli Zaretskii <eliz@is.elta.co.il>
date Mon, 16 Feb 2004 11:42:10 +0000
parents c0b52e41d35d
children cbea4d378637
files lisp/mail/mail-utils.el
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/mail-utils.el	Mon Feb 16 11:35:50 2004 +0000
+++ b/lisp/mail/mail-utils.el	Mon Feb 16 11:42:10 2004 +0000
@@ -227,9 +227,15 @@
                       "")
                     (if (and user-mail-address
                              (not (equal user-mail-address user-login-name)))
-                        (concat (regexp-quote user-mail-address) "\\|")
+			;; Anchor the login name and email address so
+			;; that we don't match substrings: if the
+			;; login name is "foo", we shouldn't match
+			;; "barfoo@baz.com".
+                        (concat "\\`"
+				(regexp-quote user-mail-address)
+				"\\'\\|")
                       "")
-                    (concat (regexp-quote user-login-name) "\\>"))))
+                    (concat "\\`" (regexp-quote user-login-name) "@"))))
   ;; Split up DESTINATIONS and match each element separately.
   (let ((start-pos 0) (cur-pos 0)
 	(case-fold-search t))