NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
functions.c
Go to the documentation of this file.
1
30#include "config.h"
31#include <stdbool.h>
32#include <stdio.h>
33#include "private.h"
34#include "mutt/lib.h"
35#include "address/lib.h"
36#include "config/lib.h"
37#include "email/lib.h"
38#include "core/lib.h"
39#include "alias/lib.h"
40#include "gui/lib.h"
41#include "mutt.h"
42#include "functions.h"
43#include "lib.h"
44#include "browser/lib.h"
45#include "editor/lib.h"
46#include "history/lib.h"
47#include "ncrypt/lib.h"
48#include "question/lib.h"
49#include "hook.h"
50#include "mutt_logging.h"
51#include "muttlib.h"
52#include "wdata.h"
53#ifdef USE_AUTOCRYPT
54#include "autocrypt/lib.h"
55#endif
56
57#ifdef USE_AUTOCRYPT
63static void autocrypt_compose_menu(struct Email *e, const struct ConfigSubset *sub)
64{
65 /* L10N: The compose menu autocrypt prompt.
66 (e)ncrypt enables encryption via autocrypt.
67 (c)lear sets cleartext.
68 (a)utomatic defers to the recommendation. */
69 const char *prompt = _("Autocrypt: (e)ncrypt, (c)lear, (a)utomatic?");
70
72
73 /* L10N: The letter corresponding to the compose menu autocrypt prompt
74 (e)ncrypt, (c)lear, (a)utomatic */
75 const char *letters = _("eca");
76
77 int choice = mw_multi_choice(prompt, letters);
78 switch (choice)
79 {
80 case 1:
83 break;
84 case 2:
85 e->security &= ~SEC_AUTOCRYPT;
87 break;
88 case 3:
89 {
90 e->security &= ~SEC_AUTOCRYPT_OVERRIDE;
91 const bool c_crypt_opportunistic_encrypt = cs_subset_bool(sub, "crypt_opportunistic_encrypt");
92 if (c_crypt_opportunistic_encrypt)
94 break;
95 }
96 }
97}
98#endif
99
106static bool edit_address_list(enum HeaderField field, struct AddressList *al)
107{
108 struct Buffer *old_list = buf_pool_get();
109 struct Buffer *new_list = buf_pool_get();
110
111 /* need to be large for alias expansion */
112 buf_alloc(old_list, 8192);
113 buf_alloc(new_list, 8192);
114
116 mutt_addrlist_write(al, new_list, false);
117 buf_fix_dptr(new_list);
118 if (!buf_is_empty(new_list))
119 buf_addstr(new_list, ", ");
120
121 buf_copy(old_list, new_list);
122 if (mw_get_field(_(Prompts[field]), new_list, MUTT_COMP_NO_FLAGS, HC_ALIAS,
123 &CompleteAliasOps, NULL) == 0)
124 {
126 mutt_addrlist_parse2(al, buf_string(new_list));
128 }
129
130 char *err = NULL;
131 if (mutt_addrlist_to_intl(al, &err) != 0)
132 {
133 mutt_error(_("Bad IDN: '%s'"), err);
134 mutt_refresh();
135 FREE(&err);
136 }
137
138 const bool rc = !mutt_str_equal(buf_string(new_list), buf_string(old_list));
139 buf_pool_release(&old_list);
140 buf_pool_release(&new_list);
141 return rc;
142}
143
149{
150 struct Email *e = wdata->email;
151
152 const bool c_crypt_opportunistic_encrypt = cs_subset_bool(wdata->sub, "crypt_opportunistic_encrypt");
153 if (c_crypt_opportunistic_encrypt)
155
156#ifdef USE_AUTOCRYPT
157 const bool c_autocrypt = cs_subset_bool(wdata->sub, "autocrypt");
158 if (c_autocrypt)
159 {
161
162 /* Anything that enables SEC_ENCRYPT or SEC_SIGN, or turns on SMIME
163 * overrides autocrypt, be it oppenc or the user having turned on
164 * those flags manually. */
166 {
168 }
169 else
170 {
172 {
173 if (wdata->autocrypt_rec == AUTOCRYPT_REC_YES)
174 {
177 }
178 else
179 {
180 e->security &= ~SEC_AUTOCRYPT;
181 }
182 }
183 }
184 }
185#endif
186}
187
188// -----------------------------------------------------------------------------
189
193static int op_envelope_edit_bcc(struct EnvelopeWindowData *wdata, int op)
194{
195 if (wdata->is_news)
196 return FR_NO_ACTION;
197 if (!edit_address_list(HDR_BCC, &wdata->email->env->bcc))
198 return FR_NO_ACTION;
199
200 update_crypt_info(wdata);
202 return FR_SUCCESS;
203}
204
208static int op_envelope_edit_cc(struct EnvelopeWindowData *wdata, int op)
209{
210 if (wdata->is_news)
211 return FR_NO_ACTION;
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 = buf_pool_get();
227 buf_copy(fname, wdata->fcc);
228
229 struct FileCompletionData cdata = { false, NULL, NULL, NULL };
231 &CompleteMailboxOps, &cdata) != 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 (mw_get_field(Prompts[HDR_SUBJECT], buf, MUTT_COMP_NO_FLAGS, HC_OTHER, NULL, NULL) != 0)
284 {
285 goto done; // aborted
286 }
287
288 if (mutt_str_equal(wdata->email->env->subject, buf_string(buf)))
289 goto done; // no change
290
293 rc = FR_SUCCESS;
294
295done:
296 buf_pool_release(&buf);
297 return rc;
298}
299
303static int op_envelope_edit_to(struct EnvelopeWindowData *wdata, int op)
304{
305 if (wdata->is_news)
306 return FR_NO_ACTION;
307 if (!edit_address_list(HDR_TO, &wdata->email->env->to))
308 return FR_NO_ACTION;
309
310 update_crypt_info(wdata);
312 return FR_SUCCESS;
313}
314
318static int op_compose_pgp_menu(struct EnvelopeWindowData *wdata, int op)
319{
320 const SecurityFlags old_flags = wdata->email->security;
322 return FR_NOT_IMPL;
324 {
325 mutt_error(_("No PGP backend configured"));
326 return FR_ERROR;
327 }
328 if (((WithCrypto & APPLICATION_SMIME) != 0) && (wdata->email->security & APPLICATION_SMIME))
329 {
330 if (wdata->email->security & (SEC_ENCRYPT | SEC_SIGN))
331 {
332 if (query_yesorno(_("S/MIME already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
333 {
335 return FR_NO_ACTION;
336 }
337 wdata->email->security &= ~(SEC_ENCRYPT | SEC_SIGN);
338 }
339 wdata->email->security &= ~APPLICATION_SMIME;
340 wdata->email->security |= APPLICATION_PGP;
341 update_crypt_info(wdata);
342 }
343 wdata->email->security = crypt_pgp_send_menu(wdata->email);
344 update_crypt_info(wdata);
345 if (wdata->email->security == old_flags)
346 return FR_NO_ACTION;
347
350 return FR_SUCCESS;
351}
352
356static int op_compose_smime_menu(struct EnvelopeWindowData *wdata, int op)
357{
358 const SecurityFlags old_flags = wdata->email->security;
360 return FR_NOT_IMPL;
362 {
363 mutt_error(_("No S/MIME backend configured"));
364 return FR_ERROR;
365 }
366
367 if (((WithCrypto & APPLICATION_PGP) != 0) && (wdata->email->security & APPLICATION_PGP))
368 {
369 if (wdata->email->security & (SEC_ENCRYPT | SEC_SIGN))
370 {
371 if (query_yesorno(_("PGP already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
372 {
374 return FR_NO_ACTION;
375 }
376 wdata->email->security &= ~(SEC_ENCRYPT | SEC_SIGN);
377 }
378 wdata->email->security &= ~APPLICATION_PGP;
380 update_crypt_info(wdata);
381 }
382 wdata->email->security = crypt_smime_send_menu(wdata->email);
383 update_crypt_info(wdata);
384 if (wdata->email->security == old_flags)
385 return FR_NO_ACTION;
386
389 return FR_SUCCESS;
390}
391
392#ifdef USE_AUTOCRYPT
396static int op_compose_autocrypt_menu(struct EnvelopeWindowData *wdata, int op)
397{
398 const SecurityFlags old_flags = wdata->email->security;
399 const bool c_autocrypt = cs_subset_bool(wdata->sub, "autocrypt");
400 if (!c_autocrypt)
401 return FR_NO_ACTION;
402
404 {
405 if (wdata->email->security & (SEC_ENCRYPT | SEC_SIGN))
406 {
407 if (query_yesorno(_("S/MIME already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
408 {
410 return FR_NO_ACTION;
411 }
412 wdata->email->security &= ~(SEC_ENCRYPT | SEC_SIGN);
413 }
414 wdata->email->security &= ~APPLICATION_SMIME;
415 wdata->email->security |= APPLICATION_PGP;
416 update_crypt_info(wdata);
417 }
418 autocrypt_compose_menu(wdata->email, wdata->sub);
419 update_crypt_info(wdata);
420 if (wdata->email->security == old_flags)
421 return FR_NO_ACTION;
422
425 return FR_SUCCESS;
426}
427#endif
428
429// -----------------------------------------------------------------------------
430
434static int op_envelope_edit_followup_to(struct EnvelopeWindowData *wdata, int op)
435{
436 if (!wdata->is_news)
437 return FR_NO_ACTION;
438
439 int rc = FR_NO_ACTION;
440 struct Buffer *buf = buf_pool_get();
441
442 buf_strcpy(buf, wdata->email->env->followup_to);
443 if (mw_get_field(Prompts[HDR_FOLLOWUPTO], buf, MUTT_COMP_NO_FLAGS, HC_OTHER, NULL, NULL) == 0)
444 {
447 rc = FR_SUCCESS;
448 }
449
450 buf_pool_release(&buf);
451 return rc;
452}
453
457static int op_envelope_edit_newsgroups(struct EnvelopeWindowData *wdata, int op)
458{
459 if (!wdata->is_news)
460 return FR_NO_ACTION;
461
462 int rc = FR_NO_ACTION;
463 struct Buffer *buf = buf_pool_get();
464
465 buf_strcpy(buf, wdata->email->env->newsgroups);
466 if (mw_get_field(Prompts[HDR_NEWSGROUPS], buf, MUTT_COMP_NO_FLAGS, HC_OTHER, NULL, NULL) == 0)
467 {
470 rc = FR_SUCCESS;
471 }
472
473 buf_pool_release(&buf);
474 return rc;
475}
476
480static int op_envelope_edit_x_comment_to(struct EnvelopeWindowData *wdata, int op)
481{
482 const bool c_x_comment_to = cs_subset_bool(wdata->sub, "x_comment_to");
483 if (!(wdata->is_news && c_x_comment_to))
484 return FR_NO_ACTION;
485
486 int rc = FR_NO_ACTION;
487 struct Buffer *buf = buf_pool_get();
488
489 buf_strcpy(buf, wdata->email->env->x_comment_to);
490 if (mw_get_field(Prompts[HDR_XCOMMENTTO], buf, MUTT_COMP_NO_FLAGS, HC_OTHER, NULL, NULL) == 0)
491 {
494 rc = FR_SUCCESS;
495 }
496
497 buf_pool_release(&buf);
498 return rc;
499}
500
501// -----------------------------------------------------------------------------
502
506static const struct EnvelopeFunction EnvelopeFunctions[] = {
507// clang-format off
508#ifdef USE_AUTOCRYPT
509 { OP_COMPOSE_AUTOCRYPT_MENU, op_compose_autocrypt_menu },
510#endif
511 { OP_COMPOSE_PGP_MENU, op_compose_pgp_menu },
512 { OP_COMPOSE_SMIME_MENU, op_compose_smime_menu },
513 { OP_ENVELOPE_EDIT_BCC, op_envelope_edit_bcc },
514 { OP_ENVELOPE_EDIT_CC, op_envelope_edit_cc },
515 { OP_ENVELOPE_EDIT_FCC, op_envelope_edit_fcc },
516 { OP_ENVELOPE_EDIT_FOLLOWUP_TO, op_envelope_edit_followup_to },
517 { OP_ENVELOPE_EDIT_FROM, op_envelope_edit_from },
518 { OP_ENVELOPE_EDIT_NEWSGROUPS, op_envelope_edit_newsgroups },
519 { OP_ENVELOPE_EDIT_REPLY_TO, op_envelope_edit_reply_to },
520 { OP_ENVELOPE_EDIT_SUBJECT, op_envelope_edit_subject },
521 { OP_ENVELOPE_EDIT_TO, op_envelope_edit_to },
522 { OP_ENVELOPE_EDIT_X_COMMENT_TO, op_envelope_edit_x_comment_to },
523 { 0, NULL },
524 // clang-format on
525};
526
531{
532 if (!win || !win->wdata)
533 return FR_UNKNOWN;
534
535 int rc = FR_UNKNOWN;
536 for (size_t i = 0; EnvelopeFunctions[i].op != OP_NULL; i++)
537 {
538 const struct EnvelopeFunction *fn = &EnvelopeFunctions[i];
539 if (fn->op == op)
540 {
541 struct EnvelopeWindowData *wdata = win->wdata;
542 rc = fn->function(wdata, op);
543 break;
544 }
545 }
546
547 if (rc == FR_UNKNOWN) // Not our function
548 return rc;
549
550 const char *result = dispatcher_get_retval_name(rc);
551 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
552
553 return rc;
554}
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
Definition: address.c:1460
int mutt_addrlist_to_local(struct AddressList *al)
Convert an Address list from Punycode.
Definition: address.c:1378
size_t mutt_addrlist_write(const struct AddressList *al, struct Buffer *buf, bool display)
Write an Address to a buffer.
Definition: address.c:1206
int mutt_addrlist_parse2(struct AddressList *al, const char *s)
Parse a list of email addresses.
Definition: address.c:644
int mutt_addrlist_to_intl(struct AddressList *al, char **err)
Convert an Address list to Punycode.
Definition: address.c:1293
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:295
Autocrypt end-to-end encryption.
@ AUTOCRYPT_REC_YES
Autocrypt should be used.
Definition: lib.h:165
enum AutocryptRec mutt_autocrypt_ui_recommendation(const struct Email *e, char **keylist)
Get the recommended action for an Email.
Definition: autocrypt.c:558
const struct CompleteOps CompleteMailboxOps
Auto-Completion of Files / Mailboxes.
Definition: complete.c:160
Select a Mailbox from a list.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition: buffer.c:291
void buf_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
Definition: buffer.c:182
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition: buffer.c:226
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:395
size_t buf_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
Definition: buffer.c:601
void buf_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
Definition: buffer.c:337
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:96
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:47
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:1045
bool crypt_has_module_backend(SecurityFlags type)
Is there a crypto backend for a given type?
Definition: cryptglue.c:170
SecurityFlags crypt_smime_send_menu(struct Email *e)
Wrapper for CryptModuleSpecs::send_menu()
Definition: cryptglue.c:527
SecurityFlags crypt_pgp_send_menu(struct Email *e)
Wrapper for CryptModuleSpecs::send_menu()
Definition: cryptglue.c:383
void mutt_refresh(void)
Force a refresh of the screen.
Definition: curs_lib.c:78
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:186
static const struct EnvelopeFunction EnvelopeFunctions[]
All the NeoMutt functions that the Envelope supports.
Definition: functions.c:506
static bool edit_address_list(enum HeaderField field, struct AddressList *al)
Let the user edit the address list.
Definition: functions.c:106
static void autocrypt_compose_menu(struct Email *e, const struct ConfigSubset *sub)
Autocrypt compose settings.
Definition: functions.c:63
void update_crypt_info(struct EnvelopeWindowData *wdata)
Update the crypto info.
Definition: functions.c:148
const char *const Prompts[]
Names of header fields used in the envelope, e.g. From:, To:
Definition: window.c:93
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:48
@ HDR_XCOMMENTTO
"X-Comment-To:" field
Definition: private.h:49
@ HDR_NEWSGROUPS
"Newsgroups:" field
Definition: private.h:47
@ HDR_FROM
"From:" field
Definition: private.h:35
void mutt_env_set_subject(struct Envelope *env, const char *subj)
Set both subject and real_subj to subj.
Definition: envelope.c:69
bool mutt_env_notify_send(struct Email *e, enum NotifyEnvelope type)
Send an Envelope change notification.
Definition: envelope.c:179
@ NT_ENVELOPE_SUBJECT
"Subject:" header has changed
Definition: envelope.h:144
@ NT_ENVELOPE_BCC
"Bcc:" header has changed
Definition: envelope.h:137
@ NT_ENVELOPE_TO
"To:" header has changed
Definition: envelope.h:145
@ NT_ENVELOPE_FCC
"Fcc:" header has changed
Definition: envelope.h:139
@ NT_ENVELOPE_CC
"Cc:" header has changed
Definition: envelope.h:138
@ NT_ENVELOPE_REPLY_TO
"Reply-To:" header has changed
Definition: envelope.h:143
@ NT_ENVELOPE_FROM
"From:" header has changed
Definition: envelope.h:141
@ NT_ENVELOPE_X_COMMENT_TO
"X-Comment-To:" header has changed
Definition: envelope.h:146
@ NT_ENVELOPE_FOLLOWUP_TO
"Followup-To:" header has changed
Definition: envelope.h:140
@ NT_ENVELOPE_NEWSGROUPS
"Newsgroups:" header has changed
Definition: envelope.h:142
int env_function_dispatcher(struct MuttWindow *win, int op)
Perform an Envelope function - Implements function_dispatcher_t -.
Definition: functions.c:530
static int op_envelope_edit_bcc(struct EnvelopeWindowData *wdata, int op)
Edit the BCC list - Implements envelope_function_t -.
Definition: functions.c:193
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: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:434
static int op_compose_pgp_menu(struct EnvelopeWindowData *wdata, int op)
Show PGP options - Implements envelope_function_t -.
Definition: functions.c:318
static int op_compose_autocrypt_menu(struct EnvelopeWindowData *wdata, int op)
Show autocrypt compose menu options - Implements envelope_function_t -.
Definition: functions.c:396
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:480
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:208
static int op_envelope_edit_newsgroups(struct EnvelopeWindowData *wdata, int op)
Edit the newsgroups list - Implements envelope_function_t -.
Definition: functions.c:457
static int op_compose_smime_menu(struct EnvelopeWindowData *wdata, int op)
Show S/MIME options - Implements envelope_function_t -.
Definition: functions.c:356
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:274
int mw_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question -.
Definition: question.c:63
#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_MAILBOX
Mailboxes.
Definition: lib.h:60
@ HC_ALIAS
Aliases.
Definition: lib.h:55
@ HC_OTHER
Miscellaneous strings.
Definition: lib.h:59
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Definition: hook.c:700
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:55
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:660
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:280
Many unsorted constants and some structs.
#define MUTT_COMP_NO_FLAGS
No flags are set.
Definition: mutt.h:56
#define MUTT_COMP_CLEAR
Clear input if printable character is pressed.
Definition: mutt.h:57
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:74
NeoMutt Logging.
void buf_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
Definition: muttlib.c:519
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
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:327
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:36
char * data
Pointer to data.
Definition: buffer.h:37
A set of inherited config items.
Definition: subset.h:47
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 Notify * notify
Notifications: NotifyEmail, EventEmail.
Definition: email.h:73
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
char *const subject
Email's subject.
Definition: envelope.h:70
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
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:40
void * wdata
Private data.
Definition: mutt_window.h:144