Subject: bug#7487: 24.0.50; Gnus nnimap broken

From: Daiki Ueno <[email-masked]>
Date: Tue, 14 Dec 2010 10:08:31 +0900

Lars Magne Ingebrigtsen <[email-masked]> writes:

>> As far as auth-source is concerned, it could have backend initialization
>> functionality that, when a backend (e.g. a .gpg file) doesn't exist,
>> will run specific functions, including creating a .gpg file with
>> symmetric encryption.  But right now it simply lets EPA handle everything.
>
> It might make sense to have auth-source control that, but I think it
> would be better if this was controlled by the user "centrally" in Emacs
> somewhere.

I have not yet caught up the discussion, but If you want to simply skip
the key selection, I'd suggest to do:

(make-local-variable 'epa-file-encrypt-to)
(setq epa-file-encrypt-to nil)

in the "authinfo.gpg" buffer (see epa-file-write-region).

Probably you may want to add an option to auth-source.el like:

(defcustom auth-source-gpg-encrypt-to t
  "List of recipient keys that `authinfo.gpg' encrypted to.
If the value is not a list, symmetric encryption will be used."
  ...)

and in auth-source-create(), expand the function body of netrc-store-data()
and put:

(with-temp-buffer
  (if auth-source-gpg-encrypt-to
    (make-local-variable 'epa-file-encrypt-to))
  (if (listp auth-source-gpg-encrypt-to)
    (setq epa-file-encrypt-to auth-source-gpg-encrypt-to))
  ...
  (write-region ...))

Regards,
-- 
Daiki Ueno