From 8cc9c37226f5512ce42d25de71f9560c5d04255a Mon Sep 17 00:00:00 2001 From: Matt Van Horn Date: Wed, 29 Apr 2026 09:01:20 -0700 Subject: [PATCH] fix(cache): trim <> from email keys (#1190) ## What? Add `<` and `>` to the trim cutset in `normalizeContactEmail` so the cache key is the bare email regardless of whether the input came from a header or a UI field. Whitespace and commas continue to be trimmed. ## Why? Email addresses arriving from `From:` headers commonly come wrapped in angle brackets (``). The previous trim cutset was `,` only, so the cache stored the literal `` and never matched future lookups against `foo@bar.com`. Resolves #1122. Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> --- config/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cache.go b/config/cache.go index 90feffe4988c7c67c53cce0a8f2cf003babcb437..e3677f7f7260bfab2fbdfd852b6c7a898113e157 100644 --- a/config/cache.go +++ b/config/cache.go @@ -149,7 +149,7 @@ func LoadContactsCache() (*ContactsCache, error) { } func normalizeContactEmail(email string) string { - return strings.ToLower(strings.Trim(strings.TrimSpace(email), ",")) + return strings.ToLower(strings.Trim(strings.TrimSpace(email), ",<>")) } // AddContact adds or updates a contact in the cache.