67 struct Envelope *prot_headers = NULL;
73 if (!c_crypt_protected_headers_read && !c_autocrypt)
76 if (!c_crypt_protected_headers_read)
116 if (c_crypt_protected_headers_read && prot_headers && prot_headers->
subject &&
143 if (c_crypt_protected_headers_save)
178 pid_t filterpid = -1;
183 char columns[16] = { 0 };
185 snprintf(columns,
sizeof(columns),
"%d", wrap_len);
226 FILE *fp_filter_out = NULL;
236 if (c_display_filter)
238 fp_filter_out = fp_out;
241 fileno(fp_filter_out), -1);
253 fputs(header, fp_out);
254 fputs(
"\n\n", fp_out);
278 if (fp_filter_out && (
filter_wait(filterpid) != 0))
316 char buf[1024] = { 0 };
325 int rc =
email_to_file(msg, tempfile, m, e, buf, screen_width, &cmflags);
340 keypad(stdscr,
true);
344 if ((r != -1) && c_prompt_after)
375 mutt_error(
_(
"S/MIME certificate owner does not match sender"));
378 mutt_message(
_(
"Warning: Part of this message has not been signed"));
380 mutt_error(
_(
"S/MIME signature could NOT be verified"));
388 mutt_message(
_(
"Warning: Part of this message has not been signed"));
405 const int index_space =
MIN(c_pager_index_lines, m->
vcount);
GUI display the mailboxes in a side panel.
void mutt_parse_mime_message(struct Email *e, FILE *fp)
Parse a MIME email.
Autocrypt end-to-end encryption.
int mutt_autocrypt_process_gossip_header(struct Email *e, struct Envelope *prot_headers)
Parse an Autocrypt email gossip header.
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
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.
enum QuadOption cs_subset_quad(const struct ConfigSubset *sub, const char *name)
Get a quad-value config item by name.
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number 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.
int mutt_copy_message(FILE *fp_out, struct Email *e, struct Message *msg, CopyMessageFlags cmflags, CopyHeaderFlags chflags, int wraplen)
Copy a message from a Mailbox.
Duplicate the structure of an entire email.
#define CH_DECODE
Do RFC2047 header decoding.
#define MUTT_CM_VERIFY
Do signature verification.
#define CH_FROM
Retain the "From " message separator?
#define MUTT_CM_DECODE
Decode the message body into text/plain.
#define CH_WEED
Weed the headers?
#define CH_REORDER
Re-order output of headers (specified by 'hdr_order')
#define MUTT_CM_CHARCONV
Perform character set conversions.
#define CH_DISPLAY
Display result to user.
uint32_t CopyHeaderFlags
Flags for mutt_copy_header(), e.g. CH_UPDATE.
uint16_t CopyMessageFlags
Flags for mutt_copy_message(), e.g. MUTT_CM_NOHEADER.
#define CH_VIRTUAL
Write virtual header lines too.
#define CH_NO_FLAGS
No flags are set.
#define MUTT_CM_DISPLAY
Output is displayed to the user.
Convenience wrapper for the core headers.
SecurityFlags mutt_is_multipart_signed(struct Body *b)
Is a message signed?
SecurityFlags mutt_is_application_smime(struct Body *b)
Does the message use S/MIME?
bool crypt_valid_passphrase(SecurityFlags flags)
Check that we have a usable passphrase, ask if not.
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.
SecurityFlags crypt_query(struct Body *b)
Check out the type of encryption used.
void crypt_invoke_message(SecurityFlags type)
Display an informative message.
void crypt_smime_getkeys(struct Envelope *env)
Wrapper for CryptModuleSpecs::smime_getkeys()
void crypt_pgp_invoke_getkeys(struct Address *addr)
Wrapper for CryptModuleSpecs::pgp_invoke_getkeys()
int crypt_smime_verify_sender(struct Email *e, struct Message *msg)
Wrapper for CryptModuleSpecs::smime_verify_sender()
int mutt_any_key_to_continue(const char *s)
Prompt the user to 'press any key' and wait.
void mutt_endwin(void)
Shutdown curses.
void mutt_unget_ch(int ch)
Return a keystroke to the input buffer.
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Structs that make up an email.
#define MUTT_ENV_CHANGED_SUBJECT
Protected header update.
bool mutt_envlist_unset(const char *name)
Unset an environment variable.
bool mutt_envlist_set(const char *name, const char *value, bool overwrite)
Set an environment variable.
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
void mutt_file_unlink(const char *s)
Delete a file, carefully.
int filter_wait(pid_t pid)
Wait for the exit of a process and return its status.
pid_t filter_create_fd(const char *cmd, FILE **fp_in, FILE **fp_out, FILE **fp_err, int fdin, int fdout, int fderr)
Run a command on a pipe (optionally connect stdin/stdout)
bool OptNoCurses
(pseudo) when sending in batch mode
#define mutt_message(...)
Convenience wrapper for the gui headers.
struct HashElem * mutt_hash_insert(struct HashTable *table, const char *strkey, void *data)
Add a new element to the Hash Table (with string keys)
void mutt_hash_delete(struct HashTable *table, const char *strkey, const void *data)
Remove an element from a Hash Table.
void mutt_make_string(char *buf, size_t buflen, int cols, const char *s, struct Mailbox *m, int inpgr, struct Email *e, MuttFormatFlags flags, const char *progress)
Create formatted strings using mailbox expandos.
String processing routines to generate the mail index.
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Parse and execute user-defined hooks.
#define MUTT_MESSAGE_HOOK
message-hook: run before displaying a message
GUI manage the main index (list of emails)
int km_dokey(enum MenuType mtype)
Determine what a keypress should do.
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Convenience wrapper for the library headers.
bool mutt_regex_capture(const struct Regex *regex, const char *str, size_t nmatch, regmatch_t matches[])
Match a regex against a string, with provided options.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Many unsorted constants and some structs.
@ MUTT_READ
Messages that have been read.
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
void window_set_visible(struct MuttWindow *win, bool visible)
Set a Window visible or hidden.
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
@ WT_CUSTOM
Window with a custom drawing function.
@ WT_STATUS_BAR
Status Bar containing extra info about the Index/Pager/etc.
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
@ MUTT_WIN_SIZE_MINIMISE
Window size depends on its children.
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
int mx_msg_close(struct Mailbox *m, struct Message **msg)
Close a message.
struct Message * mx_msg_open(struct Mailbox *m, int msgno)
Return a stream pointer for a message.
int mx_save_hcache(struct Mailbox *m, struct Email *e)
Save message to the header cache - Wrapper for MxOps::msg_save_hcache()
API for encryption/signing of emails.
#define SEC_GOODSIGN
Email has a valid signature.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define SEC_BADSIGN
Email has a bad signature.
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
#define SEC_PARTSIGN
Not all parts of the email is signed.
#define SEC_ENCRYPT
Email is encrypted.
#define SEC_SIGN
Email is signed.
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.
Prototypes for many functions.
#define mutt_set_flag(m, e, flag, bf)
int mutt_system(const char *cmd)
Run an external command.
QuadOption
Possible values for a quad-option.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt)
Ask the user a quad-question.
#define TAILQ_FIRST(head)
#define TAILQ_EMPTY(head)
struct MuttWindow * RootWindow
Parent of all Windows.
struct Body * parts
parts of a multipart or message/rfc822
struct Envelope * mime_headers
Memory hole protected headers.
bool nowrap
Do not wrap the output in the pager.
String manipulation buffer.
The envelope/body of an email.
struct Envelope * env
Envelope information.
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
struct Body * body
List of MIME parts.
struct AttrColor * attr_color
Color-pair to use when displaying in the index.
bool changed
Email has been edited.
int msgno
Number displayed to the user.
unsigned char changed
Changed fields, e.g. MUTT_ENV_CHANGED_SUBJECT.
struct AutocryptHeader * autocrypt_gossip
Autocrypt Gossip header.
char * subject
Email's subject.
char * real_subj
Offset of the real subject.
char * disp_subj
Display subject (modified copy of subject)
struct AddressList from
Email's 'From' list.
Data shared between Index, Pager and Sidebar.
struct Email * email
Currently selected Email.
struct Mailbox * mailbox
Current Mailbox.
int vcount
The number of virtual messages.
bool changed
Mailbox has been modified.
enum MailboxType type
Mailbox type.
struct HashTable * subj_hash
Hash Table by subject.
A local copy of an email.
FILE * fp
pointer to the message data
struct WindowState state
Current state of the Window.
void * wdata
Private data.
short req_rows
Number of rows required.
struct MuttWindow * parent
Parent Window.
enum MuttWindowSize size
Type of Window, e.g. MUTT_WIN_SIZE_FIXED.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Cached regular expression.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
#define mutt_buffer_mktemp(buf)
@ MENU_PAGER
Pager pager (email viewer)