NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
smime_getkeys()

Get the S/MIME keys required to encrypt this email. More...

+ Collaboration diagram for smime_getkeys():

Functions

void smime_class_getkeys (struct Envelope *env)
 Get the S/MIME keys required to encrypt this email - Implements CryptModuleSpecs::smime_getkeys() -.
 

Detailed Description

Get the S/MIME keys required to encrypt this email.

Parameters
envEnvelope of the email

Function Documentation

◆ smime_class_getkeys()

void smime_class_getkeys ( struct Envelope * env)

Get the S/MIME keys required to encrypt this email - Implements CryptModuleSpecs::smime_getkeys() -.

Definition at line 614 of file smime.c.

615{
616 const bool c_smime_decrypt_use_default_key = cs_subset_bool(NeoMutt->sub, "smime_decrypt_use_default_key");
617 const char *const c_smime_default_key = cs_subset_string(NeoMutt->sub, "smime_default_key");
618 if (c_smime_decrypt_use_default_key && c_smime_default_key)
619 {
620 const char *const c_smime_keys = cs_subset_path(NeoMutt->sub, "smime_keys");
621 buf_printf(&SmimeKeyToUse, "%s/%s", NONULL(c_smime_keys), c_smime_default_key);
622 const char *const c_smime_certificates = cs_subset_path(NeoMutt->sub, "smime_certificates");
623 buf_printf(&SmimeCertToUse, "%s/%s", NONULL(c_smime_certificates), c_smime_default_key);
624 return;
625 }
626
627 struct Address *a = NULL;
628 TAILQ_FOREACH(a, &env->to, entries)
629 {
630 if (mutt_addr_is_user(a))
631 {
633 return;
634 }
635 }
636
637 TAILQ_FOREACH(a, &env->cc, entries)
638 {
639 if (mutt_addr_is_user(a))
640 {
642 return;
643 }
644 }
645
646 struct Address *f = mutt_default_from(NeoMutt->sub);
648 mutt_addr_free(&f);
649}
void mutt_addr_free(struct Address **ptr)
Free a single Address.
Definition address.c:462
bool mutt_addr_is_user(const struct Address *addr)
Does the address belong to the user.
Definition alias.c:600
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition buffer.c:161
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition helpers.c:291
const char * cs_subset_path(const struct ConfigSubset *sub, const char *name)
Get a path config item by name.
Definition helpers.c:168
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
#define TAILQ_FOREACH(var, head, field)
Definition queue.h:782
struct Address * mutt_default_from(struct ConfigSubset *sub)
Get a default 'from' Address.
Definition send.c:1396
static void getkeys(const char *mailbox)
Get the keys for a mailbox.
Definition smime.c:578
static struct Buffer SmimeKeyToUse
Smime key to use.
Definition smime.c:70
static struct Buffer SmimeCertToUse
Smime certificate to use.
Definition smime.c:72
#define NONULL(x)
Definition string2.h:44
An email address.
Definition address.h:35
struct Buffer * mailbox
Mailbox and host address.
Definition address.h:37
struct AddressList to
Email's 'To' list.
Definition envelope.h:60
struct AddressList cc
Email's 'Cc' list.
Definition envelope.h:61
Container for Accounts, Notifications.
Definition neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
+ Here is the call graph for this function: