Sending mail via SMTP in Emacs 27.0.50 fails when using the secrets auth-source backend - this seems to be due to network-stream-certificate calling auth-source-search with :port specified as an integer - since then later auth-source-secrets-listify-pattern fails with the following backtrace as it seems to expect all parameters to be strings. Attached is a patch to resolve this, in the same way bug#20541 was solved previously. I wonder however if it might just be better to make auth-source-secrets-listify-pattern smarter to handle numeric elements Debugger entered--Lisp error: (wrong-type-argument sequencep 587) mapcar(#f(compiled-function (v) #) 587) auth-source-secrets-listify-pattern((:port 587)) auth-source-secrets-listify-pattern((:host "smtp.server.com" :port 587)) auth-source-secrets-search(:backend # :type secrets :max 1 :require nil :create nil :delete nil :max 1 :host "smtp.server.com" :port 587) apply(auth-source-secrets-search :backend # :type secrets :max 1 :require nil :create nil :delete nil (:max 1 :host "smtp.server.com" :port 587)) auth-source-search-backends((# # #) (:max 1 :host "smtp.server.com" :port 587) 1 nil nil nil) auth-source-search(:max 1 :host "smtp.server.com" :port 587) network-stream-certificate("smtp.server.com" 587 (:type nil :return-list t :warn-unless-encrypted nil :capability-command "EHLO slate\15\n" :end-of-command "^[0-9]+ .*\15\n" :success "^2.*\n" :always-query-capabilities t :starttls-function #f(compiled-function (capabilities) #) :client-certificate t :use-starttls-if-possible t)) network-stream-open-starttls("smtpmail" # "smtp.server.com" 587 (:type nil :return-list t :warn-unless-encrypted nil :capability-command "EHLO slate\15\n" :end-of-command "^[0-9]+ .*\15\n" :success "^2.*\n" :always-query-capabilities t :starttls-function #f(compiled-function (capabilities) #) :client-certificate t :use-starttls-if-possible t)) open-network-stream("smtpmail" # "smtp.server.com" 587 :type nil :return-list t :warn-unless-encrypted nil :capability-command "EHLO slate\15\n" :end-of-command "^[0-9]+ .*\15\n" :success "^2.*\n" :always-query-capabilities t :starttls-function #f(compiled-function (capabilities) #) :client-certificate t :use-starttls-if-possible t) smtpmail-via-smtp(("foo@bar.com") #) smtpmail-send-it() message-use-send-mail-function() message--default-send-mail-function() message-multi-smtp-send-mail() message--send-mail-maybe-partially() message-send-mail(nil) message-send-via-mail(nil) message-send(nil) message-send-and-exit(nil) funcall-interactively(message-send-and-exit nil) call-interactively(message-send-and-exit nil nil) command-execute(message-send-and-exit)