70 struct Envelope *prot_headers = NULL;
75 if (!c_crypt_protected_headers_read && !c_autocrypt)
78 if (!c_crypt_protected_headers_read)
118 if (c_crypt_protected_headers_read && prot_headers && prot_headers->
subject &&
134 if (c_crypt_protected_headers_save)
169 pid_t filterpid = -1;
174 char columns[16] = { 0 };
176 snprintf(columns,
sizeof(columns),
"%d", wrap_len);
216 FILE *fp_filter_out = NULL;
226 if (c_display_filter)
228 fp_filter_out = fp_out;
231 fileno(fp_filter_out), -1,
EnvList);
243 fputs(header, fp_out);
244 fputs(
"\n\n", fp_out);
268 if (fp_filter_out && (
filter_wait(filterpid) != 0))
334 keypad(stdscr,
true);
338 if ((r != -1) && c_prompt_after)
370 mutt_error(
_(
"S/MIME certificate owner does not match sender"));
374 mutt_message(
_(
"Warning: Part of this message has not been signed"));
378 mutt_error(
_(
"S/MIME signature could NOT be verified"));
387 mutt_message(
_(
"Warning: Part of this message has not been signed"));
403 if (c_pager_index_lines > 0)
406 win_index->
req_rows = c_pager_index_lines;
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 buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string 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.
const struct Expando * cs_subset_expando(const struct ConfigSubset *sub, const char *name)
Get an Expando 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.
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
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.
int mutt_make_string(struct Buffer *buf, size_t max_cols, const struct Expando *exp, struct Mailbox *m, int inpgr, struct Email *e, MuttFormatFlags flags, const char *progress)
Create formatted strings using mailbox expandos.
Structs that make up an email.
void mutt_env_set_subject(struct Envelope *env, const char *subj)
Set both subject and real_subj to subj.
#define MUTT_ENV_CHANGED_SUBJECT
Protected header update.
bool envlist_set(char ***envp, const char *name, const char *value, bool overwrite)
Set an environment variable.
bool envlist_unset(char ***envp, const char *name)
Unset an environment variable.
void mutt_file_unlink(const char *s)
Delete a file, carefully.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
void mutt_set_flag(struct Mailbox *m, struct Email *e, enum MessageType flag, bool bf, bool upd_mbox)
Set a flag on an email.
int km_dokey(enum MenuType mtype, GetChFlags flags)
Determine what a keypress should do.
bool OptNoCurses
(pseudo) when sending in batch mode
char ** EnvList
Private copy of the environment variables.
int dlg_pager(struct PagerView *pview)
Display an email, attachment, or help, in a window -.
#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_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)
#define GETCH_NO_FLAGS
No flags are set.
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, char **envlist)
Run a command on a pipe (optionally connect stdin/stdout)
Convenience wrapper for the library headers.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
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 **ptr)
Close a message.
struct Message * mx_msg_open(struct Mailbox *m, struct Email *e)
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.
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.
Prototypes for many functions.
int mutt_system(const char *cmd)
Run an external command.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
enum QuadOption query_quadoption(const char *prompt, struct ConfigSubset *sub, const char *name)
Ask the user a quad-question.
#define TAILQ_FIRST(head)
#define TAILQ_EMPTY(head)
#define MUTT_FORMAT_NO_FLAGS
No flags are set.
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.
bool changed
Email has been edited.
const struct AttrColor * attr_color
Color-pair to use when displaying in the index.
char *const subject
Email's subject.
unsigned char changed
Changed fields, e.g. MUTT_ENV_CHANGED_SUBJECT.
struct AutocryptHeader * autocrypt_gossip
Autocrypt Gossip header.
char *const 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.
struct Mailbox * mailbox
Current Mailbox.
bool changed
Mailbox has been modified.
enum MailboxType type
Mailbox type.
struct HashTable * subj_hash
Hash Table: "subject" -> Email.
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.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
@ MENU_PAGER
Pager pager (email viewer)