NeoMutt  2023-05-17-56-ga67199
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 = buf_pool_get();
110 struct Buffer *new_list = buf_pool_get();
111
112 /* need to be large for alias expansion */
113 buf_alloc(old_list, 8192);
114 buf_alloc(new_list, 8192);
115
117 mutt_addrlist_write(al, new_list, false);
118 buf_fix_dptr(new_list);
119 buf_copy(old_list, new_list);
120 if (buf_get_field(_(Prompts[field]), new_list, MUTT_COMP_ALIAS, false, NULL, NULL, NULL) == 0)
121 {
123 mutt_addrlist_parse2(al, buf_string(new_list));
125 }
126
127 char *err = NULL;
128 if (mutt_addrlist_to_intl(al, &err) != 0)
129 {
130 mutt_error(_("Bad IDN: '%s'"), err);
131 mutt_refresh();
132 FREE(&err);
133 }
134
135 const bool rc = !mutt_str_equal(buf_string(new_list), buf_string(old_list));
136 buf_pool_release(&old_list);
137 buf_pool_release(&new_list);
138 return rc;
139}
140
146{
147 struct Email *e = wdata->email;
148
149 const bool c_crypt_opportunistic_encrypt = cs_subset_bool(wdata->sub, "crypt_opportunistic_encrypt");
150 if (c_crypt_opportunistic_encrypt)
152
153#ifdef USE_AUTOCRYPT
154 const bool c_autocrypt = cs_subset_bool(wdata->sub, "autocrypt");
155 if (c_autocrypt)
156 {
158
159 /* Anything that enables SEC_ENCRYPT or SEC_SIGN, or turns on SMIME
160 * overrides autocrypt, be it oppenc or the user having turned on
161 * those flags manually. */
163 {
165 }
166 else
167 {
169 {
170 if (wdata->autocrypt_rec == AUTOCRYPT_REC_YES)
171 {
174 }
175 else
176 {
177 e->security &= ~SEC_AUTOCRYPT;
178 }
179 }
180 }
181 }
182#endif
183}
184
185// -----------------------------------------------------------------------------
186
190static int op_envelope_edit_bcc(struct EnvelopeWindowData *wdata, int op)
191{
192#ifdef USE_NNTP
193 if (wdata->is_news)
194 return FR_NO_ACTION;
195#endif
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#ifdef USE_NNTP
210 if (wdata->is_news)
211 return FR_NO_ACTION;
212#endif
213 if (!edit_address_list(HDR_CC, &wdata->email->env->cc))
214 return FR_NO_ACTION;
215
216 update_crypt_info(wdata);
218 return FR_SUCCESS;
219}
220
224static int op_envelope_edit_fcc(struct EnvelopeWindowData *wdata, int op)
225{
226 int rc = FR_NO_ACTION;
227 struct Buffer *fname = buf_pool_get();
228 buf_copy(fname, wdata->fcc);
229
231 false, NULL, NULL, NULL) != 0)
232 {
233 goto done; // aborted
234 }
235
236 if (mutt_str_equal(wdata->fcc->data, fname->data))
237 goto done; // no change
238
239 buf_copy(wdata->fcc, fname);
240 buf_pretty_mailbox(wdata->fcc);
242 rc = FR_SUCCESS;
243
244done:
245 buf_pool_release(&fname);
246 return rc;
247}
248
252static int op_envelope_edit_from(struct EnvelopeWindowData *wdata, int op)
253{
254 if (!edit_address_list(HDR_FROM, &wdata->email->env->from))
255 return FR_NO_ACTION;
256
257 update_crypt_info(wdata);
259 return FR_SUCCESS;
260}
261
265static int op_envelope_edit_reply_to(struct EnvelopeWindowData *wdata, int op)
266{
268 return FR_NO_ACTION;
269
271 return FR_SUCCESS;
272}
273
277static int op_envelope_edit_subject(struct EnvelopeWindowData *wdata, int op)
278{
279 int rc = FR_NO_ACTION;
280 struct Buffer *buf = buf_pool_get();
281
282 buf_strcpy(buf, wdata->email->env->subject);
283 if (buf_get_field(Prompts[HDR_SUBJECT], buf, MUTT_COMP_NO_FLAGS, false, NULL,
284 NULL, NULL) != 0)
285 {
286 goto done; // aborted
287 }
288
289 if (mutt_str_equal(wdata->email->env->subject, buf_string(buf)))
290 goto done; // no change
291
294 rc = FR_SUCCESS;
295
296done:
297 buf_pool_release(&buf);
298 return rc;
299}
300
304static int op_envelope_edit_to(struct EnvelopeWindowData *wdata, int op)
305{
306#ifdef USE_NNTP
307 if (wdata->is_news)
308 return FR_NO_ACTION;
309#endif
310 if (!edit_address_list(HDR_TO, &wdata->email->env->to))
311 return FR_NO_ACTION;
312
313 update_crypt_info(wdata);
315 return FR_SUCCESS;
316}
317
321static int op_compose_pgp_menu(struct EnvelopeWindowData *wdata, int op)
322{
323 const SecurityFlags old_flags = wdata->email->security;
325 return FR_NOT_IMPL;
327 {
328 mutt_error(_("No PGP backend configured"));
329 return FR_ERROR;
330 }
331 if (((WithCrypto & APPLICATION_SMIME) != 0) && (wdata->email->security & APPLICATION_SMIME))
332 {
333 if (wdata->email->security & (SEC_ENCRYPT | SEC_SIGN))
334 {
335 if (mutt_yesorno(_("S/MIME already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
336 {
338 return FR_NO_ACTION;
339 }
340 wdata->email->security &= ~(SEC_ENCRYPT | SEC_SIGN);
341 }
342 wdata->email->security &= ~APPLICATION_SMIME;
343 wdata->email->security |= APPLICATION_PGP;
344 update_crypt_info(wdata);
345 }
346 wdata->email->security = crypt_pgp_send_menu(wdata->email);
347 update_crypt_info(wdata);
348 if (wdata->email->security == old_flags)
349 return FR_NO_ACTION;
350
353 return FR_SUCCESS;
354}
355
359static int op_compose_smime_menu(struct EnvelopeWindowData *wdata, int op)
360{
361 const SecurityFlags old_flags = wdata->email->security;
363 return FR_NOT_IMPL;
365 {
366 mutt_error(_("No S/MIME backend configured"));
367 return FR_ERROR;
368 }
369
370 if (((WithCrypto & APPLICATION_PGP) != 0) && (wdata->email->security & APPLICATION_PGP))
371 {
372 if (wdata->email->security & (SEC_ENCRYPT | SEC_SIGN))
373 {
374 if (mutt_yesorno(_("PGP already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
375 {
377 return FR_NO_ACTION;
378 }
379 wdata->email->security &= ~(SEC_ENCRYPT | SEC_SIGN);
380 }
381 wdata->email->security &= ~APPLICATION_PGP;
383 update_crypt_info(wdata);
384 }
385 wdata->email->security = crypt_smime_send_menu(wdata->email);
386 update_crypt_info(wdata);
387 if (wdata->email->security == old_flags)
388 return FR_NO_ACTION;
389
392 return FR_SUCCESS;
393}
394
395#ifdef USE_AUTOCRYPT
399static int op_compose_autocrypt_menu(struct EnvelopeWindowData *wdata, int op)
400{
401 const SecurityFlags old_flags = wdata->email->security;
402 const bool c_autocrypt = cs_subset_bool(wdata->sub, "autocrypt");
403 if (!c_autocrypt)
404 return FR_NO_ACTION;
405
407 {
408 if (wdata->email->security & (SEC_ENCRYPT | SEC_SIGN))
409 {
410 if (mutt_yesorno(_("S/MIME already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
411 {
413 return FR_NO_ACTION;
414 }
415 wdata->email->security &= ~(SEC_ENCRYPT | SEC_SIGN);
416 }
417 wdata->email->security &= ~APPLICATION_SMIME;
418 wdata->email->security |= APPLICATION_PGP;
419 update_crypt_info(wdata);
420 }
421 autocrypt_compose_menu(wdata->email, wdata->sub);
422 update_crypt_info(wdata);
423 if (wdata->email->security == old_flags)
424 return FR_NO_ACTION;
425
428 return FR_SUCCESS;
429}
430#endif
431
432// -----------------------------------------------------------------------------
433
434#ifdef USE_NNTP
438static int op_envelope_edit_followup_to(struct EnvelopeWindowData *wdata, int op)
439{
440 if (!wdata->is_news)
441 return FR_NO_ACTION;
442
443 int rc = FR_NO_ACTION;
444 struct Buffer *buf = buf_pool_get();
445
446 buf_strcpy(buf, wdata->email->env->followup_to);
448 NULL, NULL, NULL) == 0)
449 {
452 rc = FR_SUCCESS;
453 }
454
455 buf_pool_release(&buf);
456 return rc;
457}
458
462static int op_envelope_edit_newsgroups(struct EnvelopeWindowData *wdata, int op)
463{
464 if (!wdata->is_news)
465 return FR_NO_ACTION;
466
467 int rc = FR_NO_ACTION;
468 struct Buffer *buf = buf_pool_get();
469
470 buf_strcpy(buf, wdata->email->env->newsgroups);
472 NULL, NULL, NULL) == 0)
473 {
476 rc = FR_SUCCESS;
477 }
478
479 buf_pool_release(&buf);
480 return rc;
481}
482
486static int op_envelope_edit_x_comment_to(struct EnvelopeWindowData *wdata, int op)
487{
488 const bool c_x_comment_to = cs_subset_bool(wdata->sub, "x_comment_to");
489 if (!(wdata->is_news && c_x_comment_to))
490 return FR_NO_ACTION;
491
492 int rc = FR_NO_ACTION;
493 struct Buffer *buf = buf_pool_get();
494
495 buf_strcpy(buf, wdata->email->env->x_comment_to);
497 NULL, NULL, NULL) == 0)
498 {
501 rc = FR_SUCCESS;
502 }
503
504 buf_pool_release(&buf);
505 return rc;
506}
507#endif
508
509#ifdef MIXMASTER
513static int op_compose_mix(struct EnvelopeWindowData *wdata, int op)
514{
515 dlg_mixmaster(&wdata->email->chain);
518 return FR_SUCCESS;
519}
520#endif
521
522// -----------------------------------------------------------------------------
523
527static const struct EnvelopeFunction EnvelopeFunctions[] = {
528// clang-format off
529#ifdef USE_AUTOCRYPT
530 { OP_COMPOSE_AUTOCRYPT_MENU, op_compose_autocrypt_menu },
531#endif
532#ifdef MIXMASTER
533 { OP_COMPOSE_MIX, op_compose_mix },
534#endif
535 { OP_COMPOSE_PGP_MENU, op_compose_pgp_menu },
536 { OP_COMPOSE_SMIME_MENU, op_compose_smime_menu },
537 { OP_ENVELOPE_EDIT_BCC, op_envelope_edit_bcc },
538 { OP_ENVELOPE_EDIT_CC, op_envelope_edit_cc },
539 { OP_ENVELOPE_EDIT_FCC, op_envelope_edit_fcc },
540#ifdef USE_NNTP
541 { OP_ENVELOPE_EDIT_FOLLOWUP_TO, op_envelope_edit_followup_to },
542#endif
543 { OP_ENVELOPE_EDIT_FROM, op_envelope_edit_from },
544#ifdef USE_NNTP
545 { OP_ENVELOPE_EDIT_NEWSGROUPS, op_envelope_edit_newsgroups },
546#endif
547 { OP_ENVELOPE_EDIT_REPLY_TO, op_envelope_edit_reply_to },
548 { OP_ENVELOPE_EDIT_SUBJECT, op_envelope_edit_subject },
549 { OP_ENVELOPE_EDIT_TO, op_envelope_edit_to },
550#ifdef USE_NNTP
551 { OP_ENVELOPE_EDIT_X_COMMENT_TO, op_envelope_edit_x_comment_to },
552#endif
553 { 0, NULL },
554 // clang-format on
555};
556
561{
562 if (!win || !win->wdata)
563 return FR_UNKNOWN;
564
565 int rc = FR_UNKNOWN;
566 for (size_t i = 0; EnvelopeFunctions[i].op != OP_NULL; i++)
567 {
568 const struct EnvelopeFunction *fn = &EnvelopeFunctions[i];
569 if (fn->op == op)
570 {
571 struct EnvelopeWindowData *wdata = win->wdata;
572 rc = fn->function(wdata, op);
573 break;
574 }
575 }
576
577 if (rc == FR_UNKNOWN) // Not our function
578 return rc;
579
580 const char *result = dispacher_get_retval_name(rc);
581 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
582
583 return rc;
584}
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
Definition: address.c:1449
int mutt_addrlist_to_local(struct AddressList *al)
Convert an Address list from Punycode.
Definition: address.c:1367
size_t mutt_addrlist_write(const struct AddressList *al, struct Buffer *buf, bool display)
Write an Address to a buffer.
Definition: address.c:1195
int mutt_addrlist_parse2(struct AddressList *al, const char *s)
Parse a list of email addresses.
Definition: address.c:629
int mutt_addrlist_to_intl(struct AddressList *al, char **err)
Convert an Address list to Punycode.
Definition: address.c:1282
Email Address Handling.
Email Aliases.
void mutt_expand_aliases(struct AddressList *al)
Expand aliases in a List of Addresses.
Definition: alias.c:297
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:568
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:401
size_t buf_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
Definition: buffer.c:566
void buf_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
Definition: buffer.c:347
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:90
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:1035
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:141
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:150
Enter a string.
int buf_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 const struct EnvelopeFunction EnvelopeFunctions[]
All the NeoMutt functions that the Envelope supports.
Definition: functions.c:527
static bool edit_address_list(enum HeaderField field, struct AddressList *al)
Let the user edit the address list.
Definition: functions.c:107
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:145
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: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:560
static int op_envelope_edit_bcc(struct EnvelopeWindowData *wdata, int op)
Edit the BCC list - Implements envelope_function_t -.
Definition: functions.c:190
static int op_envelope_edit_subject(struct EnvelopeWindowData *wdata, int op)
Edit the subject of this message - Implements envelope_function_t -.
Definition: functions.c:277
static int op_envelope_edit_to(struct EnvelopeWindowData *wdata, int op)
Edit the TO list - Implements envelope_function_t -.
Definition: functions.c:304
static int op_envelope_edit_followup_to(struct EnvelopeWindowData *wdata, int op)
Edit the Followup-To field - Implements envelope_function_t -.
Definition: functions.c:438
static int op_compose_pgp_menu(struct EnvelopeWindowData *wdata, int op)
Show PGP options - Implements envelope_function_t -.
Definition: functions.c:321
static int op_compose_autocrypt_menu(struct EnvelopeWindowData *wdata, int op)
Show autocrypt compose menu options - Implements envelope_function_t -.
Definition: functions.c:399
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:513
static int op_envelope_edit_from(struct EnvelopeWindowData *wdata, int op)
Edit the from field - Implements envelope_function_t -.
Definition: functions.c:252
static int op_envelope_edit_reply_to(struct EnvelopeWindowData *wdata, int op)
Edit the Reply-To field - Implements envelope_function_t -.
Definition: functions.c:265
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:486
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:224
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:462
static int op_compose_smime_menu(struct EnvelopeWindowData *wdata, int op)
Show S/MIME options - Implements envelope_function_t -.
Definition: functions.c:359
#define mutt_error(...)
Definition: logging2.h:90
#define mutt_debug(LEVEL,...)
Definition: logging2.h:87
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: logging2.h:43
#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:798
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_ALIAS
Alias completion (in alias dialog)
Definition: mutt.h:56
#define MUTT_COMP_FILE
File completion (in browser)
Definition: mutt.h:58
#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:65
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:560
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:48
All user-callable functions.
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 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
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:89
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:49
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:52
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