From c6ee274013a64c0b8155fd0d6d694fe5fcb5cf1b Mon Sep 17 00:00:00 2001 From: Vineet Kumar Date: Sun, 31 May 2026 14:40:19 -0400 Subject: ignore invalid :host parameter not matching */* falls back to :user field such as when smtpmail uses it --- kasi-auth-source.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kasi-auth-source.el b/kasi-auth-source.el index fa9f629..5d720cc 100644 --- a/kasi-auth-source.el +++ b/kasi-auth-source.el @@ -27,8 +27,9 @@ ;; (auth-source-forget-all-cached) ;; ;; The kasi file path (e.g. "category/file") is matched against the -;; `:host' parameter. The `:user' parameter can optionally be used to -;; filter by the username stored in the kasi entry. +;; `:host' parameter only if it contains a "/" (i.e. looks like a +;; directory path). Otherwise the `:host' is ignored and the search +;; falls back to matching by `:user'. ;;; Code: @@ -78,7 +79,7 @@ optional filters." (dolist (file files) (message "kasi-auth-source: checking %s" file) (when-let* ((short-name (kasi--filename-short file)) - ((or (not host) (string= short-name host))) + ((or (not host) (not (string-match-p "/" host)) (string= short-name host))) (entry-user (kasi--get file 'username)) (entry-email (kasi--get file 'email)) ((or (not user) (string= entry-user user))) -- cgit v1.2.3