NeoMutt  2022-04-29-247-gc6aae8
Teaching an old dog new tricks
DOXYGEN
functions.c
Go to the documentation of this file.
1
29#include "config.h"
30#include <stdbool.h>
31#include <stdio.h>
32#include "private.h"
33#include "mutt/lib.h"
34#include "address/lib.h"
35#include "config/lib.h"
36#include "email/lib.h"
37#include "core/lib.h"
38#include "alias/lib.h"
39#include "gui/lib.h"
40#include "mutt.h"
41#include "functions.h"
42#include "lib.h"
43#include "enter/lib.h"
44#include "ncrypt/lib.h"
45#include "question/lib.h"
46#include "hook.h"
47#include "mutt_logging.h"
48#include "muttlib.h"
49#include "opcodes.h"
50#include "wdata.h"
51#ifdef MIXMASTER
52#include "mixmaster/lib.h"
53#endif
54#ifdef USE_AUTOCRYPT
55#include "autocrypt/lib.h"
56#endif
57
58#ifdef USE_AUTOCRYPT
64static void autocrypt_compose_menu(struct Email *e, const struct ConfigSubset *sub)
65{
66 /* L10N: The compose menu autocrypt prompt.
67 (e)ncrypt enables encryption via autocrypt.
68 (c)lear sets cleartext.
69 (a)utomatic defers to the recommendation. */
70 const char *prompt = _("Autocrypt: (e)ncrypt, (c)lear, (a)utomatic?");
71
73
74 /* L10N: The letter corresponding to the compose menu autocrypt prompt
75 (e)ncrypt, (c)lear, (a)utomatic */
76 const char *letters = _("eca");
77
78 int choice = mutt_multi_choice(prompt, letters);
79 switch (choice)
80 {
81 case 1:
84 break;
85 case 2:
86 e->security &= ~SEC_AUTOCRYPT;
88 break;
89 case 3:
90 {
91 e->security &= ~SEC_AUTOCRYPT_OVERRIDE;
92 const bool c_crypt_opportunistic_encrypt = cs_subset_bool(sub, "crypt_opportunistic_encrypt");
93 if (c_crypt_opportunistic_encrypt)
95 break;
96 }
97 }
98}
99#endif
100
107static bool edit_address_list(enum HeaderField field, struct AddressList *al)
108{
109 struct Buffer *old_list = mutt_buffer_pool_get();
110 struct Buffer *new_list = mutt_buffer_pool_get();
111
112 /* need to be large for alias expansion */
113 mutt_buffer_alloc(old_list, 8192);
114 mutt_buffer_alloc(new_list, 8192);
115
117 mutt_addrlist_write(al, new_list->data, new_list->dsize, false);
118 mutt_buffer_fix_dptr(new_list);
119 mutt_buffer_copy(old_list, new_list);
120 if (mutt_buffer_get_field(_(Prompts[field]), new_list, MUTT_COMP_ALIAS, false,
121 NULL, NULL, NULL) == 0)
122 {
126 }
127
128 char *err = NULL;
129 if (mutt_addrlist_to_intl(al, &err) != 0)
130 {
131 mutt_error(_("Bad IDN: '%s'"), err);
132 mutt_refresh();
133 FREE(&err);
134 }
135
136 const bool rc = !mutt_str_equal(mutt_buffer_string(new_list), mutt_buffer_string(old_list));
137 mutt_buffer_pool_release(&old_list);
138 mutt_buffer_pool_release(&new_list);
139 return rc;
140}
141
147{
148 struct Email *e = wdata->email;
149
150 const bool c_crypt_opportunistic_encrypt = cs_subset_bool(wdata->sub, "crypt_opportunistic_encrypt");
151 if (c_crypt_opportunistic_encrypt)
153
154#ifdef USE_AUTOCRYPT
155 const bool c_autocrypt = cs_subset_bool(wdata->sub, "autocrypt");
156 if (c_autocrypt)
157 {
159
160 /* Anything that enables SEC_ENCRYPT or SEC_SIGN, or turns on SMIME
161 * overrides autocrypt, be it oppenc or the user having turned on
162 * those flags manually. */
164 {
166 }
167 else
168 {
170 {
171 if (wdata->autocrypt_rec == AUTOCRYPT_REC_YES)
172 {
175 }
176 else
177 e->security &= ~SEC_AUTOCRYPT;
178 }
179 }
180 }
181#endif
182}
183
184// -----------------------------------------------------------------------------
185
189static int op_envelope_edit_bcc(struct EnvelopeWindowData *wdata, int op)
190{
191#ifdef USE_NNTP
192 if (wdata->is_news)
193 return FR_NO_ACTION;
194#endif
195 if (!edit_address_list(HDR_BCC, &wdata->email->env->bcc))
196 return FR_NO_ACTION;
197
198 update_crypt_info(wdata);
200 return FR_SUCCESS;
201}
202
206static int op_envelope_edit_cc(struct EnvelopeWindowData *wdata, int op)
207{
208#ifdef USE_NNTP
209 if (wdata->is_news)
210 return FR_NO_ACTION;
211#endif
212 if (!edit_address_list(HDR_CC, &wdata->email->env->cc))
213 return FR_NO_ACTION;
214
215 update_crypt_info(wdata);
217 return FR_SUCCESS;
218}
219
223static int op_envelope_edit_fcc(struct EnvelopeWindowData *wdata, int op)
224{
225 int rc = FR_NO_ACTION;
226 struct Buffer *fname = mutt_buffer_pool_get();
227 mutt_buffer_copy(fname, wdata->fcc);
228
230 false, NULL, NULL, NULL) != 0)
231 {
232 goto done; // aborted
233 }
234
235 if (mutt_str_equal(wdata->fcc->data, fname->data))
236 goto done; // no change
237
238 mutt_buffer_copy(wdata->fcc, fname);
241 rc = FR_SUCCESS;
242
243done:
245 return rc;
246}
247
251static int op_envelope_edit_from(struct EnvelopeWindowData *wdata, int op)
252{
253 if (!edit_address_list(HDR_FROM, &wdata->email->env->from))
254 return FR_NO_ACTION;
255
256 update_crypt_info(wdata);
258 return FR_SUCCESS;
259}
260
264static int op_envelope_edit_reply_to(struct EnvelopeWindowData *wdata, int op)
265{
267 return FR_NO_ACTION;
268
270 return FR_SUCCESS;
271}
272
276static int op_envelope_edit_subject(struct EnvelopeWindowData *wdata, int op)
277{
278 int rc = FR_NO_ACTION;
279 struct Buffer *buf = mutt_buffer_pool_get();
280
281 mutt_buffer_strcpy(buf, wdata->email->env->subject);
283 false, NULL, NULL, NULL) != 0)
284 {
285 goto done; // aborted
286 }
287
289 goto done; // no change
290
293 rc = FR_SUCCESS;
294
295done:
297 return rc;
298}
299
303static int op_envelope_edit_to(struct EnvelopeWindowData *wdata, int op)
304{
305#ifdef USE_NNTP
306 if (wdata->is_news)
307 return FR_NO_ACTION;
308#endif
309 if (!edit_address_list(HDR_TO, &wdata->email->env->to))
310 return FR_NO_ACTION;
311
312 update_crypt_info(wdata);
314 return FR_SUCCESS;
315}
316
320static int op_compose_pgp_menu(struct EnvelopeWindowData *wdata, int op)
321{
322 const SecurityFlags old_flags = wdata->email->security;
324 return FR_NOT_IMPL;
326 {
327 mutt_error(_("No PGP backend configured"));
328 return FR_ERROR;
329 }
330 if (((WithCrypto & APPLICATION_SMIME) != 0) && (wdata->email->security & APPLICATION_SMIME))
331 {
332 if (wdata->email->security & (SEC_ENCRYPT | SEC_SIGN))
333 {
334 if (mutt_yesorno(_("S/MIME already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
335 {
337 return FR_NO_ACTION;
338 }
339 wdata->email->security &= ~(SEC_ENCRYPT | SEC_SIGN);
340 }
341 wdata->email->security &= ~APPLICATION_SMIME;
342 wdata->email->security |= APPLICATION_PGP;
343 update_crypt_info(wdata);
344 }
345 wdata->email->security = crypt_pgp_send_menu(wdata->email);
346 update_crypt_info(wdata);
347 if (wdata->email->security == old_flags)
348 return FR_NO_ACTION;
349
352 return FR_SUCCESS;
353}
354
358static int op_compose_smime_menu(struct EnvelopeWindowData *wdata, int op)
359{
360 const SecurityFlags old_flags = wdata->email->security;
362 return FR_NOT_IMPL;
364 {
365 mutt_error(_("No S/MIME backend configured"));
366 return FR_ERROR;
367 }
368
369 if (((WithCrypto & APPLICATION_PGP) != 0) && (wdata->email->security & APPLICATION_PGP))
370 {
371 if (wdata->email->security & (SEC_ENCRYPT | SEC_SIGN))
372 {
373 if (mutt_yesorno(_("PGP already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
374 {
376 return FR_NO_ACTION;
377 }
378 wdata->email->security &= ~(SEC_ENCRYPT | SEC_SIGN);
379 }
380 wdata->email->security &= ~APPLICATION_PGP;
382 update_crypt_info(wdata);
383 }
384 wdata->email->security = crypt_smime_send_menu(wdata->email);
385 update_crypt_info(wdata);
386 if (wdata->email->security == old_flags)
387 return FR_NO_ACTION;
388
391 return FR_SUCCESS;
392}
393
394#ifdef USE_AUTOCRYPT
398static int op_compose_autocrypt_menu(struct EnvelopeWindowData *wdata, int op)
399{
400 const SecurityFlags old_flags = wdata->email->security;
401 const bool c_autocrypt = cs_subset_bool(wdata->sub, "autocrypt");
402 if (!c_autocrypt)
403 return FR_NO_ACTION;
404
406 {
407 if (wdata->email->security & (SEC_ENCRYPT | SEC_SIGN))
408 {
409 if (mutt_yesorno(_("S/MIME already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
410 {
412 return FR_NO_ACTION;
413 }
414 wdata->email->security &= ~(SEC_ENCRYPT | SEC_SIGN);
415 }
416 wdata->email->security &= ~APPLICATION_SMIME;
417 wdata->email->security |= APPLICATION_PGP;
418 update_crypt_info(wdata);
419 }
420 autocrypt_compose_menu(wdata->email, wdata->sub);
421 update_crypt_info(wdata);
422 if (wdata->email->security == old_flags)
423 return FR_NO_ACTION;
424
427 return FR_SUCCESS;
428}
429#endif
430
431// -----------------------------------------------------------------------------
432
433#ifdef USE_NNTP
437static int op_envelope_edit_followup_to(struct EnvelopeWindowData *wdata, int op)
438{
439 if (!wdata->is_news)
440 return FR_NO_ACTION;
441
442 int rc = FR_NO_ACTION;
443 struct Buffer *buf = mutt_buffer_pool_get();
444
447 false, NULL, NULL, NULL) == 0)
448 {
451 rc = FR_SUCCESS;
452 }
453
455 return rc;
456}
457
461static int op_envelope_edit_newsgroups(struct EnvelopeWindowData *wdata, int op)
462{
463 if (!wdata->is_news)
464 return FR_NO_ACTION;
465
466 int rc = FR_NO_ACTION;
467 struct Buffer *buf = mutt_buffer_pool_get();
468
469 mutt_buffer_strcpy(buf, wdata->email->env->newsgroups);
471 false, NULL, NULL, NULL) == 0)
472 {
475 rc = FR_SUCCESS;
476 }
477
479 return rc;
480}
481
485static int op_envelope_edit_x_comment_to(struct EnvelopeWindowData *wdata, int op)
486{
487 const bool c_x_comment_to = cs_subset_bool(wdata->sub, "x_comment_to");
488 if (!(wdata->is_news && c_x_comment_to))
489 return FR_NO_ACTION;
490
491 int rc = FR_NO_ACTION;
492 struct Buffer *buf = mutt_buffer_pool_get();
493
496 false, NULL, NULL, NULL) == 0)
497 {
500 rc = FR_SUCCESS;
501 }
502
504 return rc;
505}
506#endif
507
508#ifdef MIXMASTER
512static int op_compose_mix(struct EnvelopeWindowData *wdata, int op)
513{
514 dlg_mixmaster(&wdata->email->chain);
517 return FR_SUCCESS;
518}
519#endif
520
521// -----------------------------------------------------------------------------
522
527// clang-format off
528#ifdef USE_AUTOCRYPT
529 { OP_COMPOSE_AUTOCRYPT_MENU, op_compose_autocrypt_menu },
530#endif
531#ifdef MIXMASTER
532 { OP_COMPOSE_MIX, op_compose_mix },
533#endif
534 { OP_COMPOSE_PGP_MENU, op_compose_pgp_menu },
535 { OP_COMPOSE_SMIME_MENU, op_compose_smime_menu },
536 { OP_ENVELOPE_EDIT_BCC, op_envelope_edit_bcc },
537 { OP_ENVELOPE_EDIT_CC, op_envelope_edit_cc },
538 { OP_ENVELOPE_EDIT_FCC, op_envelope_edit_fcc },
539#ifdef USE_NNTP
540 { OP_ENVELOPE_EDIT_FOLLOWUP_TO, op_envelope_edit_followup_to },
541#endif
542 { OP_ENVELOPE_EDIT_FROM, op_envelope_edit_from },
543#ifdef USE_NNTP
544 { OP_ENVELOPE_EDIT_NEWSGROUPS, op_envelope_edit_newsgroups },
545#endif
546 { OP_ENVELOPE_EDIT_REPLY_TO, op_envelope_edit_reply_to },
547 { OP_ENVELOPE_EDIT_SUBJECT, op_envelope_edit_subject },
548 { OP_ENVELOPE_EDIT_TO, op_envelope_edit_to },
549#ifdef USE_NNTP
550 { OP_ENVELOPE_EDIT_X_COMMENT_TO, op_envelope_edit_x_comment_to },
551#endif
552 { 0, NULL },
553 // clang-format on
554};
555
560{
561 if (!win || !win->wdata)
562 return FR_UNKNOWN;
563
564 int rc = FR_UNKNOWN;
565 for (size_t i = 0; EnvelopeFunctions[i].op != OP_NULL; i++)
566 {
567 const struct EnvelopeFunction *fn = &EnvelopeFunctions[i];
568 if (fn->op == op)
569 {
570 struct EnvelopeWindowData *wdata = win->wdata;
571 rc = fn->function(wdata, op);
572 break;
573 }
574 }
575
576 if (rc == FR_UNKNOWN) // Not our function
577 return rc;
578
579 const char *result = dispacher_get_retval_name(rc);
580 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
581
582 return rc;
583}
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
Definition: address.c:1470
size_t mutt_addrlist_write(const struct AddressList *al, char *buf, size_t buflen, bool display)
Write an Address to a buffer.
Definition: address.c:1150
int mutt_addrlist_to_local(struct AddressList *al)
Convert an Address list from Punycode.
Definition: address.c:1388
int mutt_addrlist_parse2(struct AddressList *al, const char *s)
Parse a list of email addresses.
Definition: address.c:616
int mutt_addrlist_to_intl(struct AddressList *al, char **err)
Convert an Address list to Punycode.
Definition: address.c:1305
Email Address Handling.
Email Aliases.
void mutt_expand_aliases(struct AddressList *al)
Expand aliases in a List of Addresses.
Definition: alias.c:298
Autocrypt end-to-end encryption.
@ AUTOCRYPT_REC_YES
Autocrypt should be used.
Definition: lib.h:162
enum AutocryptRec mutt_autocrypt_ui_recommendation(const struct Email *e, char **keylist)
Get the recommended action for an Email.
Definition: autocrypt.c:567
void mutt_buffer_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
Definition: buffer.c:275
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:327
void mutt_buffer_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
Definition: buffer.c:189
size_t mutt_buffer_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
Definition: buffer.c:462
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:77
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:73
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
void crypt_opportunistic_encrypt(struct Email *e)
Can all recipients be determined.
Definition: crypt.c:1025
bool crypt_has_module_backend(SecurityFlags type)
Is there a crypto backend for a given type?
Definition: cryptglue.c:171
SecurityFlags crypt_smime_send_menu(struct Email *e)
Wrapper for CryptModuleSpecs::send_menu()
Definition: cryptglue.c:528
SecurityFlags crypt_pgp_send_menu(struct Email *e)
Wrapper for CryptModuleSpecs::send_menu()
Definition: cryptglue.c:384
void mutt_refresh(void)
Force a refresh of the screen.
Definition: curs_lib.c:140
const char * dispacher_get_retval_name(int rv)
Get the name of a return value.
Definition: dispatcher.c:54
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
@ FR_UNKNOWN
Unknown function.
Definition: dispatcher.h:33
@ FR_ERROR
Valid function - error occurred.
Definition: dispatcher.h:38
@ FR_NOT_IMPL
Invalid function - feature not enabled.
Definition: dispatcher.h:36
@ FR_NO_ACTION
Valid function - no action performed.
Definition: dispatcher.h:37
void dlg_mixmaster(struct ListHead *chainhead)
Create a Mixmaster chain.
Structs that make up an email.
@ NT_EMAIL_CHANGE
Email has changed.
Definition: email.h:151
Enter a string.
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.
Definition: window.c:180
static bool edit_address_list(enum HeaderField field, struct AddressList *al)
Let the user edit the address list.
Definition: functions.c:107
struct EnvelopeFunction EnvelopeFunctions[]
All the NeoMutt functions that the Envelope supports.
Definition: functions.c:526
static void autocrypt_compose_menu(struct Email *e, const struct ConfigSubset *sub)
Autocrypt compose settings.
Definition: functions.c:64
void update_crypt_info(struct EnvelopeWindowData *wdata)
Update the crypto info.
Definition: functions.c:146
const char *const Prompts[]
Definition: window.c:89
HeaderField
Ordered list of headers for the compose screen.
Definition: private.h:34
@ HDR_SUBJECT
"Subject:" field
Definition: private.h:39
@ HDR_REPLYTO
"Reply-To:" field
Definition: private.h:40
@ HDR_FCC
"Fcc:" (save folder) field
Definition: private.h:41
@ HDR_CC
"Cc:" field
Definition: private.h:37
@ HDR_TO
"To:" field
Definition: private.h:36
@ HDR_BCC
"Bcc:" field
Definition: private.h:38
@ HDR_FOLLOWUPTO
"Followup-To:" field
Definition: private.h:52
@ HDR_XCOMMENTTO
"X-Comment-To:" field
Definition: private.h:53
@ HDR_NEWSGROUPS
"Newsgroups:" field
Definition: private.h:51
@ HDR_FROM
"From:" field
Definition: private.h:35
bool mutt_env_notify_send(struct Email *e, enum NotifyEnvelope type)
Send an Envelope change notification.
Definition: envelope.c:152
@ NT_ENVELOPE_SUBJECT
"Subject:" header has changed
Definition: envelope.h:113
@ NT_ENVELOPE_BCC
"Bcc:" header has changed
Definition: envelope.h:105
@ NT_ENVELOPE_TO
"To:" header has changed
Definition: envelope.h:114
@ NT_ENVELOPE_FCC
"Fcc:" header has changed
Definition: envelope.h:107
@ NT_ENVELOPE_CC
"Cc:" header has changed
Definition: envelope.h:106
@ NT_ENVELOPE_MIXMASTER
MixMaster chain has changed.
Definition: envelope.h:110
@ NT_ENVELOPE_REPLY_TO
"Reply-To:" header has changed
Definition: envelope.h:112
@ NT_ENVELOPE_FROM
"From:" header has changed
Definition: envelope.h:109
@ NT_ENVELOPE_X_COMMENT_TO
"X-Comment-To:" header has changed
Definition: envelope.h:115
@ NT_ENVELOPE_FOLLOWUP_TO
"Followup-To:" header has changed
Definition: envelope.h:108
@ NT_ENVELOPE_NEWSGROUPS
"Newsgroups:" header has changed
Definition: envelope.h:111
int env_function_dispatcher(struct MuttWindow *win, int op)
Perform an Envelope function - Implements function_dispatcher_t -.
Definition: functions.c:559
static int op_envelope_edit_bcc(struct EnvelopeWindowData *wdata, int op)
Edit the BCC list - Implements envelope_function_t -.
Definition: functions.c:189
static int op_envelope_edit_subject(struct EnvelopeWindowData *wdata, int op)
Edit the subject of this message - Implements envelope_function_t -.
Definition: functions.c:276
static int op_envelope_edit_to(struct EnvelopeWindowData *wdata, int op)
Edit the TO list - Implements envelope_function_t -.
Definition: functions.c:303
static int op_envelope_edit_followup_to(struct EnvelopeWindowData *wdata, int op)
Edit the Followup-To field - Implements envelope_function_t -.
Definition: functions.c:437
static int op_compose_pgp_menu(struct EnvelopeWindowData *wdata, int op)
Show PGP options - Implements envelope_function_t -.
Definition: functions.c:320
static int op_compose_autocrypt_menu(struct EnvelopeWindowData *wdata, int op)
Show autocrypt compose menu options - Implements envelope_function_t -.
Definition: functions.c:398
static int op_compose_mix(struct EnvelopeWindowData *wdata, int op)
Send the message through a mixmaster remailer chain - Implements envelope_function_t -.
Definition: functions.c:512
static int op_envelope_edit_from(struct EnvelopeWindowData *wdata, int op)
Edit the from field - Implements envelope_function_t -.
Definition: functions.c:251
static int op_envelope_edit_reply_to(struct EnvelopeWindowData *wdata, int op)
Edit the Reply-To field - Implements envelope_function_t -.
Definition: functions.c:264
static int op_envelope_edit_x_comment_to(struct EnvelopeWindowData *wdata, int op)
Edit the X-Comment-To field - Implements envelope_function_t -.
Definition: functions.c:485
static int op_envelope_edit_fcc(struct EnvelopeWindowData *wdata, int op)
Enter a file to save a copy of this message in - Implements envelope_function_t -.
Definition: functions.c:223
static int op_envelope_edit_cc(struct EnvelopeWindowData *wdata, int op)
Edit the CC list - Implements envelope_function_t -.
Definition: functions.c:206
static int op_envelope_edit_newsgroups(struct EnvelopeWindowData *wdata, int op)
Edit the newsgroups list - Implements envelope_function_t -.
Definition: functions.c:461
static int op_compose_smime_menu(struct EnvelopeWindowData *wdata, int op)
Show S/MIME options - Implements envelope_function_t -.
Definition: functions.c:358
#define mutt_error(...)
Definition: logging.h:87
#define mutt_debug(LEVEL,...)
Definition: logging.h:84
Convenience wrapper for the gui headers.
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Definition: hook.c:658
Parse and execute user-defined hooks.
#define MUTT_SEND2_HOOK
send2-hook: when changing fields in the compose menu
Definition: hook.h:49
@ LL_DEBUG1
Log at debug level 1.
Definition: logging.h:40
#define FREE(x)
Definition: memory.h:43
Support of Mixmaster anonymous remailer.
Convenience wrapper for the library headers.
#define _(a)
Definition: message.h:28
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:171
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:807
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:326
Many unsorted constants and some structs.
#define MUTT_COMP_ALIAS
Alias completion (in alias dialog)
Definition: mutt.h:53
#define MUTT_COMP_FILE
File completion (in browser)
Definition: mutt.h:55
#define MUTT_COMP_NO_FLAGS
No flags are set.
Definition: mutt.h:52
#define MUTT_COMP_CLEAR
Clear input if printable character is pressed.
Definition: mutt.h:62
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:74
NeoMutt Logging.
void mutt_buffer_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
Definition: muttlib.c:599
Some miscellaneous functions.
API for encryption/signing of emails.
#define SEC_INLINE
Email has an inline signature.
Definition: lib.h:85
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
Definition: lib.h:87
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:76
#define SEC_OPPENCRYPT
Opportunistic encrypt mode.
Definition: lib.h:86
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:90
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: lib.h:91
#define SEC_ENCRYPT
Email is encrypted.
Definition: lib.h:78
#define WithCrypto
Definition: lib.h:116
#define SEC_AUTOCRYPT_OVERRIDE
(Autocrypt) Indicates manual set/unset of encryption
Definition: lib.h:88
#define SEC_SIGN
Email is signed.
Definition: lib.h:79
@ NT_EMAIL
Email has changed, NotifyEmail, EventEmail.
Definition: notify_type.h:44
const char * opcodes_get_name(int op)
Get the name of an opcode.
Definition: opcodes.c:46
All user-callable functions.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
Definition: pool.c:112
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:101
Progress Bar Window Data.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition: quad.h:39
Ask the user a question.
enum QuadOption mutt_yesorno(const char *msg, enum QuadOption def)
Ask the user a Yes/No question.
Definition: question.c:194
int mutt_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question.
Definition: question.c:54
Sidebar functions.
GUI display the mailboxes in a side panel.
Key value store.
#define NONULL(x)
Definition: string2.h:37
String manipulation buffer.
Definition: buffer.h:34
size_t dsize
Length of data.
Definition: buffer.h:37
char * data
Pointer to data.
Definition: buffer.h:35
A set of inherited config items.
Definition: subset.h:47
The envelope/body of an email.
Definition: email.h:37
struct Envelope * env
Envelope information.
Definition: email.h:66
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Definition: email.h:41
struct ListHead chain
Mixmaster chain.
Definition: email.h:90
struct Notify * notify
Notifications: NotifyEmail, EventEmail.
Definition: email.h:71
A NeoMutt Envelope function.
Definition: functions.h:45
int op
Op code, e.g. OP_ENVELOPE_EDIT_FROM.
Definition: functions.h:46
envelope_function_t function
Function to call.
Definition: functions.h:47
Data to fill the Envelope Window.
Definition: wdata.h:39
bool is_news
Email is a news article.
Definition: wdata.h:54
struct Buffer * fcc
Where the outgoing Email will be saved.
Definition: wdata.h:42
struct Email * email
Email being composed.
Definition: wdata.h:41
struct ConfigSubset * sub
Inherited config items.
Definition: wdata.h:40
enum AutocryptRec autocrypt_rec
Autocrypt recommendation.
Definition: wdata.h:57
struct AddressList to
Email's 'To' list.
Definition: envelope.h:60
char * followup_to
List of 'followup-to' fields.
Definition: envelope.h:81
struct AddressList reply_to
Email's 'reply-to'.
Definition: envelope.h:64
char * x_comment_to
List of 'X-comment-to' fields.
Definition: envelope.h:82
char * newsgroups
List of newsgroups.
Definition: envelope.h:79
struct AddressList cc
Email's 'Cc' list.
Definition: envelope.h:61
char * subject
Email's subject.
Definition: envelope.h:70
struct AddressList bcc
Email's 'Bcc' list.
Definition: envelope.h:62
struct AddressList from
Email's 'From' list.
Definition: envelope.h:59
void * wdata
Private data.
Definition: mutt_window.h:145