Subject: bug#58807: 28.1; Authentication in Gnus using password-store backend of auth-source

From: [email-masked]
Date: Wed, 26 Oct 2022 21:30:57 +0200

Hi,

As it is written in subject I can't authenticate to my local dovecot 
server when I have enabled pass backend in auth-source. I don't have 
this problem if I use default ~/.authinfo file. If it's not exist it's 
generated by Emacs and contains line as follows:
machine localhost login [email-masked] password pass

My minimal ~/.emacs file
(setq auth-source-debug 'trivia)
(setq auth-sources '(password-store))

(setq gnus-select-method '(nnnil ""))
(setq gnus-secondary-select-methods
       '((nnimap "localhost"
		(nnimap-address "127.0.0.1")
		(nnimap-stream network)
		(nnimap-authenticator login)
		(nnimap-server-port 1143)
		(nnimap-user "[email-masked]"))))

According to documentation [1] I tried numerous of entries of my user 
password in pass:
pass ls
Password Store
├── 127.0.0.1
│   └── [email-masked]
├── [email-masked]@127.0.0.1
├── [email-masked]@localhost
└── localhost
     └── [email-masked]

But none of this works and in *Messages* buffer I have always following 
logs:
auth-source-backend-parse: invalid backend spec: password-store
auth-source-search: found 1 backends matching (:max 1 :host ("localhost" 
"127.0.0.1") :port (1143 "imap" "143") :user "[email-masked]" :require 
(:user :secret) :create t)
auth-source-search: found 0 results (max 1) matching (:max 1 :host 
("localhost" "127.0.0.1") :port (1143 "imap" "143") :user 
"[email-masked]" :require (:user :secret) :create t)
auth-source-search: CREATED 0 results (max 1) matching (:max 1 :host 
("localhost" "127.0.0.1") :port (1143 "imap" "143") :user 
"[email-masked]" :require (:user :secret) :create t)
Opening nnimap server on localhost...failed:

I don't try this backend and library in other situations (e.g. TRAMP) so 
I am not sure it's more related to Gnus or Auth-source.

[1] 
https://www.gnu.org/software/emacs/manual/html_node/auth/The-Unix-password-store.html

In GNU Emacs 28.1 (build 1, x86_64-suse-linux-gnu, GTK+ Version 3.24.34, 
cairo version 1.16.0)
Windowing system distributor 'SUSE LINUX', version 11.0.12201004
System Description: openSUSE MicroOS

Configured using:
  'configure --disable-build-details --without-pop --with-mailutils
  --without-hesiod --with-gameuser=:games --with-kerberos
  --with-kerberos5 --with-file-notification=inotify --with-modules
  --enable-autodepend --prefix=/usr --mandir=/usr/share/man
  --infodir=/usr/share/info --datadir=/usr/share --localstatedir=/var
  --sharedstatedir=/var/lib --libexecdir=/usr/libexec
  --with-file-notification=yes --with-native-compilation
  
--enable-locallisppath=/usr/share/emacs/28.1/site-lisp:/usr/share/emacs/site-lisp
  --with-x --with-xim --with-sound --with-xpm --with-jpeg --with-tiff
  --with-gif --with-png --with-rsvg --with-dbus --with-xft --without-gpm
  --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
  --x-includes=/usr/include --x-libraries=/usr/lib64 --with-libotf
  --with-m17n-flt --with-cairo --with-xwidgets --build=x86_64-suse-linux
  --with-dumping=pdumper 'CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE
  -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables
  -fasynchronous-unwind-tables -fstack-clash-protection
  -Werror=return-type -flto=auto -g -D_GNU_SOURCE
  -DGDK_DISABLE_DEPRECATION_WARNINGS -DGLIB_DISABLE_DEPRECATION_WARNINGS
  -pipe -Wno-pointer-sign -Wno-unused-variable -Wno-unused-label
  -fno-optimize-sibling-calls -fno-PIE -DPDMP_BASE='\''"emacs-gtk"'\'''
  'LDFLAGS=-Wl,-no-pie -Wl,-O2''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB

Important settings:
   value of $LC_NUMERIC: POSIX
   value of $LANG: en_US.UTF-8
   locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
   tooltip-mode: t
   global-eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   buffer-read-only: t
   line-number-mode: t
   indent-tabs-mode: t
   transient-mark-mode: t

Load-path shadows:
None found.

Features:
(pp shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source eieio eieio-core eieio-loaddefs
password-cache json map text-property-search time-date mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail comp comp-cstr warnings subr-x rx cl-seq cl-macs cl-extra
help-mode seq byte-opt gv cl-loaddefs cl-lib bytecomp byte-compile cconv
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils delsel lpr
easy-mmode pcase iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads xwidget-internal dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 94010 9705)
  (symbols 48 7931 3)
  (strings 32 22898 2026)
  (string-bytes 1 747855)
  (vectors 16 18629)
  (vector-slots 8 336867 21359)
  (floats 8 32 197)
  (intervals 56 606 0)
  (buffers 992 14))