#include "config.h"
#include <locale.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include "private.h"
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "alias/lib.h"
#include "gui/lib.h"
#include "mutt.h"
#include "crypt.h"
#include "ncrypt/lib.h"
#include "send/lib.h"
#include "context.h"
#include "copy.h"
#include "cryptglue.h"
#include "handler.h"
#include "mutt_globals.h"
#include "mutt_parse.h"
#include "muttlib.h"
#include "options.h"
#include "state.h"
#include "autocrypt/lib.h"
Go to the source code of this file.
|
void | crypt_current_time (struct State *s, const char *app_name) |
| Print the current time. More...
|
|
void | crypt_forget_passphrase (void) |
| Forget a passphrase and display a message. More...
|
|
bool | crypt_valid_passphrase (SecurityFlags flags) |
| Check that we have a usable passphrase, ask if not. More...
|
|
int | mutt_protect (struct Email *e, char *keylist, bool postpone) |
| Encrypt and/or sign a message. More...
|
|
SecurityFlags | mutt_is_multipart_signed (struct Body *b) |
| Is a message signed? More...
|
|
SecurityFlags | mutt_is_multipart_encrypted (struct Body *b) |
| Does the message have encrypted parts? More...
|
|
int | mutt_is_valid_multipart_pgp_encrypted (struct Body *b) |
| Is this a valid multi-part encrypted message? More...
|
|
SecurityFlags | mutt_is_malformed_multipart_pgp_encrypted (struct Body *b) |
| Check for malformed layout. More...
|
|
SecurityFlags | mutt_is_application_pgp (struct Body *m) |
| Does the message use PGP? More...
|
|
SecurityFlags | mutt_is_application_smime (struct Body *m) |
| Does the message use S/MIME? More...
|
|
SecurityFlags | crypt_query (struct Body *m) |
| Check out the type of encryption used. More...
|
|
int | crypt_write_signed (struct Body *a, struct State *s, const char *tempfile) |
| Write the message body/part. More...
|
|
void | crypt_convert_to_7bit (struct Body *a) |
| Convert an email to 7bit encoding. More...
|
|
void | crypt_extract_keys_from_messages (struct Mailbox *m, struct EmailList *el) |
| Extract keys from a message. More...
|
|
int | crypt_get_keys (struct Email *e, char **keylist, bool oppenc_mode) |
| Check we have all the keys we need. More...
|
|
void | crypt_opportunistic_encrypt (struct Email *e) |
| Can all recipients be determined. More...
|
|
static void | crypt_fetch_signatures (struct Body ***signatures, struct Body *a, int *n) |
| Create an array of an emails parts. More...
|
|
bool | mutt_should_hide_protected_subject (struct Email *e) |
| Should NeoMutt hide the protected subject? More...
|
|
int | mutt_protected_headers_handler (struct Body *a, struct State *s) |
| Process a protected header - Implements handler_t. More...
|
|
int | mutt_signed_handler (struct Body *a, struct State *s) |
| Verify a "multipart/signed" body - Implements handler_t. More...
|
|
const char * | crypt_get_fingerprint_or_id (const char *p, const char **pphint, const char **ppl, const char **pps) |
| Get the fingerprint or long key ID. More...
|
|
bool | crypt_is_numerical_keyid (const char *s) |
| Is this a numerical keyid. More...
|
|
Signing/encryption multiplexor
- Authors
- Michael R. Elkins
- Thomas Roessler
- Thomas Roessler
- Oliver Ehli
- Werner Koch
- g10code GmbH
- Pietro Cerutti
- Copyright
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file crypt.c.
◆ crypt_current_time()
void crypt_current_time |
( |
struct State * |
s, |
|
|
const char * |
app_name |
|
) |
| |
Print the current time.
- Parameters
-
s | State to use |
app_name | App name, e.g. "PGP" |
print the current time to avoid spoofing of the signature output
Definition at line 72 of file crypt.c.
74 char p[256], tmp[256];
86 snprintf(tmp,
sizeof(tmp),
_(
"[-- %s output follows%s --]\n"),
NONULL(app_name), p);
◆ crypt_forget_passphrase()
void crypt_forget_passphrase |
( |
void |
| ) |
|
Forget a passphrase and display a message.
Definition at line 93 of file crypt.c.
◆ crypt_valid_passphrase()
Check that we have a usable passphrase, ask if not.
- Parameters
-
- Return values
-
Definition at line 135 of file crypt.c.
◆ mutt_protect()
int mutt_protect |
( |
struct Email * |
e, |
|
|
char * |
keylist, |
|
|
bool |
postpone |
|
) |
| |
Encrypt and/or sign a message.
- Parameters
-
e | Email |
keylist | List of keys to encrypt to (space-separated) |
postpone | When true, signing is automatically disabled |
- Return values
-
Definition at line 160 of file crypt.c.
162 struct Body *pbody = NULL, *tmp_pbody = NULL;
163 struct Body *tmp_smime_pbody = NULL;
164 struct Body *tmp_pgp_pbody = NULL;
165 bool has_retainable_sig =
false;
191 _(
"Inline PGP can't be used with attachments. "
192 "Revert to PGP/MIME?")) !=
MUTT_YES)
195 _(
"Mail not sent: inline PGP can't be used with attachments"));
203 _(
"Inline PGP can't be used with format=flowed. "
204 "Revert to PGP/MIME?"))) !=
MUTT_YES)
207 _(
"Mail not sent: inline PGP can't be used with format=flowed"));
217 puts(
_(
"Invoking PGP..."));
229 _(
"Message can't be sent inline. Revert to using PGP/MIME?")) !=
MUTT_YES)
243 tmp_smime_pbody = e->
body;
245 tmp_pgp_pbody = e->
body;
247 #ifdef CRYPT_BACKEND_GPGME
254 const char *mailbox = NULL;
256 bool free_from =
false;
322 tmp_smime_pbody = tmp_pbody;
332 has_retainable_sig =
true;
335 tmp_pgp_pbody = tmp_pbody;
355 if ((tmp_smime_pbody != e->
body) && (tmp_smime_pbody != tmp_pbody))
372 if (has_retainable_sig)
384 if (has_retainable_sig)
◆ mutt_is_multipart_signed()
Is a message signed?
- Parameters
-
- Return values
-
Definition at line 409 of file crypt.c.
◆ mutt_is_multipart_encrypted()
Does the message have encrypted parts?
- Parameters
-
- Return values
-
Definition at line 449 of file crypt.c.
◆ mutt_is_valid_multipart_pgp_encrypted()
int mutt_is_valid_multipart_pgp_encrypted |
( |
struct Body * |
b | ) |
|
Is this a valid multi-part encrypted message?
- Parameters
-
- Return values
-
Definition at line 473 of file crypt.c.
◆ mutt_is_malformed_multipart_pgp_encrypted()
Check for malformed layout.
- Parameters
-
- Return values
-
This checks for the malformed layout caused by MS Exchange in some cases:
<multipart/mixed>
<text/plain>
<application/pgp-encrypted> [BASE64-encoded]
<application/octet-stream> [BASE64-encoded]
Definition at line 510 of file crypt.c.
◆ mutt_is_application_pgp()
Does the message use PGP?
- Parameters
-
- Return values
-
Definition at line 554 of file crypt.c.
◆ mutt_is_application_smime()
Does the message use S/MIME?
- Parameters
-
- Return values
-
Definition at line 612 of file crypt.c.
621 bool complain =
false;
655 _(
"S/MIME messages with no hints on content are unsupported"));
663 if ((len > 0) && (*(t + len) ==
'.'))
◆ crypt_query()
Check out the type of encryption used.
- Parameters
-
- Return values
-
Set the cached status values if there are any.
Definition at line 687 of file crypt.c.
◆ crypt_write_signed()
int crypt_write_signed |
( |
struct Body * |
a, |
|
|
struct State * |
s, |
|
|
const char * |
tempfile |
|
) |
| |
Write the message body/part.
- Parameters
-
a | Body to write |
s | State to use |
tempfile | File to write to |
- Return values
-
Body/part A described by state S to the given TEMPFILE.
Definition at line 759 of file crypt.c.
776 const int c = fgetc(s->
fp_in);
786 if ((c ==
'\n') && !hadcr)
◆ crypt_convert_to_7bit()
void crypt_convert_to_7bit |
( |
struct Body * |
a | ) |
|
Convert an email to 7bit encoding.
- Parameters
-
a | Body of email to convert |
Definition at line 803 of file crypt.c.
◆ crypt_extract_keys_from_messages()
void crypt_extract_keys_from_messages |
( |
struct Mailbox * |
m, |
|
|
struct EmailList * |
el |
|
) |
| |
Extract keys from a message.
- Parameters
-
m | Mailbox |
el | List of Emails to process |
The extracted keys will be added to the user's keyring.
Definition at line 846 of file crypt.c.
881 puts(
_(
"Trying to extract PGP keys...\n"));
910 puts(
_(
"Trying to extract S/MIME certificates..."));
◆ crypt_get_keys()
int crypt_get_keys |
( |
struct Email * |
e, |
|
|
char ** |
keylist, |
|
|
bool |
oppenc_mode |
|
) |
| |
Check we have all the keys we need.
- Parameters
-
[in] | e | Email with addresses to match |
[out] | keylist | Keys needed |
[in] | oppenc_mode | If true, use opportunistic encryption |
- Return values
-
Do a quick check to make sure that we can find all of the encryption keys if the user has requested this service. Return the list of keys in KEYLIST. If oppenc_mode is true, only keys that can be determined without prompting will be used.
Definition at line 945 of file crypt.c.
952 char *self_encrypt = NULL;
1005 if (!oppenc_mode && self_encrypt)
1009 sprintf(*keylist + keylist_size,
" %s", self_encrypt);
◆ crypt_opportunistic_encrypt()
void crypt_opportunistic_encrypt |
( |
struct Email * |
e | ) |
|
Can all recipients be determined.
- Parameters
-
Check if all recipients keys can be automatically determined. Enable encryption if they can, otherwise disable encryption.
Definition at line 1024 of file crypt.c.
1032 char *pgpkeylist = NULL;
◆ crypt_fetch_signatures()
static void crypt_fetch_signatures |
( |
struct Body *** |
signatures, |
|
|
struct Body * |
a, |
|
|
int * |
n |
|
) |
| |
|
static |
Create an array of an emails parts.
- Parameters
-
[out] | signatures | Array of Body parts |
[in] | a | Body part to examine |
[out] | n | Cumulative count of parts |
Definition at line 1052 of file crypt.c.
1057 for (; a; a = a->
next)
1066 (*signatures)[(*n)++] = a;
◆ mutt_should_hide_protected_subject()
bool mutt_should_hide_protected_subject |
( |
struct Email * |
e | ) |
|
Should NeoMutt hide the protected subject?
- Parameters
-
- Return values
-
bool | True if the subject should be protected |
Definition at line 1076 of file crypt.c.
◆ mutt_protected_headers_handler()
int mutt_protected_headers_handler |
( |
struct Body * |
a, |
|
|
struct State * |
s |
|
) |
| |
◆ mutt_signed_handler()
int mutt_signed_handler |
( |
struct Body * |
a, |
|
|
struct State * |
s |
|
) |
| |
Verify a "multipart/signed" body - Implements handler_t.
Definition at line 1116 of file crypt.c.
1121 bool inconsistent =
false;
1123 struct Body **signatures = NULL;
1126 struct Buffer *tempfile = NULL;
1135 "Unknown multipart/signed protocol %s --]\n\n"),
1140 if (!(a && a->
next))
1141 inconsistent =
true;
1144 switch (signed_type)
1149 inconsistent =
true;
1156 inconsistent =
true;
1164 inconsistent =
true;
1168 inconsistent =
true;
1174 "signature --]\n\n"));
1186 bool goodsig =
true;
1189 for (
int i = 0; i < sigcnt; i++)
1214 "We can't verify %s/%s signatures. --]\n\n"),
1215 TYPE(signatures[i]), signatures[i]->subtype);
1235 _(
"[-- Warning: Can't find any signatures. --]\n\n"));
◆ crypt_get_fingerprint_or_id()
const char* crypt_get_fingerprint_or_id |
( |
const char * |
p, |
|
|
const char ** |
pphint, |
|
|
const char ** |
ppl, |
|
|
const char ** |
pps |
|
) |
| |
Get the fingerprint or long key ID.
- Parameters
-
- Return values
-
ptr | Copy of fingerprint, if any, stripped of all spaces. Must be FREE'd by caller |
NULL | Otherwise |
Obtain pointers to fingerprint or short or long key ID, if any.
Upon return, at most one of return, *ppl and *pps pointers is non-NULL, indicating the longest fingerprint or ID found, if any.
Definition at line 1261 of file crypt.c.
1264 const char *ps = NULL, *pl = NULL, *phint = NULL;
1265 char *pfcopy = NULL, *s1 = NULL, *s2 = NULL;
1289 if (((
'0' <= c) && (c <=
'9')) || ((
'A' <= c) && (c <=
'F')) ||
1290 ((
'a' <= c) && (c <=
'f')))
1299 if ((c ==
' ') && ((hexdigits % 4) == 0))
1307 pfcopy = (!c && ((hexdigits == 40) || (hexdigits == 32)) ?
mutt_str_dup(pf) : NULL);
◆ crypt_is_numerical_keyid()
bool crypt_is_numerical_keyid |
( |
const char * |
s | ) |
|
Is this a numerical keyid.
- Parameters
-
- Return values
-
Check if a crypt-hook value is a key id.
Definition at line 1350 of file crypt.c.
1358 if (!strchr(
"0123456789ABCDEFabcdef", *s++))
long hdr_offset
Offset in stream where the headers begin.
char * C_CryptProtectedHeadersSubject
Config: Use this as the subject for encrypted emails.
void mutt_endwin(void)
Shutdown curses/slang.
char * subject
Email's subject.
struct AddressList bcc
Email's 'Bcc' list.
@ ENC_QUOTED_PRINTABLE
Quoted-printable text.
struct Address * C_EnvelopeFromAddress
Config: Manually set the sender for outgoing messages.
FILE * fp_in
File to read from.
@ AUTOCRYPT_REC_NO
Do no use Autocrypt.
#define MUTT_CM_CHARCONV
Perform character set conversions.
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
struct Content * content
Detailed info about the content of the attachment.
bool mutt_strn_equal(const char *a, const char *b, size_t num)
Check for equality of two strings (to a maximum), safely.
void mutt_addrlist_dedupe(struct AddressList *al)
Remove duplicate addresses.
static void crypt_fetch_signatures(struct Body ***signatures, struct Body *a, int *n)
Create an array of an emails parts.
void mutt_addrlist_qualify(struct AddressList *al, const char *host)
Expand local names in an Address list using a hostname.
#define MUTT_DISPLAY
Output is displayed to the user.
String manipulation buffer.
LOFF_T offset
offset where the actual data begins
struct Mailbox * ctx_mailbox(struct Context *ctx)
wrapper to get the mailbox in a Context, or NULL
#define SEC_OPPENCRYPT
Opportunistic encrypt mode.
void crypt_smime_void_passphrase(void)
Wrapper for CryptModuleSpecs::void_passphrase()
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
SecurityFlags mutt_is_malformed_multipart_pgp_encrypted(struct Body *b)
Check for malformed layout.
struct Body * next
next attachment in the list
#define MUTT_CM_DECODE_CRYPT
#define SEC_ENCRYPT
Email is encrypted.
bool is_autocrypt
Flag autocrypt-decrypted messages for replying.
struct Body * crypt_pgp_encrypt_message(struct Email *e, struct Body *a, char *keylist, int sign, const struct AddressList *from)
Wrapper for CryptModuleSpecs::pgp_encrypt_message()
#define MUTT_CM_NOHEADER
Don't copy the message header.
struct Body * mutt_remove_multipart(struct Body *b)
Extract the multipart body if it exists.
int mutt_window_wrap_cols(int width, short wrap)
Calculate the wrap column for a given screen width.
#define SEC_SIGN
Email is signed.
bool C_PgpStrictEnc
Config: Encode PGP signed messages with quoted-printable (don't unset)
#define mutt_buffer_mktemp(buf)
int mutt_autocrypt_generate_gossip_list(struct Mailbox *m, struct Email *e)
Create the gossip list headers.
bool from
Has a line beginning with "From "?
#define TAILQ_EMPTY(head)
struct Email * email
Email in the list.
void mutt_prepare_envelope(struct Envelope *env, bool final, struct ConfigSubset *sub)
Prepare an email header.
char * crypt_pgp_find_keys(struct AddressList *addrlist, bool oppenc_mode)
Wrapper for CryptModuleSpecs::find_keys()
void crypt_pgp_invoke_import(const char *fname)
Wrapper for CryptModuleSpecs::pgp_invoke_import()
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
struct Body * crypt_smime_build_smime_entity(struct Body *a, char *certlist)
Wrapper for CryptModuleSpecs::smime_build_smime_entity()
void mutt_expand_aliases(struct AddressList *al)
Expand aliases in a List of Addresses.
char * mutt_str_dup(const char *str)
Copy a string, safely.
void crypt_smime_invoke_import(const char *infile, const char *mailbox)
Wrapper for CryptModuleSpecs::smime_invoke_import()
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
void mutt_file_unlink(const char *s)
Delete a file, carefully.
void crypt_convert_to_7bit(struct Body *a)
Convert an email to 7bit encoding.
bool C_Autocrypt
Config: Enables the Autocrypt feature.
unsigned int encoding
content-transfer-encoding, ContentEncoding
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
int wraplen
Width to wrap lines to (when flags & MUTT_DISPLAY)
void state_mark_protected_header(struct State *s)
Write a unique marker around protected headers.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
bool space
Whitespace at the end of lines?
void mutt_body_free(struct Body **ptr)
Free a Body.
int crypt_smime_verify_one(struct Body *sigbdy, struct State *s, const char *tempf)
Wrapper for CryptModuleSpecs::verify_one()
char * subtype
content-type subtype
#define STAILQ_FOREACH(var, head, field)
FILE * fp_out
File to write to.
void state_attach_puts(struct State *s, const char *t)
Write a string to the state.
bool C_CryptProtectedHeadersRead
Config: Display protected headers (Memory Hole) in the pager.
int crypt_get_keys(struct Email *e, char **keylist, bool oppenc_mode)
Check we have all the keys we need.
char * prefix
String to add to the beginning of each output line.
void mutt_parse_mime_message(struct Mailbox *m, struct Email *e)
Parse a MIME email.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
#define MUTT_CM_DECODE_SMIME
Used for decoding S/MIME messages.
bool badsig
Bad cryptographic signature (needed to check encrypted s/mime-signatures)
bool C_CryptUsePka
Config: Use GPGME to use PKA (lookup PGP keys using DNS)
#define TAILQ_HEAD_INITIALIZER(head)
bool C_PgpRetainableSigs
Config: Create nested multipart/signed or encrypted messages.
#define TAILQ_FIRST(head)
int mutt_any_key_to_continue(const char *s)
Prompt the user to 'press any key' and wait.
struct AddressList cc
Email's 'Cc' list.
enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt)
Ask the user a quad-question.
size_t mutt_date_localtime_format(char *buf, size_t buflen, const char *format, time_t t)
Format localtime.
void mutt_env_free(struct Envelope **ptr)
Free an Envelope.
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
SecurityFlags mutt_is_application_pgp(struct Body *m)
Does the message use PGP?
SecurityFlags crypt_query(struct Body *m)
Check out the type of encryption used.
bool crypt_pgp_valid_passphrase(void)
Wrapper for CryptModuleSpecs::valid_passphrase()
bool goodsig
Good cryptographic signature.
WHERE short C_Wrap
Config: Width to wrap text in the pager.
SecurityFlags mutt_is_multipart_encrypted(struct Body *b)
Does the message have encrypted parts?
LOFF_T length
length (in bytes) of attachment
struct Body * crypt_pgp_traditional_encryptsign(struct Body *a, SecurityFlags flags, char *keylist)
Wrapper for CryptModuleSpecs::pgp_traditional_encryptsign()
struct Body * crypt_pgp_sign_message(struct Body *a, const struct AddressList *from)
Wrapper for CryptModuleSpecs::sign_message()
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define MUTT_CM_NO_FLAGS
No flags are set.
bool C_CryptOpportunisticEncrypt
Config: Enable encryption when the recipient's key is available.
#define CH_NO_FLAGS
No flags are set.
WHERE bool OptDontHandlePgpKeys
(pseudo) used to extract PGP keys
bool C_PgpSelfEncrypt
Config: Encrypted messages will also be encrypted to $pgp_default_key too.
unsigned char C_PgpEncryptSelf
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
char * description
content-description
bool mutt_matches_ignore(const char *s)
Does the string match the ignore list.
void mutt_param_set(struct ParameterList *pl, const char *attribute, const char *value)
Set a Parameter.
#define CH_DISPLAY
Display result to user.
struct AddressList to
Email's 'To' list.
char * C_PgpDefaultKey
Config: Default key to use for PGP operations.
struct Body * parts
parts of a multipart or message/rfc822
@ TYPE_MESSAGE
Type: 'message/*'.
unsigned char C_PgpMimeAuto
Config: Prompt the user to use MIME if inline PGP fails.
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
struct Envelope * env
Envelope information.
int crypt_write_signed(struct Body *a, struct State *s, const char *tempfile)
Write the message body/part.
int state_printf(struct State *s, const char *fmt,...)
Write a formatted string to the State.
void mutt_addr_free(struct Address **ptr)
Free a single Address.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
struct Envelope * mutt_env_new(void)
Create a new Envelope.
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
#define MUTT_DATE_NOW
Constant representing the 'current time', see: mutt_date_gmtime(), mutt_date_localtime()
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
bool crypt_smime_valid_passphrase(void)
Wrapper for CryptModuleSpecs::valid_passphrase()
#define SEC_BADSIGN
Email has a bad signature.
void crypt_smime_set_sender(const char *sender)
Wrapper for CryptModuleSpecs::set_sender()
void mutt_param_delete(struct ParameterList *pl, const char *attribute)
Delete a matching Parameter.
char * mailbox
Mailbox and host address.
char * mutt_param_get(const struct ParameterList *pl, const char *s)
Find a matching Parameter.
struct Body * crypt_smime_sign_message(struct Body *a, const struct AddressList *from)
Wrapper for CryptModuleSpecs::sign_message()
char * mutt_str_skip_whitespace(const char *p)
Find the first non-whitespace character in a string.
bool C_Weed
Config: Filter headers when displaying/forwarding/printing/replying.
WHERE bool OptPgpCheckTrust
(pseudo) used by dlg_select_pgp_key()
int crypt_pgp_verify_one(struct Body *sigbdy, struct State *s, const char *tempf)
Wrapper for CryptModuleSpecs::verify_one()
struct AddressList from
Email's 'From' list.
@ TYPE_APPLICATION
Type: 'application/*'.
char * d_filename
filename to be used for the content-disposition header.
@ ENC_BASE64
Base-64 encoded text.
bool C_SmimeSelfEncrypt
Config: Encrypted messages will also be encrypt to $smime_default_key too.
@ TYPE_TEXT
Type: 'text/*'.
int mutt_protected_headers_handler(struct Body *a, struct State *s)
Process a protected header - Implements handler_t.
Container for Accounts, Notifications.
#define SEC_INLINE
Email has an inline signature.
char * crypt_smime_find_keys(struct AddressList *addrlist, bool oppenc_mode)
Wrapper for CryptModuleSpecs::find_keys()
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
unsigned int type
content-type primary type, ContentType
char * C_SmimeDefaultKey
Config: Default key for SMIME operations.
int mutt_body_handler(struct Body *b, struct State *s)
Handler for the Body of an email.
struct Address * mutt_default_from(struct ConfigSubset *sub)
Get a default 'from' Address.
#define MUTT_CM_DECODE
Decode the message body into text/plain.
struct ConfigSubset * sub
Inherited config items.
void crypt_pgp_void_passphrase(void)
Wrapper for CryptModuleSpecs::void_passphrase()
struct ParameterList parameter
parameters of the content-type
enum AutocryptRec mutt_autocrypt_ui_recommendation(struct Mailbox *m, struct Email *e, char **keylist)
Get the recommended action for an Email.
const char * mutt_fqdn(bool may_hide_host, const struct ConfigSubset *sub)
Get the Fully-Qualified Domain Name.
StateFlags flags
Flags, e.g. MUTT_DISPLAY.
@ TYPE_MULTIPART
Type: 'multipart/*'.
The envelope/body of an email.
bool C_CryptProtectedHeadersWrite
Config: Generate protected header (Memory Hole) for signed and encrypted emails.
#define mutt_message(...)
void crypt_pgp_set_sender(const char *sender)
Wrapper for CryptModuleSpecs::set_sender()
bool C_CryptTimestamp
Config: Add a timestamp to PGP or SMIME output to prevent spoofing.
void mutt_addrlist_copy(struct AddressList *dst, const struct AddressList *src, bool prune)
Copy a list of addresses into another list.
int mutt_copy_message(FILE *fp_out, struct Mailbox *m, struct Email *e, CopyMessageFlags cmflags, CopyHeaderFlags chflags, int wraplen)
Copy a message from a Mailbox.
bool crypt_valid_passphrase(SecurityFlags flags)
Check that we have a usable passphrase, ask if not.
#define SEC_NO_FLAGS
No flags are set.
SecurityFlags mutt_is_multipart_signed(struct Body *b)
Is a message signed?
struct AddressList sender
Email's sender.
#define SEC_GOODSIGN
Email has a valid signature.
SecurityFlags mutt_is_application_smime(struct Body *m)
Does the message use S/MIME?
void mutt_message_to_7bit(struct Body *a, FILE *fp, struct ConfigSubset *sub)
Convert an email's MIME parts to 7-bit.
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
#define state_puts(STATE, STR)
#define SEC_PARTSIGN
Not all parts of the email is signed.
struct Envelope * mime_headers
Memory hole protected headers.
unsigned char C_SmimeEncryptSelf
char * filename
when sending a message, this is the file to which this structure refers
struct Body * body
List of MIME parts.