64#ifdef CRYPT_BACKEND_CLASSIC_PGP
134 if (!c_pgp_use_gpg_agent)
140 setenv(
"GPG_TTY", tty, 0);
254 if (!fp_in || !fp_out)
260 if (c_pgp_good_sign && c_pgp_good_sign->
regex)
309 if (c_pgp_decryption_okay && c_pgp_decryption_okay->
regex)
361 char *line = NULL, *s = NULL;
363 int inside_decrypt = 0;
366 if (!c_pgp_check_gpg_decrypt_status_fd)
427 char buf[8192] = { 0 };
428 bool complete, armor_header;
437 for (complete =
true, armor_header =
true;
454 armor_header =
false;
461 if ((buf[0] ==
'-') && (buf[1] ==
' '))
475 bool could_not_decrypt =
false;
476 int decrypt_okay_rc = 0;
478 bool pgp_keyblock =
false;
479 bool clearsign =
false;
483 LOFF_T last_pos, offset;
484 char buf[8192] = { 0 };
485 FILE *fp_pgp_out = NULL, *fp_pgp_in = NULL, *fp_pgp_err = NULL;
490 bool maybe_goodsig =
true;
491 bool have_any_sigs =
false;
493 char *gpgcharset = NULL;
494 char body_charset[256] = { 0 };
503 for (bytes = m->
length; bytes > 0;)
505 if (!fgets(buf,
sizeof(buf), state->
fp_in))
508 offset = ftello(state->
fp_in);
509 bytes -= (offset - last_pos);
516 could_not_decrypt =
false;
555 while ((bytes > 0) && fgets(buf,
sizeof(buf) - 1, state->
fp_in))
557 offset = ftello(state->
fp_in);
558 bytes -= (offset - last_pos);
563 if ((needpass &&
mutt_str_equal(
"-----END PGP MESSAGE-----\n", buf)) ||
564 (!needpass && (
mutt_str_equal(
"-----END PGP SIGNATURE-----\n", buf) ||
576 if ((l > 0) && (gpgcharset[l - 1] ==
'\n'))
577 gpgcharset[l - 1] = 0;
609 maybe_goodsig =
false;
621 fprintf(fp_pgp_in,
"%s\n",
PgpPass);
639 if (decrypt_okay_rc <= -3)
649 if (checksig_rc == 0)
650 have_any_sigs =
true;
655 if (checksig_rc == -1 || (wait_filter_rc != 0))
656 maybe_goodsig =
false;
671 c = fgetc(fp_pgp_out);
672 ungetc(c, fp_pgp_out);
674 if (!clearsign && (!fp_pgp_out || (c == EOF)))
676 could_not_decrypt =
true;
680 if ((could_not_decrypt || (decrypt_okay_rc <= -3)) && !(state->
flags &
STATE_DISPLAY))
692 else if (pgp_keyblock)
707 char *expected_charset = (gpgcharset && *gpgcharset) ? gpgcharset :
"utf-8";
734 if (could_not_decrypt || (decrypt_okay_rc <= -3))
738 else if (decrypt_okay_rc < 0)
750 else if (pgp_keyblock)
773 m->
goodsig = (maybe_goodsig && have_any_sigs);
789 state_attach_puts(state,
_(
"[-- Error: could not find beginning of PGP message --]\n\n"));
805 struct Buffer *tempfile = NULL;
806 char buf[8192] = { 0 };
825 FILE *fp_tmp = fopen(
buf_string(tempfile),
"r");
832 while (fgets(buf,
sizeof(buf), fp_tmp))
848 if (!enc && !sgn && !key)
875 for (; b; b = b->
next)
902 FILE *fp_pgp_out = NULL;
975 struct State state = { 0 };
1009 mutt_error(
_(
"Internal error. Please submit a bug report."));
1029 FILE *fp_out,
struct Body *p)
1031 if (!a || !state || !fp_out || !p)
1034 char buf[1024] = { 0 };
1035 FILE *fp_pgp_in = NULL, *fp_pgp_out = NULL, *fp_pgp_tmp = NULL;
1036 struct Body *tattach = NULL;
1086 fputc(
'\n', fp_pgp_in);
1091 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_out))
1094 if ((len > 1) && (buf[len - 2] ==
'\r'))
1095 strcpy(buf + len - 2,
"\n");
1103 if (c_pgp_use_gpg_agent)
1132 if (fgetc(fp_out) == EOF)
1166 struct State state = { 0 };
1168 bool need_decode =
false;
1169 LOFF_T saved_offset = 0;
1170 size_t saved_length = 0;
1171 FILE *fp_decoded = NULL;
1191 state.
fp_in = fp_in;
1195 saved_offset = b->
offset;
1196 saved_length = b->
length;
1210 state.
fp_out = fp_decoded;
1215 b->
length = ftello(fp_decoded);
1218 state.
fp_in = fp_decoded;
1238 b->
length = saved_length;
1239 b->
offset = saved_offset;
1252 struct Body *tattach = NULL;
1286 fp_in = state->
fp_in;
1287 state->
fp_in = fp_out;
1289 state->
fp_in = fp_in;
1339 struct Body *t = NULL, *rv = NULL;
1340 char buf[1024] = { 0 };
1341 FILE *fp_pgp_in = NULL, *fp_pgp_out = NULL, *fp_pgp_err = NULL, *fp_signed = NULL;
1368 fputc(
'\n', fp_signed);
1372 pid =
pgp_invoke_sign(&fp_pgp_in, &fp_pgp_out, &fp_pgp_err, -1, -1, -1,
1385 fputc(
'\n', fp_pgp_in);
1390 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_out))
1393 fputs(
"-----BEGIN PGP SIGNATURE-----\n", fp_sig);
1395 fputs(
"-----END PGP SIGNATURE-----\n", fp_sig);
1403 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_err))
1471 struct ListNode *crypt_hook = NULL;
1472 const char *keyid = NULL;
1473 char *keylist = NULL;
1474 size_t keylist_size = 0;
1475 size_t keylist_used = 0;
1479 char buf[1024] = { 0 };
1487 key_selected =
false;
1497 keyid = crypt_hook->
data;
1499 if (!oppenc_mode && c_crypt_confirm_hook)
1501 snprintf(buf,
sizeof(buf),
_(
"Use keyID = \"%s\" for %s?"), keyid,
1511 goto bypass_selection;
1521 else if (!oppenc_mode)
1528 if (key_selected ||
STAILQ_NEXT(crypt_hook, entries))
1549 if (!k_info && !oppenc_mode)
1568 sprintf(keylist + keylist_used,
"%s0x%s", keylist_used ?
" " :
"", keyid);
1571 key_selected =
true;
1579 }
while (crypt_hook);
1593 const struct AddressList *from)
1595 char buf[1024] = { 0 };
1596 FILE *fp_pgp_in = NULL, *fp_tmp = NULL;
1597 struct Body *t = NULL;
1636 fputc(
'\n', fp_tmp);
1641 fileno(fp_pgp_err),
buf_string(pgpinfile), keylist, sign);
1654 fputc(
'\n', fp_pgp_in);
1667 empty = (fgetc(fp_out) == EOF);
1672 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_err))
1728 struct Body *b = NULL;
1729 char body_charset[256] = { 0 };
1730 const char *from_charset = NULL;
1731 const char *send_charset = NULL;
1734 char buf[256] = { 0 };
1744 FILE *fp_body = fopen(a->
filename,
"r");
1767 from_charset = body_charset;
1773 send_charset =
"us-ascii";
1782 send_charset =
"us-ascii";
1784 send_charset =
"utf-8";
1789 fputc(c, fp_pgp_in);
1799 if (!fp_pgp_out || !fp_pgp_err)
1813 fileno(fp_pgp_err),
buf_string(pgpinfile), keylist, flags);
1827 fprintf(fp_pgp_in,
"%s\n",
PgpPass);
1843 empty = (fgetc(fp_pgp_out) == EOF);
1848 while (fgets(buf,
sizeof(buf), fp_pgp_err))
1875 (flags &
SEC_ENCRYPT) ?
"pgp-encrypted" :
"pgp-signed");
1901 const char *prompt = NULL;
1902 const char *letters = NULL;
1903 const char *choices = NULL;
1904 char promptbuf[1024] = { 0 };
1912 if (c_pgp_auto_inline &&
1920 char *mime_inline = NULL;
1925 mime_inline =
_(
"PGP/M(i)ME");
1931 mime_inline =
_(
"(i)nline");
1942 snprintf(promptbuf,
sizeof(promptbuf),
1944 _(
"PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off?"),
1949 letters =
_(
"saico");
1955 prompt =
_(
"PGP (s)ign, sign (a)s, (c)lear, or (o)ppenc mode off?");
1957 letters =
_(
"saco");
1961 else if (c_crypt_opportunistic_encrypt)
1969 snprintf(promptbuf,
sizeof(promptbuf),
1971 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode?"),
1976 letters =
_(
"esabico");
1977 choices =
"esabicO";
1982 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (c)lear, or (o)ppenc mode?");
1984 letters =
_(
"esabco");
1993 snprintf(promptbuf,
sizeof(promptbuf),
1995 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear?"),
2000 letters =
_(
"esabic");
2006 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (c)lear?");
2008 letters =
_(
"esabc");
2016 switch (choices[choice - 1])
2024 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.
SecurityFlags mutt_is_application_pgp(struct Body *b)
Does the message use PGP?
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?
void crypt_convert_to_7bit(struct Body *a)
Convert an email to 7bit encoding.
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.
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.
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
int mutt_file_copy_bytes(FILE *fp_in, FILE *fp_out, size_t size)
Copy some content from one file to another.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
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_RL_NO_FLAGS
No flags are set.
int filter_wait(pid_t pid)
Wait for the exit of a process and return its status.
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 *m, struct State *state)
Implements CryptModuleSpecs::application_handler() -.
int pgp_class_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
Implements CryptModuleSpecs::decrypt_mime() -.
int pgp_class_encrypted_handler(struct Body *a, struct State *state)
Implements CryptModuleSpecs::encrypted_handler() -.
char * pgp_class_find_keys(const struct AddressList *addrlist, bool oppenc_mode)
Implements CryptModuleSpecs::find_keys() -.
bool pgp_class_check_traditional(FILE *fp, struct Body *b, bool just_one)
Implements CryptModuleSpecs::pgp_check_traditional() -.
struct Body * pgp_class_encrypt_message(struct Body *a, char *keylist, bool sign, const struct AddressList *from)
Implements CryptModuleSpecs::pgp_encrypt_message() -.
void pgp_class_invoke_getkeys(struct Address *addr)
Implements CryptModuleSpecs::pgp_invoke_getkeys() -.
void pgp_class_invoke_import(const char *fname)
Implements CryptModuleSpecs::pgp_invoke_import() -.
struct Body * pgp_class_traditional_encryptsign(struct Body *a, SecurityFlags flags, char *keylist)
Implements CryptModuleSpecs::pgp_traditional_encryptsign() -.
struct Body * pgp_class_sign_message(struct Body *a, const struct AddressList *from)
Implements CryptModuleSpecs::sign_message() -.
bool pgp_class_valid_passphrase(void)
Implements CryptModuleSpecs::valid_passphrase() -.
int pgp_class_verify_one(struct Body *sigbdy, struct State *state, const char *tempfile)
Implements CryptModuleSpecs::verify_one() -.
void pgp_class_void_passphrase(void)
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, struct State *state)
Process a protected header - 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(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.
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
@ 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.
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 *m, 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 void pgp_extract_keys_from_attachment(FILE *fp, struct Body *top)
Extract pgp keys from messages/attachments.
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.
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 *a, 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.
char * prefix
String to add to the beginning of each output line.
FILE * fp_in
File to read from.
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()