Gnus development mailing list
 help / color / mirror / Atom feed
* Gnus asking for key twice
@ 2011-11-28 18:02 Adam
  2011-11-28 22:22 ` Adam
  0 siblings, 1 reply; 9+ messages in thread
From: Adam @ 2011-11-28 18:02 UTC (permalink / raw)
  To: ding

Whenever I send a signed mail which has a Gcc'ed header pointing to my
archive group, I am asked to select the sign key twice - once before
connecting to my smtp server, and once after actually sending the mail.
mm-sign-option is set to guided.  When there is no Gcc header, I am only
asked once.

Is this a bug or a feature?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Gnus asking for key twice
  2011-11-28 18:02 Gnus asking for key twice Adam
@ 2011-11-28 22:22 ` Adam
  2011-11-28 22:40   ` Adam
  0 siblings, 1 reply; 9+ messages in thread
From: Adam @ 2011-11-28 22:22 UTC (permalink / raw)
  To: ding

Adam <adam_w67@yahoo.com> writes:

> Whenever I send a signed mail which has a Gcc'ed header pointing to my
> archive group, I am asked to select the sign key twice - once before
> connecting to my smtp server, and once after actually sending the mail.
> mm-sign-option is set to guided.  When there is no Gcc header, I am only
> asked once.
>
> Is this a bug or a feature?

I investigated.  gnus-inews-do-gcc is calling
message-encode-message-body, which internally triggers the key selection
dialogue.  This looks like a real design flaw to me.  Gnus should encode
the message only once, and preserve the result.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Gnus asking for key twice
  2011-11-28 22:22 ` Adam
@ 2011-11-28 22:40   ` Adam
  2011-11-29 10:00     ` Katsumi Yamaoka
  0 siblings, 1 reply; 9+ messages in thread
From: Adam @ 2011-11-28 22:40 UTC (permalink / raw)
  To: ding

Adam <adam_w67@yahoo.com> writes:

> Adam <adam_w67@yahoo.com> writes:
>
>> Whenever I send a signed mail which has a Gcc'ed header pointing to my
>> archive group, I am asked to select the sign key twice - once before
>> connecting to my smtp server, and once after actually sending the mail.
>> mm-sign-option is set to guided.  When there is no Gcc header, I am only
>> asked once.
>>
>> Is this a bug or a feature?
>
> I investigated.  gnus-inews-do-gcc is calling
> message-encode-message-body, which internally triggers the key
> selection dialogue.  This looks like a real design flaw to me.  Gnus
> should encode the message only once, and preserve the result.

The easiest solution is to add a new hook.  It should be called in
messages-send-mail right after the message has been dispatched to the
server, with the current buffer being the actual message buffer that has
been sent.  Gnus then should add gnus-inews-do-gcc to this hook, and use
the processed buffer to save.

Do I sound reasonable?  Whats a good name for such a new hook?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Gnus asking for key twice
  2011-11-28 22:40   ` Adam
@ 2011-11-29 10:00     ` Katsumi Yamaoka
  2011-11-29 10:19       ` Katsumi Yamaoka
  2011-11-29 10:56       ` Adam
  0 siblings, 2 replies; 9+ messages in thread
From: Katsumi Yamaoka @ 2011-11-29 10:00 UTC (permalink / raw)
  To: ding

Adam wrote:
> Adam <adam_w67@yahoo.com> writes:

>> Adam <adam_w67@yahoo.com> writes:
>>
>>> Whenever I send a signed mail which has a Gcc'ed header pointing to my
>>> archive group, I am asked to select the sign key twice - once before
>>> connecting to my smtp server, and once after actually sending the mail.
>>> mm-sign-option is set to guided.  When there is no Gcc header, I am only
>>> asked once.
>>>
>>> Is this a bug or a feature?
>>
>> I investigated.  gnus-inews-do-gcc is calling
>> message-encode-message-body, which internally triggers the key
>> selection dialogue.  This looks like a real design flaw to me.  Gnus
>> should encode the message only once, and preserve the result.

> The easiest solution is to add a new hook.  It should be called in
> messages-send-mail right after the message has been dispatched to the
> server, with the current buffer being the actual message buffer that has
> been sent.  Gnus then should add gnus-inews-do-gcc to this hook, and use
> the processed buffer to save.

> Do I sound reasonable?  Whats a good name for such a new hook?

A sent message and Gcc'd one are not exactly the same.  AFAICT,
the Gcc header remains in a Gcc copy but is deleted in the one
sent.  Maybe there are other differences besides I cannot recall.
So, we will have to verify all the message sending functions and
situations in order to make such a change, I think.

How about making the expiry time of the passphrase cache longer?
The `mml-secure-passphrase-cache-expiry' controls it; the default
value might be too short.  If you want to try changing it briefly
where mml2015.elc has already been loaded, you'll need to change
`mml2015-passphrase-cache-expiry' instead (it inherits the value
of `mml-secure-passphrase-cache-expiry' as the default value).



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Gnus asking for key twice
  2011-11-29 10:00     ` Katsumi Yamaoka
@ 2011-11-29 10:19       ` Katsumi Yamaoka
  2011-11-29 10:56       ` Adam
  1 sibling, 0 replies; 9+ messages in thread
From: Katsumi Yamaoka @ 2011-11-29 10:19 UTC (permalink / raw)
  To: ding

Katsumi Yamaoka wrote:
> AFAICT, the Gcc header remains in a Gcc copy but is deleted in the
> one sent.   ^^^^^^^^^^

