64#ifdef CRYPT_BACKEND_CLASSIC_PGP
103 false, NULL, NULL, NULL);
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)
306 if (c_pgp_decryption_okay && c_pgp_decryption_okay->
regex)
356 char *line = NULL, *s = NULL;
358 int inside_decrypt = 0;
361 if (!c_pgp_check_gpg_decrypt_status_fd)
418 char buf[8192] = { 0 };
419 bool complete, armor_header;
429 for (complete =
true, armor_header =
true;
446 armor_header =
false;
453 if ((buf[0] ==
'-') && (buf[1] ==
' '))
467 bool could_not_decrypt =
false;
468 int decrypt_okay_rc = 0;
470 bool pgp_keyblock =
false;
471 bool clearsign =
false;
475 LOFF_T last_pos, offset;
476 char buf[8192] = { 0 };
477 FILE *fp_pgp_out = NULL, *fp_pgp_in = NULL, *fp_pgp_err = NULL;
482 bool maybe_goodsig =
true;
483 bool have_any_sigs =
false;
485 char *gpgcharset = NULL;
486 char body_charset[256] = { 0 };
495 for (bytes = m->
length; bytes > 0;)
497 if (!fgets(buf,
sizeof(buf), state->
fp_in))
500 offset = ftello(state->
fp_in);
501 bytes -= (offset - last_pos);
508 could_not_decrypt =
false;
545 while ((bytes > 0) && fgets(buf,
sizeof(buf) - 1, state->
fp_in))
547 offset = ftello(state->
fp_in);
548 bytes -= (offset - last_pos);
553 if ((needpass &&
mutt_str_equal(
"-----END PGP MESSAGE-----\n", buf)) ||
554 (!needpass && (
mutt_str_equal(
"-----END PGP SIGNATURE-----\n", buf) ||
566 if ((l > 0) && (gpgcharset[l - 1] ==
'\n'))
567 gpgcharset[l - 1] = 0;
599 maybe_goodsig =
false;
611 fprintf(fp_pgp_in,
"%s\n",
PgpPass);
629 if (decrypt_okay_rc <= -3)
639 if (checksig_rc == 0)
640 have_any_sigs =
true;
645 if (checksig_rc == -1 || (wait_filter_rc != 0))
646 maybe_goodsig =
false;
661 c = fgetc(fp_pgp_out);
662 ungetc(c, fp_pgp_out);
664 if (!clearsign && (!fp_pgp_out || (c == EOF)))
666 could_not_decrypt =
true;
670 if ((could_not_decrypt || (decrypt_okay_rc <= -3)) && !(state->
flags &
STATE_DISPLAY))
682 else if (pgp_keyblock)
697 char *expected_charset = (gpgcharset && *gpgcharset) ? gpgcharset :
"utf-8";
701 expected_charset, c_charset);
724 if (could_not_decrypt || (decrypt_okay_rc <= -3))
726 else if (decrypt_okay_rc < 0)
736 else if (pgp_keyblock)
755 m->
goodsig = (maybe_goodsig && have_any_sigs);
771 state_attach_puts(state,
_(
"[-- Error: could not find beginning of PGP message --]\n\n"));
787 struct Buffer *tempfile = NULL;
788 char buf[8192] = { 0 };
814 while (fgets(buf,
sizeof(buf), fp_tmp))
830 if (!enc && !sgn && !key)
857 for (; b; b = b->
next)
882 FILE *fp_pgp_out = NULL;
955 struct State state = { 0 };
989 mutt_error(
_(
"Internal error. Please submit a bug report."));
1009 FILE *fp_out,
struct Body *p)
1011 if (!a || !state || !fp_out || !p)
1014 char buf[1024] = { 0 };
1015 FILE *fp_pgp_in = NULL, *fp_pgp_out = NULL, *fp_pgp_tmp = NULL;
1016 struct Body *tattach = NULL;
1066 fputc(
'\n', fp_pgp_in);
1071 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_out))
1074 if ((len > 1) && (buf[len - 2] ==
'\r'))
1075 strcpy(buf + len - 2,
"\n");
1083 if (c_pgp_use_gpg_agent)
1112 if (fgetc(fp_out) == EOF)
1146 struct State state = { 0 };
1148 bool need_decode =
false;
1149 LOFF_T saved_offset = 0;
1150 size_t saved_length = 0;
1151 FILE *fp_decoded = NULL;
1169 state.
fp_in = fp_in;
1173 saved_offset = b->
offset;
1174 saved_length = b->
length;
1188 state.
fp_out = fp_decoded;
1193 b->
length = ftello(fp_decoded);
1196 state.
fp_in = fp_decoded;
1216 b->
length = saved_length;
1217 b->
offset = saved_offset;
1230 struct Body *tattach = NULL;
1264 fp_in = state->
fp_in;
1265 state->
fp_in = fp_out;
1267 state->
fp_in = fp_in;
1317 struct Body *t = NULL, *rv = NULL;
1318 char buf[1024] = { 0 };
1319 FILE *fp_pgp_in = NULL, *fp_pgp_out = NULL, *fp_pgp_err = NULL, *fp_signed = NULL;
1346 fputc(
'\n', fp_signed);
1350 pid =
pgp_invoke_sign(&fp_pgp_in, &fp_pgp_out, &fp_pgp_err, -1, -1, -1,
1363 fputc(
'\n', fp_pgp_in);
1368 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_out))
1371 fputs(
"-----BEGIN PGP SIGNATURE-----\n", fp_sig);
1373 fputs(
"-----END PGP SIGNATURE-----\n", fp_sig);
1381 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_err))
1449 struct ListNode *crypt_hook = NULL;
1450 const char *keyid = NULL;
1451 char *keylist = NULL;
1452 size_t keylist_size = 0;
1453 size_t keylist_used = 0;
1457 char buf[1024] = { 0 };
1464 key_selected =
false;
1474 keyid = crypt_hook->
data;
1477 if (!oppenc_mode && c_crypt_confirm_hook)
1479 snprintf(buf,
sizeof(buf),
_(
"Use keyID = \"%s\" for %s?"), keyid, p->
mailbox);
1488 goto bypass_selection;
1498 else if (!oppenc_mode)
1505 if (key_selected ||
STAILQ_NEXT(crypt_hook, entries))
1526 if (!k_info && !oppenc_mode)
1528 snprintf(buf,
sizeof(buf),
_(
"Enter keyID for %s: "), p->
mailbox);
1545 sprintf(keylist + keylist_used,
"%s0x%s", keylist_used ?
" " :
"", keyid);
1548 key_selected =
true;
1556 }
while (crypt_hook);
1570 const struct AddressList *from)
1572 char buf[1024] = { 0 };
1573 FILE *fp_pgp_in = NULL, *fp_tmp = NULL;
1574 struct Body *t = NULL;
1613 fputc(
'\n', fp_tmp);
1617 pid =
pgp_invoke_encrypt(&fp_pgp_in, NULL, NULL, -1, fileno(fp_out), fileno(fp_pgp_err),
1631 fputc(
'\n', fp_pgp_in);
1644 empty = (fgetc(fp_out) == EOF);
1649 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_err))
1705 struct Body *b = NULL;
1706 char body_charset[256] = { 0 };
1707 const char *from_charset = NULL;
1708 const char *send_charset = NULL;
1711 char buf[256] = { 0 };
1721 FILE *fp_body = fopen(a->
filename,
"r");
1745 from_charset = body_charset;
1747 from_charset = c_charset;
1755 send_charset =
"us-ascii";
1757 send_charset =
"utf-8";
1762 fputc(c, fp_pgp_in);
1768 send_charset =
"us-ascii";
1777 if (!fp_pgp_out || !fp_pgp_err)
1806 fprintf(fp_pgp_in,
"%s\n",
PgpPass);
1822 empty = (fgetc(fp_pgp_out) == EOF);
1827 while (fgets(buf,
sizeof(buf), fp_pgp_err))
1854 (flags &
SEC_ENCRYPT) ?
"pgp-encrypted" :
"pgp-signed");
1880 const char *prompt = NULL;
1881 const char *letters = NULL;
1882 const char *choices = NULL;
1883 char promptbuf[1024] = { 0 };
1891 if (c_pgp_auto_inline &&
1899 char *mime_inline = NULL;
1904 mime_inline =
_(
"PGP/M(i)ME");
1910 mime_inline =
_(
"(i)nline");
1921 snprintf(promptbuf,
sizeof(promptbuf),
1923 _(
"PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off?"),
1928 letters =
_(
"saico");
1934 prompt =
_(
"PGP (s)ign, sign (a)s, (c)lear, or (o)ppenc mode off?");
1936 letters =
_(
"saco");
1942 else if (c_crypt_opportunistic_encrypt)
1948 snprintf(promptbuf,
sizeof(promptbuf),
1950 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode?"),
1955 letters =
_(
"esabico");
1956 choices =
"esabicO";
1961 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (c)lear, or (o)ppenc mode?");
1963 letters =
_(
"esabco");
1972 snprintf(promptbuf,
sizeof(promptbuf),
1974 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear?"),
1979 letters =
_(
"esabic");
1985 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (c)lear?");
1987 letters =
_(
"esabc");
1995 switch (choices[choice - 1])
2003 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 mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
char * mutt_buffer_strdup(const struct Buffer *buf)
Copy a Buffer's string.
static const char * mutt_buffer_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.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string 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.
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.
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.
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.
int mutt_buffer_get_field(const char *field, struct Buffer *buf, CompletionFlags complete, bool multiple, struct Mailbox *m, char ***files, int *numfiles)
Ask the user for a string.
void mutt_env_free(struct Envelope **ptr)
Free an Envelope.
bool mutt_envlist_set(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_file_mkstemp()
#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_select_pgp_key()
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 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.
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?
void mutt_ch_fgetconv_close(struct FgetConv **fc)
Close an fgetconv handle.
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.
#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.
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.
Some miscellaneous functions.
#define mutt_buffer_mktemp(buf)
#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.
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.
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.
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, 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.
static size_t plen
Length of cached packet.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from 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 mutt_yesorno(const char *msg, enum QuadOption def)
Ask the user a Yes/No question.
int mutt_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question.
#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.
char * 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.