# HG changeset patch # User Eli Zaretskii # Date 1076931730 0 # Node ID d65998606b6def5e12ec707f1018c272622bd588 # Parent c0b52e41d35da4801a4e98c54404ed29bc296adc (rmail-dont-reply-to): Anchor user login name and email address at the beginning and end of the address. diff -r c0b52e41d35d -r d65998606b6d lisp/mail/mail-utils.el --- 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))