Oops, I meant the X-Draft-From header and the like.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Gnus asking for key twice
  2011-11-29 10:00     ` Katsumi Yamaoka
  2011-11-29 10:19       ` Katsumi Yamaoka
@ 2011-11-29 10:56       ` Adam
  2011-11-30 11:45         ` Katsumi Yamaoka
  1 sibling, 1 reply; 9+ messages in thread
From: Adam @ 2011-11-29 10:56 UTC (permalink / raw)
  To: ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> How about making the expiry time of the passphrase cache longer?
> The `mml-secure-passphrase-cache-expiry' controls it; the default
> value might be too short.  If you want to try changing it briefly
> where mml2015.elc has already been loaded, you'll need to change
> `mml2015-passphrase-cache-expiry' instead (it inherits the value
> of `mml-secure-passphrase-cache-expiry' as the default value).

The passphrase is not the problem.  In fact I do not protect my keys
with passphrases.  It is the actual key (say the key that should be used
to sign the message) selection dialogue that pops up twice.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Gnus asking for key twice
  2011-11-29 10:56       ` Adam
@ 2011-11-30 11:45         ` Katsumi Yamaoka
  2011-12-01  4:55           ` Katsumi Yamaoka
  0 siblings, 1 reply; 9+ messages in thread
From: Katsumi Yamaoka @ 2011-11-30 11:45 UTC (permalink / raw)
  To: ding

Adam wrote:
> The passphrase is not the problem.  In fact I do not protect my keys
> with passphrases.  It is the actual key (say the key that should be used
> to sign the message) selection dialogue that pops up twice.

I overlooked you wrote `mm-sign-option is set to guided', sorry.
That you are prompted twice seems to be due to a bug of
`mml2015-epg-sign'.  The encrypting function might have it, too.
There are two issues in the following section:

(or (message-options-get 'mml2015-epg-signers)
    (message-options-set 'mml2015-epg-signers ...))

The second line tries to save a signer to the `message-options'
variable and the first line gets it back in the next time.
However, `message-options' is always buffer-local and those are
done in a temporary buffer.  So, this save-and-back plan goes
wrong.

In addition, `epa-select-keys', that passes a signer to the second
line from the selection menu, always returns nil as far as I can
observe.

It seems hard to fix.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Gnus asking for key twice
  2011-11-30 11:45         ` Katsumi Yamaoka
@ 2011-12-01  4:55           ` Katsumi Yamaoka
  2011-12-01 11:17             ` Adam
  0 siblings, 1 reply; 9+ messages in thread
From: Katsumi Yamaoka @ 2011-12-01  4:55 UTC (permalink / raw)
  To: ding

Katsumi Yamaoka wrote:
> That you are prompted twice seems to be due to a bug of
> `mml2015-epg-sign'.  The encrypting function might have it, too.
> There are two issues in the following section:

> (or (message-options-get 'mml2015-epg-signers)
>     (message-options-set 'mml2015-epg-signers ...))

> The second line tries to save a signer to the `message-options'
> variable and the first line gets it back in the next time.
> However, `message-options' is always buffer-local and those are
> done in a temporary buffer.  So, this save-and-back plan goes
> wrong.

Fixed.  The value of `message-options' is shared between a draft
buffer and temporary working buffers now.  So, a signer you once
select is kept in it and you should never be prompted for a signer
twice even if you set `mm-sign-option' to `guided'.

> In addition, `epa-select-keys', that passes a signer to the second
> line from the selection menu, always returns nil as far as I can
> observe.

I should have used the `m' key, not the mouse-2 button, to select
one.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Gnus asking for key twice
  2011-12-01  4:55           ` Katsumi Yamaoka
@ 2011-12-01 11:17             ` Adam
  0 siblings, 0 replies; 9+ messages in thread
From: Adam @ 2011-12-01 11:17 UTC (permalink / raw)
  To: ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> Katsumi Yamaoka wrote:
>> That you are prompted twice seems to be due to a bug of
>> `mml2015-epg-sign'.  The encrypting function might have it, too.
>> There are two issues in the following section:
>
>> (or (message-options-get 'mml2015-epg-signers)
>>     (message-options-set 'mml2015-epg-signers ...))
>
>> The second line tries to save a signer to the `message-options'
>> variable and the first line gets it back in the next time.
>> However, `message-options' is always buffer-local and those are
>> done in a temporary buffer.  So, this save-and-back plan goes
>> wrong.
>
> Fixed.  The value of `message-options' is shared between a draft
> buffer and temporary working buffers now.  So, a signer you once
> select is kept in it and you should never be prompted for a signer
> twice even if you set `mm-sign-option' to `guided'.
>
>> In addition, `epa-select-keys', that passes a signer to the second
>> line from the selection menu, always returns nil as far as I can
>> observe.
>
> I should have used the `m' key, not the mouse-2 button, to select
> one.

Thank you



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-12-01 11:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-28 18:02 Gnus asking for key twice Adam
2011-11-28 22:22 ` Adam
2011-11-28 22:40   ` Adam
2011-11-29 10:00     ` Katsumi Yamaoka
2011-11-29 10:19       ` Katsumi Yamaoka
2011-11-29 10:56       ` Adam
2011-11-30 11:45         ` Katsumi Yamaoka
2011-12-01  4:55           ` Katsumi Yamaoka
2011-12-01 11:17             ` Adam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).