63 #ifdef CRYPT_BACKEND_CLASSIC_PGP
130 if (!c_pgp_use_gpg_agent)
136 setenv(
"GPG_TTY", tty, 0);
250 if (!fp_in || !fp_out)
256 if (c_pgp_good_sign && c_pgp_good_sign->
regex)
303 if (c_pgp_decryption_okay && c_pgp_decryption_okay->
regex)
353 char *line = NULL, *s = NULL;
355 int inside_decrypt = 0;
358 if (!c_pgp_check_gpg_decrypt_status_fd)
416 bool complete, armor_header;
426 for (complete =
true, armor_header =
true;
443 armor_header =
false;
450 if ((buf[0] ==
'-') && (buf[1] ==
' '))
464 bool could_not_decrypt =
false;
465 int decrypt_okay_rc = 0;
467 bool pgp_keyblock =
false;
468 bool clearsign =
false;
472 LOFF_T last_pos, offset;
474 FILE *fp_pgp_out = NULL, *fp_pgp_in = NULL, *fp_pgp_err = NULL;
479 bool maybe_goodsig =
true;
480 bool have_any_sigs =
false;
482 char *gpgcharset = NULL;
483 char body_charset[256];
492 for (bytes = m->
length; bytes > 0;)
494 if (!fgets(buf,
sizeof(buf), s->
fp_in))
497 offset = ftello(s->
fp_in);
498 bytes -= (offset - last_pos);
505 could_not_decrypt =
false;
542 while ((bytes > 0) && fgets(buf,
sizeof(buf) - 1, s->
fp_in))
544 offset = ftello(s->
fp_in);
545 bytes -= (offset - last_pos);
550 if ((needpass &&
mutt_str_equal(
"-----END PGP MESSAGE-----\n", buf)) ||
551 (!needpass && (
mutt_str_equal(
"-----END PGP SIGNATURE-----\n", buf) ||
563 if ((l > 0) && (gpgcharset[l - 1] ==
'\n'))
564 gpgcharset[l - 1] = 0;
596 maybe_goodsig =
false;
608 fprintf(fp_pgp_in,
"%s\n",
PgpPass);
626 if (decrypt_okay_rc <= -3)
636 if (checksig_rc == 0)
637 have_any_sigs =
true;
642 if (checksig_rc == -1 || (wait_filter_rc != 0))
643 maybe_goodsig =
false;
658 c = fgetc(fp_pgp_out);
659 ungetc(c, fp_pgp_out);
661 if (!clearsign && (!fp_pgp_out || (c == EOF)))
663 could_not_decrypt =
true;
667 if ((could_not_decrypt || (decrypt_okay_rc <= -3)) && !(s->
flags &
MUTT_DISPLAY))
679 else if (pgp_keyblock)
694 char *expected_charset = (gpgcharset && *gpgcharset) ? gpgcharset :
"utf-8";
698 expected_charset, c_charset);
721 if (could_not_decrypt || (decrypt_okay_rc <= -3))
723 else if (decrypt_okay_rc < 0)
733 else if (pgp_keyblock)
752 m->
goodsig = (maybe_goodsig && have_any_sigs);
768 state_attach_puts(s,
_(
"[-- Error: could not find beginning of PGP message --]\n\n"));
784 struct Buffer *tempfile = NULL;
811 while (fgets(buf,
sizeof(buf), fp_tmp))
827 if (!enc && !sgn && !key)
854 for (; b; b = b->
next)
879 FILE *fp_pgp_out = NULL;
952 struct State s = { 0 };
986 mutt_error(
_(
"Internal error. Please submit a bug report."));
1006 FILE *fp_out,
struct Body *p)
1008 if (!a || !s || !fp_out || !p)
1012 FILE *fp_pgp_in = NULL, *fp_pgp_out = NULL, *fp_pgp_tmp = NULL;
1013 struct Body *tattach = NULL;
1063 fputc(
'\n', fp_pgp_in);
1068 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_out))
1071 if ((len > 1) && (buf[len - 2] ==
'\r'))
1072 strcpy(buf + len - 2,
"\n");
1080 if (c_pgp_use_gpg_agent)
1109 if (fgetc(fp_out) == EOF)
1143 struct State s = { 0 };
1145 bool need_decode =
false;
1146 LOFF_T saved_offset = 0;
1147 size_t saved_length = 0;
1148 FILE *fp_decoded = NULL;
1170 saved_offset = b->
offset;
1171 saved_length = b->
length;
1190 b->
length = ftello(fp_decoded);
1193 s.
fp_in = fp_decoded;
1213 b->
length = saved_length;
1214 b->
offset = saved_offset;
1227 struct Body *tattach = NULL;
1314 struct Body *t = NULL, *rv = NULL;
1316 FILE *fp_pgp_in = NULL, *fp_pgp_out = NULL, *fp_pgp_err = NULL, *fp_signed = NULL;
1343 fputc(
'\n', fp_signed);
1347 pid =
pgp_invoke_sign(&fp_pgp_in, &fp_pgp_out, &fp_pgp_err, -1, -1, -1,
1360 fputc(
'\n', fp_pgp_in);
1365 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_out))
1368 fputs(
"-----BEGIN PGP SIGNATURE-----\n", fp_sig);
1370 fputs(
"-----END PGP SIGNATURE-----\n", fp_sig);
1378 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_err))
1446 struct ListNode *crypt_hook = NULL;
1447 const char *keyid = NULL;
1448 char *keylist = NULL;
1449 size_t keylist_size = 0;
1450 size_t keylist_used = 0;
1461 key_selected =
false;
1471 keyid = crypt_hook->
data;
1474 if (!oppenc_mode && c_crypt_confirm_hook)
1476 snprintf(buf,
sizeof(buf),
_(
"Use keyID = \"%s\" for %s?"), keyid, p->
mailbox);
1485 goto bypass_selection;
1495 else if (!oppenc_mode)
1502 if (key_selected ||
STAILQ_NEXT(crypt_hook, entries))
1523 if (!k_info && !oppenc_mode)
1525 snprintf(buf,
sizeof(buf),
_(
"Enter keyID for %s: "), p->
mailbox);
1542 sprintf(keylist + keylist_used,
"%s0x%s", keylist_used ?
" " :
"", keyid);
1545 key_selected =
true;
1553 }
while (crypt_hook);
1567 const struct AddressList *from)
1570 FILE *fp_pgp_in = NULL, *fp_tmp = NULL;
1571 struct Body *t = NULL;
1610 fputc(
'\n', fp_tmp);
1614 pid =
pgp_invoke_encrypt(&fp_pgp_in, NULL, NULL, -1, fileno(fp_out), fileno(fp_pgp_err),
1628 fputc(
'\n', fp_pgp_in);
1641 empty = (fgetc(fp_out) == EOF);
1646 while (fgets(buf,
sizeof(buf) - 1, fp_pgp_err))
1702 struct Body *b = NULL;
1703 char body_charset[256];
1704 const char *from_charset = NULL;
1705 const char *send_charset = NULL;
1718 FILE *fp_body = fopen(a->
filename,
"r");
1742 from_charset = body_charset;
1744 from_charset = c_charset;
1752 send_charset =
"us-ascii";
1754 send_charset =
"utf-8";
1759 fputc(c, fp_pgp_in);
1765 send_charset =
"us-ascii";
1774 if (!fp_pgp_out || !fp_pgp_err)
1803 fprintf(fp_pgp_in,
"%s\n",
PgpPass);
1819 empty = (fgetc(fp_pgp_out) == EOF);
1824 while (fgets(buf,
sizeof(buf), fp_pgp_err))
1851 (flags &
SEC_ENCRYPT) ?
"pgp-encrypted" :
"pgp-signed");
1877 const char *prompt = NULL;
1878 const char *letters = NULL;
1879 const char *choices = NULL;
1880 char promptbuf[1024];
1888 if (c_pgp_auto_inline &&
1896 char *mime_inline = NULL;
1901 mime_inline =
_(
"PGP/M(i)ME");
1907 mime_inline =
_(
"(i)nline");
1918 snprintf(promptbuf,
sizeof(promptbuf),
1920 _(
"PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off?"),
1925 letters =
_(
"saico");
1931 prompt =
_(
"PGP (s)ign, sign (a)s, (c)lear, or (o)ppenc mode off?");
1933 letters =
_(
"saco");
1939 else if (c_crypt_opportunistic_encrypt)
1945 snprintf(promptbuf,
sizeof(promptbuf),
1947 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode?"),
1952 letters =
_(
"esabico");
1953 choices =
"esabicO";
1958 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (c)lear, or (o)ppenc mode?");
1960 letters =
_(
"esabco");
1969 snprintf(promptbuf,
sizeof(promptbuf),
1971 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear?"),
1976 letters =
_(
"esabic");
1982 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (c)lear?");
1984 letters =
_(
"esabc");
1992 switch (choices[choice - 1])
2000 char input_signas[128];
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.
char * mutt_buffer_strdup(const struct Buffer *buf)
Copy a Buffer's string.
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
void crypt_current_time(struct State *s, const char *app_name)
Print the current time.
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.
Signing/encryption multiplexor.
void crypt_pgp_void_passphrase(void)
Wrapper for CryptModuleSpecs::void_passphrase()
Wrapper around crypto functions.
int mutt_get_field_unbuffered(const char *msg, struct Buffer *buf, CompletionFlags flags)
Ask the user for a string (ignoring macro buffer)
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_epoch(void)
Return the number of seconds since the Unix epoch.
time_t mutt_date_add_timeout(time_t now, time_t timeout)
Safely add a timeout to a given time_t value.
void mutt_body_free(struct Body **ptr)
Free a Body.
char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen)
Get a body's character set.
struct Body * mutt_body_new(void)
Create a new Body.
Structs that make up an email.
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.
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)
char * mutt_file_read_line(char *line, size_t *size, FILE *fp, int *line_num, ReadLineFlags flags)
Read a line from a file.
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.
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
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.
int pgp_class_application_handler(struct Body *m, struct State *s)
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 *s)
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 *s, 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 *s)
Process a protected header - Implements handler_t -.
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
void mutt_decode_attachment(struct Body *b, struct State *s)
Decode an email's attachment.
int mutt_body_handler(struct Body *b, struct State *s)
Handler for the Body of an email.
Decide how to display email content.
long cs_subset_long(const struct ConfigSubset *sub, const char *name)
Get a long config item by name.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
const struct Regex * cs_subset_regex(const struct ConfigSubset *sub, const char *name)
Get a regex config item by name.
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.
struct FgetConv * mutt_ch_fgetconv_open(FILE *fp, const char *from, const char *to, uint8_t flags)
Prepare a file for charset conversion.
int mutt_ch_fgetconv(struct FgetConv *fc)
Convert a file's character set.
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_prefix_putc(struct State *s, char c)
Write a prefixed character to the state.
void state_attach_puts(struct State *s, const char *t)
Write a string to the state.
#define state_puts(STATE, STR)
#define state_set_prefix(state)
#define MUTT_VERIFY
Perform signature verification.
#define state_putc(STATE, STR)
#define MUTT_DISPLAY
Output is displayed to the user.
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.
char * mutt_str_skip_whitespace(const char *p)
Find the first non-whitespace character in a string.
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
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)
int mutt_decode_save_attachment(FILE *fp, struct Body *m, const char *path, int displaying, 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.
Handling of global boolean variables.
bool OptDontHandlePgpKeys
(pseudo) used to extract PGP keys
bool OptPgpCheckTrust
(pseudo) used by dlg_select_pgp_key()
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_fpr_or_lkeyid(struct PgpKeyInfo *k)
Get the fingerprint or long keyid.
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 *s, FILE *fp_out, struct Body *p)
Decrypt part of a PGP message.
static int pgp_check_pgp_decryption_okay_regex(FILE *fp_in)
Check PGP output to look for successful outcome.
static char * pgp_fingerprint(struct PgpKeyInfo *k)
Get the key's fingerprint.
static void pgp_copy_clearsigned(FILE *fp_in, struct State *s, char *charset)
Copy a clearsigned message, stripping the signature.
char * pgp_long_keyid(struct PgpKeyInfo *k)
Get a key's long id.
static int pgp_copy_checksig(FILE *fp_in, FILE *fp_out)
Copy PGP output and look for signs of a good signature.
char * pgp_keyid(struct PgpKeyInfo *k)
Get the ID of the main (parent) key.
char * pgp_this_keyid(struct PgpKeyInfo *k)
Get the ID of this key.
static struct PgpKeyInfo * key_parent(struct PgpKeyInfo *k)
Find a key's parent (if it's a subkey)
bool pgp_use_gpg_agent(void)
Does the user want to use the gpg agent?
char * pgp_short_keyid(struct PgpKeyInfo *k)
Get a key's short id.
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_getkeybystr(const char *cp, KeyFlags abilities, enum PgpRing keyring)
Find a PGP key by string.
struct PgpKeyInfo * pgp_getkeybyaddr(struct Address *a, KeyFlags abilities, enum PgpRing keyring, bool oppenc_mode)
Find a PGP key by address.
struct PgpKeyInfo * pgp_ask_for_key(char *tag, char *whatfor, KeyFlags abilities, enum PgpRing keyring)
Ask the user for a PGP key.
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. MUTT_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.