if (cur->security & ENCRYPT)
{
#ifdef HAVE_SMIME
- if (cur->env->to && cur->security & APPLICATION_SMIME)
- smime_getkeys (cur->env->to->mailbox);
+ if (cur->security & APPLICATION_SMIME)
+ {
+ ADDRESS *t;
+ int found = 0;
+ for (t = cur->env->to; !found && t; t = t->next)
+ if (mutt_addr_is_user (t))
+ {
+ found = 1;
+ smime_getkeys (t->mailbox);
+ }
+ for (t = cur->env->cc; !found && t; t = t->next)
+ if (mutt_addr_is_user (t))
+ {
+ found = 1;
+ smime_getkeys (t->mailbox);
+ }
+ if (!found && (t = mutt_default_from()))
+ {
+ smime_getkeys (t->mailbox);
+ rfc822_free_address (&t);
+ }
+ }
#endif
if(!crypt_valid_passphrase(cur->security))
return 0;
char qry[256];
char title[256];
- if (!prompt) prompt = _("Enter keyID:");
+ if (!prompt) prompt = _("Enter keyID: ");
snprintf(index_file, sizeof (index_file), "%s/.index",
public ? NONULL(SmimeCertificates) : NONULL(SmimeKeys));
if ((keyID = smime_get_field_from_db (q->mailbox, NULL, 1, 1)) == NULL)
{
snprintf(buf, sizeof(buf),
- _("Enter keyID for \'%s\':"),
+ _("Enter keyID for \'%s\': "),
q->mailbox);
keyID = smime_ask_for_key(buf, q->mailbox, 1);
}