emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb 2b27fcc 1/4: Be more careful about testing against


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 2b27fcc 1/4: Be more careful about testing against user mail addresses
Date: Wed, 11 Jul 2018 13:53:52 -0400 (EDT)

branch: externals/ebdb
commit 2b27fcca0fd36e071aa4dfceae0aaeae9765e258
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Be more careful about testing against user mail addresses
    
    * ebdb-mua.el (ebdb-mua-test-headers): This can derail the whole
      process if works incorrectly (eg, user has no mail address), so put
      more thorough checks in place.
---
 ebdb-mua.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/ebdb-mua.el b/ebdb-mua.el
index f82d49e..0869919 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el
@@ -227,7 +227,7 @@ accordingly."
        ((eq ebdb-user-mail-address-re 'self)
         (let ((self-rec (ebdb-record-self)))
           (unless self-rec
-            (user-error "`ebdb-user-mail-address-re' set to 'self, but 
`ebdb-record-self' is not set.? "))
+            (user-error "`ebdb-user-mail-address-re' set to 'self, but 
`ebdb-record-self' is not set"))
           (setq ebdb-user-mail-address-re
                 (regexp-opt (slot-value
                              (ebdb-record-cache self-rec)
@@ -598,13 +598,14 @@ HEADER-TYPE, as well as the IGNORE-ADDRESS argument, and 
the
 variables `ebdb-user-mail-address-re',
 `ebdb-accept-header-alist', and `ebdb-ignore-header-alist'."
   (let ((name (car address-parts))
-       (mail (cadr address-parts)))
+       (mail (cadr address-parts))
+       (user-mail (ebdb-get-user-mail-address-re)))
     (and (null (or (and (stringp ignore-address)
                        (or (and name (string-match-p ignore-address name))
                            (and mail (string-match-p ignore-address mail))))
-                  (string-match-p
-                   (ebdb-get-user-mail-address-re)
-                   mail)))
+                  (and (stringp user-mail)
+                       (null (string-empty-p user-mail))
+                       (string-match-p user-mail mail))))
         (cond ((null (or ebdb-accept-header-alist
                          ebdb-ignore-header-alist))
                t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]