- (let* ((from (message-field-value "From"))
- (match
- (catch 'first-match
- (dolist (re-folder notmuch-fcc-dirs)
- (when (string-match-p (car re-folder) from)
- (throw 'first-match re-folder))))))
- (if match
- (cdr match)
- (message "No Fcc header added.")
- nil)))
+ (or (seq-some (let ((from (message-field-value "From")))
+ (pcase-lambda (`(,regexp . ,folder))
+ (and (string-match-p regexp from)
+ folder)))
+ notmuch-fcc-dirs)
+ (progn (message "No Fcc header added.")
+ nil)))