63#ifdef CRYPT_BACKEND_CLASSIC_PGP
133 if (!c_pgp_use_gpg_agent)
139 setenv(
"GPG_TTY", tty, 0);
253 if (!fp_in || !fp_out)
259 if (c_pgp_good_sign && c_pgp_good_sign->
regex)
308 if (c_pgp_decryption_okay && c_pgp_decryption_okay->
regex)
360 char *line = NULL, *s = NULL;
362 int inside_decrypt = 0;
365 if (!c_pgp_check_gpg_decrypt_status_fd)
426 char buf[8192] = { 0 };
427 bool complete, armor_header;
436 for (complete =
true, armor_header =
true;
453 armor_header =
false;
460 if ((buf[0] ==
'-') && (buf[1] ==
' '))
474 bool could_not_decrypt =
false;
475 int decrypt_okay_rc = 0;
477 bool pgp_keyblock =
false;
478 bool clearsign =
false;
482 LOFF_T last_pos, offset;
483 char buf[8192] = { 0 };
484 FILE *fp_pgp_out = NULL, *fp_pgp_in = NULL, *fp_pgp_err = NULL;
489 bool maybe_goodsig =
true;
490 bool have_any_sigs =
false;
492 char *gpgcharset = NULL;
493 char body_charset[256] = { 0 };
502 for (bytes = b->
length; bytes > 0;)
504 if (!fgets(buf,
sizeof(buf), state->
fp_in))
507 offset = ftello(state->
fp_in);
508 bytes -= (offset - last_pos);
516 could_not_decrypt =
false;
553 while ((bytes > 0) && fgets(buf,
sizeof(buf) - 1, state->
fp_in))
555 offset = ftello(state->
fp_in);
556 bytes -= (offset - last_pos);
561 if ((needpass &&
mutt_str_equal(
"-----END PGP MESSAGE-----\n", buf)) ||
562 (!needpass && (
mutt_str_equal(
"-----END PGP SIGNATURE-----\n", buf) ||
574 if ((l > 0) && (gpgcharset[l - 1] ==
'\n'))
575 gpgcharset[l - 1] = 0;
607 maybe_goodsig =
false;
619 fprintf(fp_pgp_in,
"%s\n",
PgpPass);
637 if (decrypt_okay_rc <= -3)
647 if (checksig_rc == 0)
648 have_any_sigs =
true;
653 if (checksig_rc == -1 || (wait_filter_rc != 0))
654 maybe_goodsig =
false;
669 c = fgetc(fp_pgp_out);
670 ungetc(c, fp_pgp_out);
672 if (!clearsign && (!fp_pgp_out || (c == EOF)))
674 could_not_decrypt =
true;
678 if ((could_not_decrypt || (decrypt_okay_rc <= -3)) && !(state->
flags &
STATE_DISPLAY))
690 else if (pgp_keyblock)
705 char *expected_charset = (gpgcharset && *gpgcharset) ? gpgcharset :
"utf-8";
732 if (could_not_decrypt || (decrypt_okay_rc <= -3))
736 else if (decrypt_okay_rc < 0)
748 else if (pgp_keyblock)
771 b->
goodsig = (maybe_goodsig && have_any_sigs);
787 state_attach_puts(state,
_(
"[-- Error: could not find beginning of PGP message --]\n\n"));
803 struct Buffer *tempfile = NULL;
804 char buf[8192] = { 0 };
830 while (fgets(buf,
sizeof(buf), fp_tmp))
846 if (!enc && !sgn && !key)
873 for (; b; b = b->
next)
900 FILE *fp_pgp_out = NULL;
973 struct State state = { 0 };
1007 mutt_error(
_(
"Internal error. Please submit a bug report."));
1027 FILE *fp_out,
struct Body *p)
1029 if (!a || !state || !fp_out || !p)
1032 char buf[1024] = { 0 };
1033 FILE *fp_pgp_in = NULL, *fp_pgp_out = NULL, *fp_pgp_tmp = NULL;
1034 struct Body *tattach = NULL;
1084 fputc(
'\n', fp_pgp_in);
1089 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_out))
1092 if ((len > 1) && (buf[len - 2] ==
'\r'))
1093 strcpy(buf + len - 2,
"\n");
1101 if (c_pgp_use_gpg_agent)
1130 if (fgetc(fp_out) == EOF)
1164 struct State state = { 0 };
1166 bool need_decode =
false;
1167 LOFF_T saved_offset = 0;
1168 size_t saved_length = 0;
1169 FILE *fp_decoded = NULL;
1189 state.
fp_in = fp_in;
1193 saved_offset = b->
offset;
1194 saved_length = b->
length;
1208 state.
fp_out = fp_decoded;
1213 b->
length = ftello(fp_decoded);
1216 state.
fp_in = fp_decoded;
1236 b->
length = saved_length;
1237 b->
offset = saved_offset;
1250 struct Body *tattach = NULL;
1284 fp_in = state->
fp_in;
1285 state->
fp_in = fp_out;
1287 state->
fp_in = fp_in;
1334 struct Body *b_enc = NULL, *rv = NULL;
1335 char buf[1024] = { 0 };
1336 FILE *fp_pgp_in = NULL, *fp_pgp_out = NULL, *fp_pgp_err = NULL, *fp_signed = NULL;
1363 fputc(
'\n', fp_signed);
1367 pid =
pgp_invoke_sign(&fp_pgp_in, &fp_pgp_out, &fp_pgp_err, -1, -1, -1,
1380 fputc(
'\n', fp_pgp_in);
1385 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_out))
1388 fputs(
"-----BEGIN PGP SIGNATURE-----\n", fp_sig);
1390 fputs(
"-----END PGP SIGNATURE-----\n", fp_sig);
1398 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_err))
1466 struct ListNode *crypt_hook = NULL;
1467 const char *keyid = NULL;
1468 char *keylist = NULL;
1469 size_t keylist_size = 0;
1470 size_t keylist_used = 0;
1474 char buf[1024] = { 0 };
1482 key_selected =
false;
1492 keyid = crypt_hook->
data;
1494 if (!oppenc_mode && c_crypt_confirm_hook && isatty(STDIN_FILENO))
1496 snprintf(buf,
sizeof(buf),
_(
"Use keyID = \"%s\" for %s?"), keyid,
1506 goto bypass_selection;
1516 else if (!oppenc_mode)
1523 if (key_selected ||
STAILQ_NEXT(crypt_hook, entries))
1544 if (!k_info && !oppenc_mode && isatty(STDIN_FILENO))
1563 sprintf(keylist + keylist_used,
"%s0x%s", keylist_used ?
" " :
"", keyid);
1566 key_selected =
true;
1574 }
while (crypt_hook);
1588 const struct AddressList *from)
1590 char buf[1024] = { 0 };
1591 FILE *fp_pgp_in = NULL, *fp_tmp = NULL;
1592 struct Body *b_enc = NULL;
1631 fputc(
'\n', fp_tmp);
1636 fileno(fp_pgp_err),
buf_string(pgpinfile), keylist, sign);
1649 fputc(
'\n', fp_pgp_in);
1662 empty = (fgetc(fp_out) == EOF);
1667 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_err))
1723 struct Body *b_enc = NULL;
1724 char body_charset[256] = { 0 };
1725 const char *from_charset = NULL;
1726 const char *send_charset = NULL;
1729 char buf[256] = { 0 };
1762 from_charset = body_charset;
1768 send_charset =
"us-ascii";
1777 send_charset =
"us-ascii";
1779 send_charset =
"utf-8";
1784 fputc(c, fp_pgp_in);
1794 if (!fp_pgp_out || !fp_pgp_err)
1808 fileno(fp_pgp_err),
buf_string(pgpinfile), keylist, flags);
1822 fprintf(fp_pgp_in,
"%s\n",
PgpPass);
1838 empty = (fgetc(fp_pgp_out) == EOF);
1843 while (fgets(buf,
sizeof(buf), fp_pgp_err))
1870 (flags &
SEC_ENCRYPT) ?
"pgp-encrypted" :
"pgp-signed");
1896 const char *prompt = NULL;
1897 const char *letters = NULL;
1898 const char *choices = NULL;
1899 char promptbuf[1024] = { 0 };
1907 if (c_pgp_auto_inline &&
1915 char *mime_inline = NULL;
1920 mime_inline =
_(
"PGP/M(i)ME");
1926 mime_inline =
_(
"(i)nline");
1937 snprintf(promptbuf,
sizeof(promptbuf),
1939 _(
"PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off?"),
1944 letters =
_(
"saico");
1950 prompt =
_(
"PGP (s)ign, sign (a)s, (c)lear, or (o)ppenc mode off?");
1952 letters =
_(
"saco");
1956 else if (c_crypt_opportunistic_encrypt)
1964 snprintf(promptbuf,
sizeof(promptbuf),
1966 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode?"),
1971 letters =
_(
"esabico");
1972 choices =
"esabicO";
1977 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (c)lear, or (o)ppenc mode?");
1979 letters =
_(
"esabco");
1988 snprintf(promptbuf,
sizeof(promptbuf),
1990 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear?"),
1995 letters =
_(
"esabic");
2001 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (c)lear?");
2003 letters =
_(
"esabc");
2011 switch (choices[choice - 1])
2019 char input_signas[128] = { 0 };
void mutt_addrlist_qualify(struct AddressList *al, const char *host)
Expand local names in an Address list using a hostname.
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
int mutt_addrlist_parse(struct AddressList *al, const char *s)
Parse a list of email addresses.
GUI display the mailboxes in a side panel.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
const struct Regex * cs_subset_regex(const struct ConfigSubset *sub, const char *name)
Get a regex config item by name.
long cs_subset_long(const struct ConfigSubset *sub, const char *name)
Get a long config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
const char * cc_charset(void)
Get the cached value of $charset.
Convenience wrapper for the core headers.
void crypt_opportunistic_encrypt(struct Email *e)
Can all recipients be determined.
bool crypt_is_numerical_keyid(const char *s)
Is this a numerical keyid.
SecurityFlags mutt_is_multipart_signed(struct Body *b)
Is a message signed?
int mutt_is_valid_multipart_pgp_encrypted(struct Body *b)
Is this a valid multi-part encrypted message?
SecurityFlags mutt_is_malformed_multipart_pgp_encrypted(struct Body *b)
Check for malformed layout.
void crypt_current_time(struct State *state, const char *app_name)
Print the current time.
void crypt_convert_to_7bit(struct Body *b)
Convert an email to 7bit encoding.
SecurityFlags mutt_is_application_pgp(const struct Body *b)
Does the message use PGP?
Signing/encryption multiplexor.
void crypt_pgp_void_passphrase(void)
Wrapper for CryptModuleSpecs::void_passphrase()
Wrapper around crypto functions.
int mutt_any_key_to_continue(const char *s)
Prompt the user to 'press any key' and wait.
void mutt_need_hard_redraw(void)
Force a hard refresh.
void mutt_endwin(void)
Shutdown curses.
void mutt_body_free(struct Body **ptr)
Free a Body.
struct Body * mutt_body_new(void)
Create a new Body.
char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen)
Get a body's character set.
Structs that make up an email.
void mutt_parse_part(FILE *fp, struct Body *b)
Parse a MIME part.
struct Body * mutt_read_mime_header(FILE *fp, bool digest)
Parse a MIME header.
void mutt_env_free(struct Envelope **ptr)
Free an Envelope.
bool envlist_set(char ***envp, const char *name, const char *value, bool overwrite)
Set an environment variable.
int mutt_file_copy_stream(FILE *fp_in, FILE *fp_out)
Copy the contents of one file into another.
char * mutt_file_read_line(char *line, size_t *size, FILE *fp, int *line_num, ReadLineFlags flags)
Read a line from a file.
int mutt_file_copy_bytes(FILE *fp_in, FILE *fp_out, size_t size)
Copy some content from one file to another.
long mutt_file_get_size_fp(FILE *fp)
Get the size of a file.
bool mutt_file_seek(FILE *fp, LOFF_T offset, int whence)
Wrapper for fseeko with error handling.
void mutt_file_unlink(const char *s)
Delete a file, carefully.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
#define MUTT_RL_NO_FLAGS
No flags are set.
bool OptDontHandlePgpKeys
(pseudo) used to extract PGP keys
bool OptPgpCheckTrust
(pseudo) used by dlg_pgp()
char ** EnvList
Private copy of the environment variables.
int pgp_class_application_handler(struct Body *b, struct State *state)
Manage the MIME type "application/pgp" or "application/smime" - Implements CryptModuleSpecs::applicat...
int pgp_class_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec)
Decrypt an encrypted MIME part - Implements CryptModuleSpecs::decrypt_mime() -.
int pgp_class_encrypted_handler(struct Body *b, struct State *state)
Manage a PGP or S/MIME encrypted MIME part - Implements CryptModuleSpecs::encrypted_handler() -.
char * pgp_class_find_keys(const struct AddressList *addrlist, bool oppenc_mode)
Find the keyids of the recipients of a message - Implements CryptModuleSpecs::find_keys() -.
bool pgp_class_check_traditional(FILE *fp, struct Body *b, bool just_one)
Look for inline (non-MIME) PGP content - Implements CryptModuleSpecs::pgp_check_traditional() -.
struct Body * pgp_class_encrypt_message(struct Body *b, char *keylist, bool sign, const struct AddressList *from)
PGP encrypt an email - Implements CryptModuleSpecs::pgp_encrypt_message() -.
void pgp_class_invoke_getkeys(struct Address *addr)
Run a command to download a PGP key - Implements CryptModuleSpecs::pgp_invoke_getkeys() -.
void pgp_class_invoke_import(const char *fname)
Import a key from a message into the user's public key ring - Implements CryptModuleSpecs::pgp_invoke...
struct Body * pgp_class_traditional_encryptsign(struct Body *b, SecurityFlags flags, char *keylist)
Create an inline PGP encrypted, signed email - Implements CryptModuleSpecs::pgp_traditional_encryptsi...
struct Body * pgp_class_sign_message(struct Body *b, const struct AddressList *from)
Cryptographically sign the Body of a message - Implements CryptModuleSpecs::sign_message() -.
bool pgp_class_valid_passphrase(void)
Ensure we have a valid passphrase - Implements CryptModuleSpecs::valid_passphrase() -.
int pgp_class_verify_one(struct Body *b, struct State *state, const char *tempfile)
Check a signed MIME part against a signature - Implements CryptModuleSpecs::verify_one() -.
void pgp_class_void_passphrase(void)
Forget the cached passphrase - Implements CryptModuleSpecs::void_passphrase() -.
int mw_get_field(const char *prompt, struct Buffer *buf, CompletionFlags complete, enum HistoryClass hclass, const struct CompleteOps *comp_api, void *cdata)
Ask the user for a string -.
int mw_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question -.
int mutt_protected_headers_handler(struct Body *b_email, struct State *state)
Handler for protected headers - Implements handler_t -.
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
int mutt_body_handler(struct Body *b, struct State *state)
Handler for the Body of an email.
void mutt_decode_attachment(const struct Body *b, struct State *state)
Decode an email's attachment.
Decide how to display email content.
Read/write command history from/to a file.
@ HC_OTHER
Miscellaneous strings.
void mutt_crypt_hook(struct ListHead *list, struct Address *addr)
Find crypto hooks for an Address.
Parse and execute user-defined hooks.
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
@ LL_DEBUG3
Log at debug level 3.
@ LL_DEBUG2
Log at debug level 2.
@ LL_DEBUG1
Log at debug level 1.
#define MUTT_MEM_REALLOC(pptr, n, type)
@ TYPE_MULTIPART
Type: 'multipart/*'.
@ TYPE_APPLICATION
Type: 'application/*'.
@ TYPE_TEXT
Type: 'text/*'.
@ DISP_ATTACH
Content is attached.
@ DISP_INLINE
Content is inline.
@ DISP_NONE
No preferred disposition.
#define is_multipart(body)
void mutt_generate_boundary(struct ParameterList *pl)
Create a unique boundary id for a MIME part.
bool mutt_ch_check_charset(const char *cs, bool strict)
Does iconv understand a character set?
int mutt_ch_fgetconv(struct FgetConv *fc)
Convert a file's character set.
struct FgetConv * mutt_ch_fgetconv_open(FILE *fp, const char *from, const char *to, uint8_t flags)
Prepare a file for charset conversion.
char * mutt_ch_fgetconvs(char *buf, size_t buflen, struct FgetConv *fc)
Convert a file's charset into a string buffer.
void mutt_ch_fgetconv_close(struct FgetConv **ptr)
Close an fgetconv handle.
#define MUTT_ICONV_HOOK_FROM
apply charset-hooks to fromcode
#define mutt_ch_is_us_ascii(str)
#define MUTT_ICONV_NO_FLAGS
No flags are set.
time_t mutt_date_add_timeout(time_t now, time_t timeout)
Safely add a timeout to a given time_t value.
time_t mutt_date_now(void)
Return the number of seconds since the Unix epoch.
int filter_wait(pid_t pid)
Wait for the exit of a process and return its status.
Convenience wrapper for the library headers.
bool mutt_regex_match(const struct Regex *regex, const char *str)
Shorthand to mutt_regex_capture()
void state_attach_puts(struct State *state, const char *t)
Write a string to the state.
void state_prefix_putc(struct State *state, char c)
Write a prefixed character to the state.
#define state_puts(STATE, STR)
#define state_set_prefix(state)
#define STATE_DISPLAY
Output is displayed to the user.
#define state_putc(STATE, STR)
#define STATE_VERIFY
Perform signature verification.
#define STATE_NO_FLAGS
No flags are set.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
bool mutt_strn_equal(const char *a, const char *b, size_t num)
Check for equality of two strings (to a maximum), safely.
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
char * mutt_str_skip_whitespace(const char *p)
Find the first non-whitespace character in a string.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Many unsorted constants and some structs.
#define MUTT_COMP_PASS
Password mode (no echo)
#define MUTT_COMP_UNBUFFERED
Ignore macro buffer.
int mutt_decode_save_attachment(FILE *fp, struct Body *b, const char *path, StateFlags flags, enum SaveAttach opt)
Decode, then save an attachment.
@ MUTT_SAVE_NO_FLAGS
No flags set.
#define SEC_INLINE
Email has an inline signature.
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
#define SEC_OPPENCRYPT
Opportunistic encrypt mode.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define KEYFLAG_CANENCRYPT
Key is suitable for encryption.
#define KEYFLAG_SUBKEY
Key is a subkey.
#define KEYFLAG_NO_FLAGS
No flags are set.
#define SEC_ENCRYPT
Email is encrypted.
#define SEC_SIGN
Email is signed.
void mutt_param_set(struct ParameterList *pl, const char *attribute, const char *value)
Set a Parameter.
char * pgp_long_keyid(struct PgpKeyInfo *k)
Get a key's long id.
char * pgp_this_keyid(struct PgpKeyInfo *k)
Get the ID of this key.
static struct Body * pgp_decrypt_part(struct Body *a, struct State *state, FILE *fp_out, struct Body *p)
Decrypt part of a PGP message.
static char * pgp_fingerprint(struct PgpKeyInfo *k)
Get the key's fingerprint.
static int pgp_check_pgp_decryption_okay_regex(FILE *fp_in)
Check PGP output to look for successful outcome.
static char PgpPass[1024]
Cached PGP Passphrase.
static time_t PgpExptime
Unix time when PgpPass expires.
char * pgp_keyid(struct PgpKeyInfo *k)
Get the ID of the main (parent) key.
char * pgp_fpr_or_lkeyid(struct PgpKeyInfo *k)
Get the fingerprint or long keyid.
static struct PgpKeyInfo * key_parent(struct PgpKeyInfo *k)
Find a key's parent (if it's a subkey)
static int pgp_copy_checksig(FILE *fp_in, FILE *fp_out)
Copy PGP output and look for signs of a good signature.
char * pgp_short_keyid(struct PgpKeyInfo *k)
Get a key's short id.
static void pgp_copy_clearsigned(FILE *fp_in, struct State *state, char *charset)
Copy a clearsigned message, stripping the signature.
static void pgp_extract_keys_from_attachment(FILE *fp, struct Body *b)
Extract pgp keys from messages/attachments.
bool pgp_use_gpg_agent(void)
Does the user want to use the gpg agent?
static int pgp_check_decryption_okay(FILE *fp_in)
Check GPG output for status codes.
static bool pgp_check_traditional_one_body(FILE *fp, struct Body *b)
Check the body of an inline PGP message.
PGP sign, encrypt, check routines.
pid_t pgp_invoke_encrypt(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int fd_pgp_in, int fd_pgp_out, int fd_pgp_err, const char *fname, const char *uids, bool sign)
Use PGP to encrypt a file.
pid_t pgp_invoke_decode(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int fd_pgp_in, int fd_pgp_out, int fd_pgp_err, const char *fname, bool need_passphrase)
Use PGP to decode a message.
pid_t pgp_invoke_traditional(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int fd_pgp_in, int fd_pgp_out, int fd_pgp_err, const char *fname, const char *uids, SecurityFlags flags)
Use PGP to create in inline-signed message.
pid_t pgp_invoke_sign(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int fd_pgp_in, int fd_pgp_out, int fd_pgp_err, const char *fname)
Use PGP to sign a file.
pid_t pgp_invoke_verify(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int fd_pgp_in, int fd_pgp_out, int fd_pgp_err, const char *fname, const char *sig_fname)
Use PGP to verify a message.
pid_t pgp_invoke_decrypt(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int fd_pgp_in, int fd_pgp_out, int fd_pgp_err, const char *fname)
Use PGP to decrypt a file.
Wrapper around calls to external PGP program.
struct PgpKeyInfo * pgp_ask_for_key(char *tag, const char *whatfor, KeyFlags abilities, enum PgpRing keyring)
Ask the user for a PGP key.
struct PgpKeyInfo * pgp_getkeybyaddr(struct Address *a, KeyFlags abilities, enum PgpRing keyring, bool oppenc_mode)
Find a PGP key by address.
struct PgpKeyInfo * pgp_getkeybystr(const char *cp, KeyFlags abilities, enum PgpRing keyring)
Find a PGP key by string.
PGP key management routines.
@ PGP_SECRING
Secret keys.
@ PGP_PUBRING
Public keys.
void pgp_key_free(struct PgpKeyInfo **kpp)
Free a PGP key info.
Misc PGP helper routines.
const char * pgp_micalg(const char *fname)
Find the hash algorithm of a file.
Identify the hash algorithm from a PGP signature.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
QuadOption
Possible values for a quad-option.
@ MUTT_ABORT
User aborted the question (with Ctrl-G)
@ MUTT_NO
User answered 'No', or assume 'No'.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
enum QuadOption query_yesorno_help(const char *prompt, enum QuadOption def, struct ConfigSubset *sub, const char *name)
Ask the user a Yes/No question offering help.
#define TAILQ_FOREACH(var, head, field)
#define STAILQ_HEAD_INITIALIZER(head)
#define STAILQ_FIRST(head)
#define TAILQ_FIRST(head)
#define TAILQ_HEAD_INITIALIZER(head)
#define STAILQ_NEXT(elm, field)
int mutt_write_mime_body(struct Body *b, FILE *fp, struct ConfigSubset *sub)
Write a MIME part.
Convenience wrapper for the send headers.
const char * mutt_fqdn(bool may_hide_host, const struct ConfigSubset *sub)
Get the Fully-Qualified Domain Name.
struct Buffer * mailbox
Mailbox and host address.
char * d_filename
filename to be used for the content-disposition header If NULL, filename is used instead.
struct Body * parts
parts of a multipart or message/rfc822
LOFF_T offset
offset where the actual data begins
bool noconv
Don't do character set conversion.
bool unlink
If true, filename should be unlink()ed before free()ing this structure.
struct Envelope * mime_headers
Memory hole protected headers.
LOFF_T length
length (in bytes) of attachment
struct ParameterList parameter
Parameters of the content-type.
bool use_disp
Content-Disposition uses filename= ?
unsigned int disposition
content-disposition, ContentDisposition
struct Body * next
next attachment in the list
char * subtype
content-type subtype
unsigned int encoding
content-transfer-encoding, ContentEncoding
bool goodsig
Good cryptographic signature.
unsigned int type
content-type primary type, ContentType
char * filename
When sending a message, this is the file to which this structure refers.
String manipulation buffer.
The envelope/body of an email.
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Cursor for converting a file's encoding.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Information about a PGP key.
struct PgpKeyInfo * parent
Cached regular expression.
regex_t * regex
compiled expression
Keep track when processing files.
StateFlags flags
Flags, e.g. STATE_DISPLAY.
FILE * fp_out
File to write to.
FILE * fp_in
File to read from.
const char * prefix
String to add to the beginning of each output line.
int cs_subset_str_string_set(const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err)
Set a config item by string.
#define mutt_file_mkstemp()