NeoMutt  2025-12-11-177-g48e272
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
message.c
Go to the documentation of this file.
1
23
29
30#include "config.h"
31#include <errno.h>
32#include <stdbool.h>
33#include <stdio.h>
34#include <sys/types.h>
35#include <unistd.h>
36#include "mutt/lib.h"
37#include "config/lib.h"
38#include "email/lib.h"
39#include "core/lib.h"
40#include "gui/lib.h"
41#include "mutt.h"
42#include "lib.h"
43#include "attach/lib.h"
44#include "expando/lib.h"
45#include "index/lib.h"
46#include "key/lib.h"
47#include "menu/lib.h"
48#include "ncrypt/lib.h"
49#include "question/lib.h"
50#include "globals.h"
51#include "mx.h"
52#ifdef USE_AUTOCRYPT
53#include "autocrypt/lib.h"
54#endif
55
57static const char *ExtPagerProgress = N_("all");
58
64static void process_protected_headers(struct Mailbox *m, struct Email *e)
65{
66 struct Envelope *prot_headers = NULL;
67
68 const bool c_crypt_protected_headers_read = cs_subset_bool(NeoMutt->sub, "crypt_protected_headers_read");
69#ifdef USE_AUTOCRYPT
70 const bool c_autocrypt = cs_subset_bool(NeoMutt->sub, "autocrypt");
71 if (!c_crypt_protected_headers_read && !c_autocrypt)
72 return;
73#else
74 if (!c_crypt_protected_headers_read)
75 return;
76#endif
77
78 /* Grab protected headers to update in the index */
79 if (e->security & SEC_SIGN)
80 {
81 /* Don't update on a bad signature.
82 *
83 * This is a simplification. It's possible the headers are in the
84 * encrypted part of a nested encrypt/signed. But properly handling that
85 * case would require more complexity in the decryption handlers, which
86 * I'm not sure is worth it. */
87 if (!(e->security & SEC_GOODSIGN))
88 return;
89
91 {
92 prot_headers = e->body->parts->mime_headers;
93 }
95 {
96 prot_headers = e->body->mime_headers;
97 }
98 }
99 if (!prot_headers && (e->security & SEC_ENCRYPT))
100 {
101 if (((WithCrypto & APPLICATION_PGP) != 0) &&
104 {
105 prot_headers = e->body->mime_headers;
106 }
108 {
109 prot_headers = e->body->mime_headers;
110 }
111 }
112
113 /* Update protected headers in the index and header cache. */
114 if (c_crypt_protected_headers_read && prot_headers && prot_headers->subject &&
115 !mutt_str_equal(e->env->subject, prot_headers->subject))
116 {
117 if (m->subj_hash && e->env->real_subj)
119
120 mutt_env_set_subject(e->env, prot_headers->subject);
121 FREE(&e->env->disp_subj);
122
123 if (m->subj_hash)
125
126 mx_save_hcache(m, e);
127
128 /* Also persist back to the message headers if this is set */
129 const bool c_crypt_protected_headers_save = cs_subset_bool(NeoMutt->sub, "crypt_protected_headers_save");
130 if (c_crypt_protected_headers_save)
131 {
133 e->changed = true;
134 m->changed = true;
135 }
136 }
137
138#ifdef USE_AUTOCRYPT
139 if (c_autocrypt && (e->security & SEC_ENCRYPT) && prot_headers && prot_headers->autocrypt_gossip)
140 {
142 }
143#endif
144}
145
160static int email_to_file(struct Message *msg, struct Buffer *tempfile,
161 struct Mailbox *m, struct Email *e, const char *header,
162 int wrap_len, CopyMessageFlags *cmflags)
163{
164 int rc = 0;
165 pid_t filterpid = -1;
166
168
169 char columns[16] = { 0 };
170 // win_pager might not be visible and have a size yet, so use win_index
171 snprintf(columns, sizeof(columns), "%d", wrap_len);
172 envlist_set(&NeoMutt->env, "COLUMNS", columns, true);
173
174 /* see if crypto is needed for this message. if so, we should exit curses */
175 if ((WithCrypto != 0) && e->security)
176 {
177 if (e->security & SEC_ENCRYPT)
178 {
182 goto cleanup;
183
184 *cmflags |= MUTT_CM_VERIFY;
185 }
186 else if (e->security & SEC_SIGN)
187 {
188 /* find out whether or not the verify signature */
189 /* L10N: Used for the $crypt_verify_sig prompt */
190 if (query_quadoption(_("Verify signature?"), NeoMutt->sub, "crypt_verify_sig") == MUTT_YES)
191 {
192 *cmflags |= MUTT_CM_VERIFY;
193 }
194 }
195 }
196
197 if (*cmflags & MUTT_CM_VERIFY || e->security & SEC_ENCRYPT)
198 {
199 if (e->security & APPLICATION_PGP)
200 {
201 if (!TAILQ_EMPTY(&e->env->from))
203
205 }
206
209 }
210
211 FILE *fp_filter_out = NULL;
212 buf_mktemp(tempfile);
213 FILE *fp_out = mutt_file_fopen(buf_string(tempfile), "w");
214 if (!fp_out)
215 {
216 mutt_error(_("Could not create temporary file"));
217 goto cleanup;
218 }
219
220 const char *const c_display_filter = cs_subset_string(NeoMutt->sub, "display_filter");
221 if (c_display_filter)
222 {
223 fp_filter_out = fp_out;
224 fp_out = NULL;
225 filterpid = filter_create_fd(c_display_filter, &fp_out, NULL, NULL, -1,
226 fileno(fp_filter_out), -1, NeoMutt->env);
227 if (filterpid < 0)
228 {
229 mutt_error(_("Can't create display filter"));
230 mutt_file_fclose(&fp_filter_out);
231 unlink(buf_string(tempfile));
232 goto cleanup;
233 }
234 }
235
236 if (header)
237 {
238 fputs(header, fp_out);
239 fputs("\n\n", fp_out);
240 }
241
242 const bool c_weed = cs_subset_bool(NeoMutt->sub, "weed");
243 CopyHeaderFlags chflags = (c_weed ? (CH_WEED | CH_REORDER) : CH_NO_FLAGS) |
245#ifdef USE_NOTMUCH
246 if (m->type == MUTT_NOTMUCH)
247 chflags |= CH_VIRTUAL;
248#endif
249 rc = mutt_copy_message(fp_out, e, msg, *cmflags, chflags, wrap_len);
250
251 if (((mutt_file_fclose(&fp_out) != 0) && (errno != EPIPE)) || (rc < 0))
252 {
253 mutt_error(_("Could not copy message"));
254 if (fp_filter_out)
255 {
256 filter_wait(filterpid);
257 mutt_file_fclose(&fp_filter_out);
258 }
259 mutt_file_unlink(buf_string(tempfile));
260 goto cleanup;
261 }
262
263 if (fp_filter_out && (filter_wait(filterpid) != 0))
265
266 mutt_file_fclose(&fp_filter_out); /* XXX - check result? */
267
268 if (WithCrypto)
269 {
270 /* update crypto information for this message */
272 e->security |= crypt_query(e->body);
273
274 /* Remove color cache for this message, in case there
275 * are color patterns for both ~g and ~V */
276 e->attr_color = NULL;
277
278 /* Process protected headers and autocrypt gossip headers */
280 }
281
282cleanup:
283 envlist_unset(&NeoMutt->env, "COLUMNS");
284 return rc;
285}
286
295int external_pager(struct MailboxView *mv, struct Email *e, const char *command)
296{
297 if (!mv || !mv->mailbox)
298 return -1;
299
300 struct Mailbox *m = mv->mailbox;
301 struct Message *msg = mx_msg_open(m, e);
302 if (!msg)
303 return -1;
304
305 struct Buffer *buf = buf_pool_get();
306 const struct Expando *c_pager_format = cs_subset_expando(NeoMutt->sub, "pager_format");
307 const int screen_width = RootWindow->state.cols;
308 mutt_make_string(buf, screen_width, c_pager_format, m, -1, e,
310
311 struct Buffer *tempfile = buf_pool_get();
312
314 int rc = email_to_file(msg, tempfile, m, e, buf_string(buf), screen_width, &cmflags);
315 if (rc < 0)
316 goto cleanup;
317
318 mutt_endwin();
319
320 struct Buffer *cmd = buf_pool_get();
321 buf_printf(cmd, "%s %s", command, buf_string(tempfile));
322 int r = mutt_system(buf_string(cmd));
323 if (r == -1)
324 mutt_error(_("Error running \"%s\""), buf_string(cmd));
325 unlink(buf_string(tempfile));
326 buf_pool_release(&cmd);
327
328 if (OptGui)
329 keypad(stdscr, true);
330 if (r != -1)
331 mutt_set_flag(m, e, MUTT_READ, true, true);
332 const bool c_prompt_after = cs_subset_bool(NeoMutt->sub, "prompt_after");
333 if ((r != -1) && c_prompt_after)
334 {
337 rc = event.op;
338 }
339 else
340 {
341 rc = 0;
342 }
343
344cleanup:
345 buf_pool_release(&buf);
346 mx_msg_close(m, &msg);
347 buf_pool_release(&tempfile);
348 return rc;
349}
350
357static void notify_crypto(struct Email *e, struct Message *msg, CopyMessageFlags cmflags)
358{
359 if ((WithCrypto != 0) && (e->security & APPLICATION_SMIME) && (cmflags & MUTT_CM_VERIFY))
360 {
361 if (e->security & SEC_GOODSIGN)
362 {
363 if (crypt_smime_verify_sender(e, msg) == 0)
364 mutt_message(_("S/MIME signature successfully verified"));
365 else
366 mutt_error(_("S/MIME certificate owner does not match sender"));
367 }
368 else if (e->security & SEC_PARTSIGN)
369 {
370 mutt_message(_("Warning: Part of this message has not been signed"));
371 }
372 else if (e->security & SEC_SIGN || e->security & SEC_BADSIGN)
373 {
374 mutt_error(_("S/MIME signature could NOT be verified"));
375 }
376 }
377
378 if ((WithCrypto != 0) && (e->security & APPLICATION_PGP) && (cmflags & MUTT_CM_VERIFY))
379 {
380 if (e->security & SEC_GOODSIGN)
381 mutt_message(_("PGP signature successfully verified"));
382 else if (e->security & SEC_PARTSIGN)
383 mutt_message(_("Warning: Part of this message has not been signed"));
384 else if (e->security & SEC_SIGN)
385 mutt_message(_("PGP signature could NOT be verified"));
386 }
387}
388
395static void squash_index_panel(struct Mailbox *m, struct MuttWindow *win_index,
396 struct MuttWindow *win_pager)
397{
398 const short c_pager_index_lines = cs_subset_number(NeoMutt->sub, "pager_index_lines");
399 if (c_pager_index_lines > 0)
400 {
401 win_index->size = MUTT_WIN_SIZE_FIXED;
402 win_index->req_rows = c_pager_index_lines;
403 win_index->parent->size = MUTT_WIN_SIZE_MINIMISE;
404 }
405 window_set_visible(win_index->parent, (c_pager_index_lines > 0));
406
407 window_set_visible(win_pager->parent, true);
408
409 struct MuttWindow *dlg = dialog_find(win_index);
411
412 // Force the menu to reframe itself
413 struct Menu *menu = win_index->wdata;
414 menu_set_index(menu, menu_get_index(menu));
415}
416
422static void expand_index_panel(struct MuttWindow *win_index, struct MuttWindow *win_pager)
423{
424 win_index->size = MUTT_WIN_SIZE_MAXIMISE;
426 win_index->parent->size = MUTT_WIN_SIZE_MAXIMISE;
428 window_set_visible(win_index->parent, true);
429
430 window_set_visible(win_pager->parent, false);
431
432 struct MuttWindow *dlg = dialog_find(win_index);
434}
435
443int mutt_display_message(struct MuttWindow *win_index, struct IndexSharedData *shared)
444{
445 struct MuttWindow *dlg = dialog_find(win_index);
446 struct MuttWindow *win_pager = window_find_child(dlg, WT_CUSTOM);
447 struct MuttWindow *win_pbar = window_find_child(dlg, WT_STATUS_BAR);
448 struct Buffer *tempfile = buf_pool_get();
449 struct Message *msg = NULL;
450
451 squash_index_panel(shared->mailbox, win_index, win_pager);
452
453 int rc = PAGER_LOOP_QUIT;
454 do
455 {
456 msg = mx_msg_open(shared->mailbox, shared->email);
457 if (!msg)
458 break;
459
461
462 buf_reset(tempfile);
463 // win_pager might not be visible and have a size yet, so use win_index
464 rc = email_to_file(msg, tempfile, shared->mailbox, shared->email, NULL,
465 win_index->state.cols, &cmflags);
466 if (rc < 0)
467 break;
468
469 notify_crypto(shared->email, msg, cmflags);
470
471 /* Invoke the built-in pager */
472 struct PagerData pdata = { 0 };
473 struct PagerView pview = { &pdata };
474
475 pdata.fp = msg->fp;
476 pdata.fname = buf_string(tempfile);
477
478 pview.mode = PAGER_MODE_EMAIL;
479 pview.banner = NULL;
480 pview.flags = MUTT_PAGER_MESSAGE |
481 (shared->email->body->nowrap ? MUTT_PAGER_NOWRAP : 0);
482 pview.win_index = win_index;
483 pview.win_pbar = win_pbar;
484 pview.win_pager = win_pager;
485
486 rc = dlg_pager(&pview);
487 mx_msg_close(shared->mailbox, &msg);
488 } while (rc == PAGER_LOOP_RELOAD);
489
491
492 mx_msg_close(shared->mailbox, &msg);
493 buf_pool_release(&tempfile);
494 return rc;
495}
void mutt_parse_mime_message(struct Email *e, FILE *fp)
Parse a MIME email.
Definition commands.c:630
GUI display the mailboxes in a side panel.
Autocrypt end-to-end encryption.
int mutt_autocrypt_process_gossip_header(struct Email *e, struct Envelope *prot_headers)
Parse an Autocrypt email gossip header.
Definition autocrypt.c:404
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition buffer.c:161
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition buffer.c:76
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition helpers.c:291
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
Definition helpers.c:143
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
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.
Definition copy_email.c:916
#define CH_DECODE
Do RFC2047 header decoding.
Definition copy_email.h:56
#define MUTT_CM_VERIFY
Do signature verification.
Definition copy_email.h:49
#define CH_FROM
Retain the "From " message separator?
Definition copy_email.h:58
#define MUTT_CM_DECODE
Decode the message body into text/plain.
Definition copy_email.h:40
#define CH_WEED
Weed the headers?
Definition copy_email.h:55
#define CH_REORDER
Re-order output of headers (specified by 'header-order')
Definition copy_email.h:61
#define MUTT_CM_CHARCONV
Perform character set conversions.
Definition copy_email.h:44
#define CH_DISPLAY
Display result to user.
Definition copy_email.h:72
uint32_t CopyHeaderFlags
Flags for mutt_copy_header(), e.g. CH_UPDATE.
Definition copy_email.h:52
uint16_t CopyMessageFlags
Flags for mutt_copy_message(), e.g. MUTT_CM_NOHEADER.
Definition copy_email.h:36
#define CH_VIRTUAL
Write virtual header lines too.
Definition copy_email.h:75
#define CH_NO_FLAGS
No flags are set.
Definition copy_email.h:53
#define MUTT_CM_DISPLAY
Output is displayed to the user.
Definition copy_email.h:41
Convenience wrapper for the core headers.
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition mailbox.h:51
SecurityFlags mutt_is_multipart_signed(struct Body *b)
Is a message signed?
Definition crypt.c:408
SecurityFlags mutt_is_application_smime(struct Body *b)
Does the message use S/MIME?
Definition crypt.c:609
bool crypt_valid_passphrase(SecurityFlags flags)
Check that we have a usable passphrase, ask if not.
Definition crypt.c:131
int mutt_is_valid_multipart_pgp_encrypted(struct Body *b)
Is this a valid multi-part encrypted message?
Definition crypt.c:467
SecurityFlags mutt_is_malformed_multipart_pgp_encrypted(struct Body *b)
Check for malformed layout.
Definition crypt.c:504
SecurityFlags crypt_query(struct Body *b)
Check out the type of encryption used.
Definition crypt.c:687
void crypt_invoke_message(SecurityFlags type)
Display an informative message.
Definition cryptglue.c:156
void crypt_smime_getkeys(struct Envelope *env)
Wrapper for CryptModuleSpecs::smime_getkeys()
Definition cryptglue.c:454
void crypt_pgp_invoke_getkeys(struct Address *addr)
Wrapper for CryptModuleSpecs::pgp_invoke_getkeys()
Definition cryptglue.c:273
int crypt_smime_verify_sender(struct Email *e, struct Message *msg)
Wrapper for CryptModuleSpecs::smime_verify_sender()
Definition cryptglue.c:463
int mutt_any_key_to_continue(const char *s)
Prompt the user to 'press any key' and wait.
Definition curs_lib.c:173
void mutt_endwin(void)
Shutdown curses.
Definition curs_lib.c:151
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition dialog.c:89
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.
Definition dlg_index.c:800
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.
Definition envelope.c:68
#define MUTT_ENV_CHANGED_SUBJECT
Protected header update.
Definition envelope.h:37
bool envlist_set(char ***envp, const char *name, const char *value, bool overwrite)
Set an environment variable.
Definition envlist.c:88
bool envlist_unset(char ***envp, const char *name)
Unset an environment variable.
Definition envlist.c:136
Parse Expando string.
void mutt_file_unlink(const char *s)
Delete a file, carefully.
Definition file.c:160
#define mutt_file_fclose(FP)
Definition file.h:139
#define mutt_file_fopen(PATH, MODE)
Definition file.h:138
void mutt_set_flag(struct Mailbox *m, struct Email *e, enum MessageType flag, bool bf, bool upd_mbox)
Set a flag on an email.
Definition flags.c:54
struct KeyEvent km_dokey(enum MenuType mtype, GetChFlags flags)
Determine what a keypress should do.
Definition get.c:431
void mutt_unget_ch(int ch)
Return a keystroke to the input buffer.
Definition get.c:122
#define GETCH_NO_FLAGS
No flags are set.
Definition get.h:34
bool OptGui
(pseudo) when the gui (and curses) are started
Definition globals.c:59
Global variables.
int dlg_pager(struct PagerView *pview)
Display an email, attachment, or help, in a window -.
Definition dlg_pager.c:216
#define mutt_error(...)
Definition logging2.h:94
#define mutt_message(...)
Definition logging2.h:93
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)
Definition hash.c:336
void mutt_hash_delete(struct HashTable *table, const char *strkey, const void *data)
Remove an element from a Hash Table.
Definition hash.c:428
GUI manage the main index (list of emails)
Manage keymappings.
#define FREE(x)
Definition memory.h:63
GUI present the user with a selectable list.
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:162
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition menu.c:176
int filter_wait(pid_t pid)
Wait for the exit of a process and return its status.
Definition filter.c:220
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)
Definition filter.c:62
Convenience wrapper for the library headers.
#define N_(a)
Definition message.h:32
#define _(a)
Definition message.h:28
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition string.c:662
Many unsorted constants and some structs.
int mutt_system(const char *cmd)
Run an external command.
Definition system.c:51
@ MUTT_READ
Messages that have been read.
Definition mutt.h:92
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.
Definition mutt_window.h:95
@ WT_STATUS_BAR
Status Bar containing extra info about the Index/Pager/etc.
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition mutt_window.h:53
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
Definition mutt_window.h:48
@ MUTT_WIN_SIZE_MINIMISE
Window size depends on its children.
Definition mutt_window.h:50
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
Definition mutt_window.h:49
int mx_msg_close(struct Mailbox *m, struct Message **ptr)
Close a message.
Definition mx.c:1182
struct Message * mx_msg_open(struct Mailbox *m, struct Email *e)
Return a stream pointer for a message.
Definition mx.c:1136
int mx_save_hcache(struct Mailbox *m, struct Email *e)
Save message to the header cache - Wrapper for MxOps::msg_save_hcache()
Definition mx.c:1797
API for mailboxes.
API for encryption/signing of emails.
#define SEC_GOODSIGN
Email has a valid signature.
Definition lib.h:88
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition lib.h:98
#define SEC_BADSIGN
Email has a bad signature.
Definition lib.h:89
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition lib.h:99
#define SEC_PARTSIGN
Not all parts of the email is signed.
Definition lib.h:90
#define SEC_ENCRYPT
Email is encrypted.
Definition lib.h:86
#define WithCrypto
Definition lib.h:124
#define SEC_SIGN
Email is signed.
Definition lib.h:87
GUI display a file/email/help in a viewport with paging.
@ PAGER_LOOP_RELOAD
Reload the Pager from scratch.
Definition lib.h:154
@ PAGER_LOOP_QUIT
Quit the Pager.
Definition lib.h:153
#define MUTT_PAGER_NOWRAP
Format for term width, ignore $wrap.
Definition lib.h:73
@ PAGER_MODE_EMAIL
Pager is invoked via 1st path. The mime part is selected automatically.
Definition lib.h:138
#define MUTT_PAGER_MESSAGE
Definition lib.h:77
static int email_to_file(struct Message *msg, struct Buffer *tempfile, struct Mailbox *m, struct Email *e, const char *header, int wrap_len, CopyMessageFlags *cmflags)
Decrypt, decode and weed an Email into a file.
Definition message.c:160
static void expand_index_panel(struct MuttWindow *win_index, struct MuttWindow *win_pager)
Restore the Index Panel.
Definition message.c:422
static const char * ExtPagerProgress
Status bar message when entire message is visible in the Pager.
Definition message.c:57
static void process_protected_headers(struct Mailbox *m, struct Email *e)
Get the protected header and update the index.
Definition message.c:64
int mutt_display_message(struct MuttWindow *win_index, struct IndexSharedData *shared)
Display a message in the pager.
Definition message.c:443
static void notify_crypto(struct Email *e, struct Message *msg, CopyMessageFlags cmflags)
Notify the user about the crypto status of the Email.
Definition message.c:357
static void squash_index_panel(struct Mailbox *m, struct MuttWindow *win_index, struct MuttWindow *win_pager)
Shrink or hide the Index Panel.
Definition message.c:395
int external_pager(struct MailboxView *mv, struct Email *e, const char *command)
Display a message in an external program.
Definition message.c:295
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:82
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:96
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition quad.h:39
Ask the user a question.
enum QuadOption query_quadoption(const char *prompt, struct ConfigSubset *sub, const char *name)
Ask the user a quad-question.
Definition question.c:378
#define TAILQ_FIRST(head)
Definition queue.h:780
#define TAILQ_EMPTY(head)
Definition queue.h:778
#define MUTT_FORMAT_NO_FLAGS
No flags are set.
Definition render.h:33
struct MuttWindow * RootWindow
Parent of all Windows.
Definition rootwin.c:106
struct Body * parts
parts of a multipart or message/rfc822
Definition body.h:73
struct Envelope * mime_headers
Memory hole protected headers.
Definition body.h:76
bool nowrap
Do not wrap the output in the pager.
Definition body.h:89
String manipulation buffer.
Definition buffer.h:36
The envelope/body of an email.
Definition email.h:39
struct Envelope * env
Envelope information.
Definition email.h:68
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Definition email.h:43
struct Body * body
List of MIME parts.
Definition email.h:69
bool changed
Email has been edited.
Definition email.h:77
const struct AttrColor * attr_color
Color-pair to use when displaying in the index.
Definition email.h:112
The header of an Email.
Definition envelope.h:57
char *const subject
Email's subject.
Definition envelope.h:70
unsigned char changed
Changed fields, e.g. MUTT_ENV_CHANGED_SUBJECT.
Definition envelope.h:90
struct AutocryptHeader * autocrypt_gossip
Autocrypt Gossip header.
Definition envelope.h:88
char *const real_subj
Offset of the real subject.
Definition envelope.h:71
char * disp_subj
Display subject (modified copy of subject)
Definition envelope.h:72
struct AddressList from
Email's 'From' list.
Definition envelope.h:59
Parsed Expando trees.
Definition expando.h:41
Data shared between Index, Pager and Sidebar.
Definition shared_data.h:37
struct Email * email
Currently selected Email.
Definition shared_data.h:42
struct Mailbox * mailbox
Current Mailbox.
Definition shared_data.h:41
An event such as a keypress.
Definition get.h:50
View of a Mailbox.
Definition mview.h:40
struct Mailbox * mailbox
Current Mailbox.
Definition mview.h:51
A mailbox.
Definition mailbox.h:79
bool changed
Mailbox has been modified.
Definition mailbox.h:110
enum MailboxType type
Mailbox type.
Definition mailbox.h:102
struct HashTable * subj_hash
Hash Table: "subject" -> Email.
Definition mailbox.h:124
Definition lib.h:80
A local copy of an email.
Definition message.h:34
FILE * fp
pointer to the message data
Definition message.h:35
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.
Definition neomutt.h:128
char ** env
Private copy of the environment variables.
Definition neomutt.h:143
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:134
Data to be displayed by PagerView.
Definition lib.h:161
const char * fname
Name of the file to read.
Definition lib.h:165
FILE * fp
Source stream.
Definition lib.h:163
Paged view into some data.
Definition lib.h:172
struct MuttWindow * win_index
Index Window.
Definition lib.h:178
struct PagerData * pdata
Data that pager displays. NOTNULL.
Definition lib.h:173
enum PagerMode mode
Pager mode.
Definition lib.h:174
PagerFlags flags
Additional settings to tweak pager's function.
Definition lib.h:175
const char * banner
Title to display in status bar.
Definition lib.h:176
struct MuttWindow * win_pbar
Pager Bar Window.
Definition lib.h:179
struct MuttWindow * win_pager
Pager Window.
Definition lib.h:180
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition mutt_window.h:61
#define buf_mktemp(buf)
Definition tmp.h:33
@ MENU_PAGER
Pager pager (email viewer)
Definition type.h:45