NeoMutt  2023-11-03-107-g582dc1
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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 "browser/lib.h"
44#include "editor/lib.h"
45#include "history/lib.h"
46#include "ncrypt/lib.h"
47#include "question/lib.h"
48#include "hook.h"
49#include "mutt_logging.h"
50#include "muttlib.h"
51#include "wdata.h"
52#ifdef MIXMASTER
53#include "mixmaster/lib.h"
54#endif
55#ifdef USE_AUTOCRYPT
56#include "autocrypt/lib.h"
57#endif
58
59#ifdef USE_AUTOCRYPT
65static void autocrypt_compose_menu(struct Email *e, const struct ConfigSubset *sub)
66{
67 /* L10N: The compose menu autocrypt prompt.
68 (e)ncrypt enables encryption via autocrypt.
69 (c)lear sets cleartext.
70 (a)utomatic defers to the recommendation. */
71 const char *prompt = _("Autocrypt: (e)ncrypt, (c)lear, (a)utomatic?");
72
74
75 /* L10N: The letter corresponding to the compose menu autocrypt prompt
76 (e)ncrypt, (c)lear, (a)utomatic */
77 const char *letters = _("eca");
78
79 int choice = mw_multi_choice(prompt, letters);
80 switch (choice)
81 {
82 case 1:
85 break;
86 case 2:
87 e->security &= ~SEC_AUTOCRYPT;
89 break;
90 case 3:
91 {
92 e->security &= ~SEC_AUTOCRYPT_OVERRIDE;
93 const bool c_crypt_opportunistic_encrypt = cs_subset_bool(sub, "crypt_opportunistic_encrypt");
94 if (c_crypt_opportunistic_encrypt)
96 break;
97 }
98 }
99}
100#endif
101
108static bool edit_address_list(enum HeaderField field, struct AddressList *al)
109{
110 struct Buffer *old_list = buf_pool_get();
111 struct Buffer *new_list = buf_pool_get();
112
113 /* need to be large for alias expansion */
114 buf_alloc(old_list, 8192);
115 buf_alloc(new_list, 8192);
116
118 mutt_addrlist_write(al, new_list, false);
119 buf_fix_dptr(new_list);
120 buf_copy(old_list, new_list);
121 if (mw_get_field(_(Prompts[field]), new_list, MUTT_COMP_NO_FLAGS, HC_ALIAS,
122 &CompleteAliasOps, NULL) == 0)
123 {
125 mutt_addrlist_parse2(al, buf_string(new_list));
127 }
128
129 char *err = NULL;
130 if (mutt_addrlist_to_intl(al, &err) != 0)
131 {
132 mutt_error(_("Bad IDN: '%s'"), err);
133 mutt_refresh();
134 FREE(&err);
135 }
136
137 const bool rc = !mutt_str_equal(buf_string(new_list), buf_string(old_list));
138 buf_pool_release(&old_list);
139 buf_pool_release(&new_list);
140 return rc;
141}
142
148{
149 struct Email *e = wdata->email;
150
151 const bool c_crypt_opportunistic_encrypt = cs_subset_bool(wdata->sub, "crypt_opportunistic_encrypt");
152 if (c_crypt_opportunistic_encrypt)
154
155#ifdef USE_AUTOCRYPT
156 const bool c_autocrypt = cs_subset_bool(wdata->sub, "autocrypt");
157 if (c_autocrypt)
158 {
160
161 /* Anything that enables SEC_ENCRYPT or SEC_SIGN, or turns on SMIME
162 * overrides autocrypt, be it oppenc or the user having turned on
163 * those flags manually. */
165 {
167 }
168 else
169 {
171 {
172 if (wdata->autocrypt_rec == AUTOCRYPT_REC_YES)
173 {
176 }
177 else
178 {
179 e->security &= ~SEC_AUTOCRYPT;
180 }
181 }
182 }
183 }
184#endif
185}
186
187// -----------------------------------------------------------------------------
188
192static int op_envelope_edit_bcc(struct EnvelopeWindowData *wdata, int op)
193{
194 if (wdata->is_news)
195 return FR_NO_ACTION;
196 if (!edit_address_list(HDR_BCC, &wdata->email->env->bcc))
197 return FR_NO_ACTION;
198
199 update_crypt_info(wdata);
201 return FR_SUCCESS;
202}
203
207static int op_envelope_edit_cc(struct EnvelopeWindowData *wdata, int op)
208{
209 if (wdata->is_news)
210 return FR_NO_ACTION;
211 if (!edit_address_list(HDR_CC, &wdata->email->env->cc))
212 return FR_NO_ACTION;
213
214 update_crypt_info(wdata);
216 return FR_SUCCESS;
217}
218
222static int op_envelope_edit_fcc(struct EnvelopeWindowData *wdata, int op)
223{
224 int rc = FR_NO_ACTION;
225 struct Buffer *fname = buf_pool_get();
226 buf_copy(fname, wdata->fcc);
227
228 struct FileCompletionData cdata = { false, NULL, NULL, NULL };
230 &CompleteMailboxOps, &cdata) != 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 buf_copy(wdata->fcc, fname);
239 buf_pretty_mailbox(wdata->fcc);
241 rc = FR_SUCCESS;
242
243done:
244 buf_pool_release(&fname);
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 = buf_pool_get();
280
281 buf_strcpy(buf, wdata->email->env->subject);
282 if (mw_get_field(Prompts[HDR_SUBJECT], buf, MUTT_COMP_NO_FLAGS, HC_OTHER, NULL, NULL) != 0)
283 {
284 goto done; // aborted
285 }
286
287 if (mutt_str_equal(wdata->email->env->subject, buf_string(buf)))
288 goto done; // no change
289
292 rc = FR_SUCCESS;
293
294done:
295 buf_pool_release(&buf);
296 return rc;
297}
298
302static int op_envelope_edit_to(struct EnvelopeWindowData *wdata, int op)
303{
304 if (wdata->is_news)
305 return FR_NO_ACTION;
306 if (!edit_address_list(HDR_TO, &wdata->email->env->to))
307 return FR_NO_ACTION;
308
309 update_crypt_info(wdata);
311 return FR_SUCCESS;
312}
313
317static int op_compose_pgp_menu(struct EnvelopeWindowData *wdata, int op)
318{
319 const SecurityFlags old_flags = wdata->email->security;
321 return FR_NOT_IMPL;
323 {
324 mutt_error(_("No PGP backend configured"));
325 return FR_ERROR;
326 }
327 if (((WithCrypto & APPLICATION_SMIME) != 0) && (wdata->email->security & APPLICATION_SMIME))
328 {
329 if (wdata->email->security & (SEC_ENCRYPT | SEC_SIGN))
330 {
331 if (query_yesorno(_("S/MIME already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
332 {
334 return FR_NO_ACTION;
335 }
336 wdata->email->security &= ~(SEC_ENCRYPT | SEC_SIGN);
337 }
338 wdata->email->security &= ~APPLICATION_SMIME;
339 wdata->email->security |= APPLICATION_PGP;
340 update_crypt_info(wdata);
341 }
342 wdata->email->security = crypt_pgp_send_menu(wdata->email);
343 update_crypt_info(wdata);
344 if (wdata->email->security == old_flags)
345 return FR_NO_ACTION;
346
349 return FR_SUCCESS;
350}
351
355static int op_compose_smime_menu(struct EnvelopeWindowData *wdata, int op)
356{
357 const SecurityFlags old_flags = wdata->email->security;
359 return FR_NOT_IMPL;
361 {
362 mutt_error(_("No S/MIME backend configured"));
363 return FR_ERROR;
364 }
365
366 if (((WithCrypto & APPLICATION_PGP) != 0) && (wdata->email->security & APPLICATION_PGP))
367 {
368 if (wdata->email->security & (SEC_ENCRYPT | SEC_SIGN))
369 {
370 if (query_yesorno(_("PGP already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
371 {
373 return FR_NO_ACTION;
374 }
375 wdata->email->security &= ~(SEC_ENCRYPT | SEC_SIGN);
376 }
377 wdata->email->security &= ~APPLICATION_PGP;
379 update_crypt_info(wdata);
380 }
381 wdata->email->security = crypt_smime_send_menu(wdata->email);
382 update_crypt_info(wdata);
383 if (wdata->email->security == old_flags)
384 return FR_NO_ACTION;
385
388 return FR_SUCCESS;
389}
390
391#ifdef USE_AUTOCRYPT
395static int op_compose_autocrypt_menu(struct EnvelopeWindowData *wdata, int op)
396{
397 const SecurityFlags old_flags = wdata->email->security;
398 const bool c_autocrypt = cs_subset_bool(wdata->sub, "autocrypt");
399 if (!c_autocrypt)
400 return FR_NO_ACTION;
401
403 {
404 if (wdata->email->security & (SEC_ENCRYPT | SEC_SIGN))
405 {
406 if (query_yesorno(_("S/MIME already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
407 {
409 return FR_NO_ACTION;
410 }
411 wdata->email->security &= ~(SEC_ENCRYPT | SEC_SIGN);
412 }
413 wdata->email->security &= ~APPLICATION_SMIME;
414 wdata->email->security |= APPLICATION_PGP;
415 update_crypt_info(wdata);
416 }
417 autocrypt_compose_menu(wdata->email, wdata->sub);
418 update_crypt_info(wdata);
419 if (wdata->email->security == old_flags)
420 return FR_NO_ACTION;
421
424 return FR_SUCCESS;
425}
426#endif
427
428// -----------------------------------------------------------------------------
429
433static int op_envelope_edit_followup_to(struct EnvelopeWindowData *wdata, int op)
434{
435 if (!wdata->is_news)
436 return FR_NO_ACTION;
437
438 int rc = FR_NO_ACTION;
439 struct Buffer *buf = buf_pool_get();
440
441 buf_strcpy(buf, wdata->email->env->followup_to);
442 if (mw_get_field(Prompts[HDR_FOLLOWUPTO], buf, MUTT_COMP_NO_FLAGS, HC_OTHER, NULL, NULL) == 0)
443 {
446 rc = FR_SUCCESS;
447 }
448
449 buf_pool_release(&buf);
450 return rc;
451}
452
456static int op_envelope_edit_newsgroups(struct EnvelopeWindowData *wdata, int op)
457{
458 if (!wdata->is_news)
459 return FR_NO_ACTION;
460
461 int rc = FR_NO_ACTION;
462 struct Buffer *buf = buf_pool_get();
463
464 buf_strcpy(buf, wdata->email->env->newsgroups);
465 if (mw_get_field(Prompts[HDR_NEWSGROUPS], buf, MUTT_COMP_NO_FLAGS, HC_OTHER, NULL, NULL) == 0)
466 {
469 rc = FR_SUCCESS;
470 }
471
472 buf_pool_release(&buf);
473 return rc;
474}
475
479static int op_envelope_edit_x_comment_to(struct EnvelopeWindowData *wdata, int op)
480{
481 const bool c_x_comment_to = cs_subset_bool(wdata->sub, "x_comment_to");
482 if (!(wdata->is_news && c_x_comment_to))
483 return FR_NO_ACTION;
484
485 int rc = FR_NO_ACTION;
486 struct Buffer *buf = buf_pool_get();
487
488 buf_strcpy(buf, wdata->email->env->x_comment_to);
489 if (mw_get_field(Prompts[HDR_XCOMMENTTO], buf, MUTT_COMP_NO_FLAGS, HC_OTHER, NULL, NULL) == 0)
490 {
493 rc = FR_SUCCESS;
494 }
495
496 buf_pool_release(&buf);
497 return rc;
498}
499
500#ifdef MIXMASTER
504static int op_compose_mix(struct EnvelopeWindowData *wdata, int op)
505{
506 dlg_mixmaster(&wdata->email->chain);
509 return FR_SUCCESS;
510}
511#endif
512
513// -----------------------------------------------------------------------------
514
518static const struct EnvelopeFunction EnvelopeFunctions[] = {
519// clang-format off
520#ifdef USE_AUTOCRYPT
521 { OP_COMPOSE_AUTOCRYPT_MENU, op_compose_autocrypt_menu },
522#endif
523#ifdef MIXMASTER
524 { OP_COMPOSE_MIX, op_compose_mix },
525#endif
526 { OP_COMPOSE_PGP_MENU, op_compose_pgp_menu },
527 { OP_COMPOSE_SMIME_MENU, op_compose_smime_menu },
528 { OP_ENVELOPE_EDIT_BCC, op_envelope_edit_bcc },
529 { OP_ENVELOPE_EDIT_CC, op_envelope_edit_cc },
530 { OP_ENVELOPE_EDIT_FCC, op_envelope_edit_fcc },
531 { OP_ENVELOPE_EDIT_FOLLOWUP_TO, op_envelope_edit_followup_to },
532 { OP_ENVELOPE_EDIT_FROM, op_envelope_edit_from },
533 { OP_ENVELOPE_EDIT_NEWSGROUPS, op_envelope_edit_newsgroups },
534 { OP_ENVELOPE_EDIT_REPLY_TO, op_envelope_edit_reply_to },
535 { OP_ENVELOPE_EDIT_SUBJECT, op_envelope_edit_subject },
536 { OP_ENVELOPE_EDIT_TO, op_envelope_edit_to },
537 { OP_ENVELOPE_EDIT_X_COMMENT_TO, op_envelope_edit_x_comment_to },
538 { 0, NULL },
539 // clang-format on
540};
541
546{
547 if (!win || !win->wdata)
548 return FR_UNKNOWN;
549
550 int rc = FR_UNKNOWN;
551 for (size_t i = 0; EnvelopeFunctions[i].op != OP_NULL; i++)
552 {
553 const struct EnvelopeFunction *fn = &EnvelopeFunctions[i];
554 if (fn->op == op)
555 {
556 struct EnvelopeWindowData *wdata = win->wdata;
557 rc = fn->function(wdata, op);
558 break;
559 }
560 }
561
562 if (rc == FR_UNKNOWN) // Not our function
563 return rc;
564
565 const char *result = dispatcher_get_retval_name(rc);
566 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
567
568 return rc;
569}
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
Definition: address.c:1461
int mutt_addrlist_to_local(struct AddressList *al)
Convert an Address list from Punycode.
Definition: address.c:1379
size_t mutt_addrlist_write(const struct AddressList *al, struct Buffer *buf, bool display)
Write an Address to a buffer.
Definition: address.c:1207
int mutt_addrlist_parse2(struct AddressList *al, const char *s)
Parse a list of email addresses.
Definition: address.c:641
int mutt_addrlist_to_intl(struct AddressList *al, char **err)
Convert an Address list to Punycode.
Definition: address.c:1294
Email Address Handling.
const struct CompleteOps CompleteAliasOps
Auto-Completion of Aliases.
Definition: complete.c:108
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:557
const struct CompleteOps CompleteMailboxOps
Auto-Completion of Files / Mailboxes.
Definition: complete.c:160
Select a Mailbox from a list.
void buf_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
Definition: buffer.c:194
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:407
size_t buf_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
Definition: buffer.c:572
void buf_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
Definition: buffer.c:349
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:93
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:48
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:1034
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:75
const char * dispatcher_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
Edit a string.
Structs that make up an email.
@ NT_EMAIL_CHANGE
Email has changed.
Definition: email.h:152
static const struct EnvelopeFunction EnvelopeFunctions[]
All the NeoMutt functions that the Envelope supports.
Definition: functions.c:518
static bool edit_address_list(enum HeaderField field, struct AddressList *al)
Let the user edit the address list.
Definition: functions.c:108
static void autocrypt_compose_menu(struct Email *e, const struct ConfigSubset *sub)
Autocrypt compose settings.
Definition: functions.c:65
void update_crypt_info(struct EnvelopeWindowData *wdata)
Update the crypto info.
Definition: functions.c:147
const char *const Prompts[]
Names of header fields used in the envelope, e.g. From:, To:
Definition: window.c:92
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:51
@ HDR_XCOMMENTTO
"X-Comment-To:" field
Definition: private.h:52
@ HDR_NEWSGROUPS
"Newsgroups:" field
Definition: private.h:50
@ 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:150
@ NT_ENVELOPE_SUBJECT
"Subject:" header has changed
Definition: envelope.h:111
@ NT_ENVELOPE_BCC
"Bcc:" header has changed
Definition: envelope.h:103
@ NT_ENVELOPE_TO
"To:" header has changed
Definition: envelope.h:112
@ NT_ENVELOPE_FCC
"Fcc:" header has changed
Definition: envelope.h:105
@ NT_ENVELOPE_CC
"Cc:" header has changed
Definition: envelope.h:104
@ NT_ENVELOPE_MIXMASTER
MixMaster chain has changed.
Definition: envelope.h:108
@ NT_ENVELOPE_REPLY_TO
"Reply-To:" header has changed
Definition: envelope.h:110
@ NT_ENVELOPE_FROM
"From:" header has changed
Definition: envelope.h:107
@ NT_ENVELOPE_X_COMMENT_TO
"X-Comment-To:" header has changed
Definition: envelope.h:113
@ NT_ENVELOPE_FOLLOWUP_TO
"Followup-To:" header has changed
Definition: envelope.h:106
@ NT_ENVELOPE_NEWSGROUPS
"Newsgroups:" header has changed
Definition: envelope.h:109
int env_function_dispatcher(struct MuttWindow *win, int op)
Perform an Envelope function - Implements function_dispatcher_t -.
Definition: functions.c:545
static int op_envelope_edit_bcc(struct EnvelopeWindowData *wdata, int op)
Edit the BCC list - Implements envelope_function_t -.
Definition: functions.c:192
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:302
static int op_envelope_edit_followup_to(struct EnvelopeWindowData *wdata, int op)
Edit the Followup-To field - Implements envelope_function_t -.
Definition: functions.c:433
static int op_compose_pgp_menu(struct EnvelopeWindowData *wdata, int op)
Show PGP options - Implements envelope_function_t -.
Definition: functions.c:317
static int op_compose_autocrypt_menu(struct EnvelopeWindowData *wdata, int op)
Show autocrypt compose menu options - Implements envelope_function_t -.
Definition: functions.c:395
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:504
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:479
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:222
static int op_envelope_edit_cc(struct EnvelopeWindowData *wdata, int op)
Edit the CC list - Implements envelope_function_t -.
Definition: functions.c:207
static int op_envelope_edit_newsgroups(struct EnvelopeWindowData *wdata, int op)
Edit the newsgroups list - Implements envelope_function_t -.
Definition: functions.c:456
static int op_compose_smime_menu(struct EnvelopeWindowData *wdata, int op)
Show S/MIME options - Implements envelope_function_t -.
Definition: functions.c:355
void dlg_mixmaster(struct ListHead *chainhead)
Create a Mixmaster chain -.
int mw_get_field(const char *prompt, struct Buffer *buf, CompletionFlags complete, enum HistoryClass hclass, const struct CompleteOps *comp_api, void *cdata)
Ask the user for a string -.
Definition: window.c:275
int mw_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question -.
Definition: question.c:60
#define mutt_error(...)
Definition: logging2.h:92
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
Convenience wrapper for the gui headers.
Read/write command history from/to a file.
@ HC_FILE
Files.
Definition: lib.h:54
@ HC_ALIAS
Aliases.
Definition: lib.h:52
@ HC_OTHER
Miscellaneous strings.
Definition: lib.h:56
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Definition: hook.c:666
Parse and execute user-defined hooks.
#define MUTT_SEND2_HOOK
send2-hook: when changing fields in the compose menu
Definition: hook.h:48
@ LL_DEBUG1
Log at debug level 1.
Definition: logging2.h:43
#define FREE(x)
Definition: memory.h:45
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:173
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:763
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:327
Many unsorted constants and some structs.
#define MUTT_COMP_NO_FLAGS
No flags are set.
Definition: mutt.h:55
#define MUTT_COMP_CLEAR
Clear input if printable character is pressed.
Definition: mutt.h:56
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:73
NeoMutt Logging.
void buf_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
Definition: muttlib.c:556
Some miscellaneous functions.
API for encryption/signing of emails.
#define SEC_INLINE
Email has an inline signature.
Definition: lib.h:86
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
Definition: lib.h:88
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:77
#define SEC_OPPENCRYPT
Opportunistic encrypt mode.
Definition: lib.h:87
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:91
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: lib.h:92
#define SEC_ENCRYPT
Email is encrypted.
Definition: lib.h:79
#define WithCrypto
Definition: lib.h:117
#define SEC_AUTOCRYPT_OVERRIDE
(Autocrypt) Indicates manual set/unset of encryption
Definition: lib.h:89
#define SEC_SIGN
Email is signed.
Definition: lib.h:80
@ 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:48
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:81
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:94
Progress Bar Window Data.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition: quad.h:39
Ask the user a question.
enum QuadOption query_yesorno(const char *prompt, enum QuadOption def)
Ask the user a Yes/No question.
Definition: question.c:330
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
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:91
struct Notify * notify
Notifications: NotifyEmail, EventEmail.
Definition: email.h:71
A NeoMutt Envelope function.
Definition: functions.h:44
int op
Op code, e.g. OP_ENVELOPE_EDIT_FROM.
Definition: functions.h:45
envelope_function_t function
Function to call.
Definition: functions.h:46
Data to fill the Envelope Window.
Definition: wdata.h:38
bool is_news
Email is a news article.
Definition: wdata.h:48
struct Buffer * fcc
Where the outgoing Email will be saved.
Definition: wdata.h:41
struct Email * email
Email being composed.
Definition: wdata.h:40
struct ConfigSubset * sub
Inherited config items.
Definition: wdata.h:39
enum AutocryptRec autocrypt_rec
Autocrypt recommendation.
Definition: wdata.h:50
struct AddressList to
Email's 'To' list.
Definition: envelope.h:60
char * followup_to
List of 'followup-to' fields.
Definition: envelope.h:80
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:81
char * newsgroups
List of newsgroups.
Definition: envelope.h:78
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
Input for the file completion function.
Definition: curs_lib.h:39
void * wdata
Private data.
Definition: mutt_window.h:145