NeoMutt  2025-12-11-276-g10b23b
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
mutt_config.c
Go to the documentation of this file.
1
28
34
35#include "config.h"
36#include <stdbool.h>
37#include <stdio.h>
38#include <string.h>
39#include "mutt/lib.h"
40#include "config/lib.h"
41#include "email/lib.h"
42#include "core/lib.h"
43#include "gui/lib.h"
44#include "attach/lib.h"
45#include "expando/lib.h"
46#include "mutt_logging.h"
47#include "mx.h"
48
49extern const struct ExpandoDefinition IndexFormatDef[];
50
54static const struct Mapping SortAuxMethods[] = {
55 // clang-format off
56 { "date", EMAIL_SORT_DATE },
57 { "date-received", EMAIL_SORT_DATE_RECEIVED },
58 { "from", EMAIL_SORT_FROM },
59 { "label", EMAIL_SORT_LABEL },
60 { "score", EMAIL_SORT_SCORE },
61 { "size", EMAIL_SORT_SIZE },
62 { "spam", EMAIL_SORT_SPAM },
63 { "subject", EMAIL_SORT_SUBJECT },
64 { "to", EMAIL_SORT_TO },
65 { "unsorted", EMAIL_SORT_UNSORTED },
66 // Compatibility
67 { "date-sent", EMAIL_SORT_DATE },
68 { "mailbox-order", EMAIL_SORT_UNSORTED },
69 { "threads", EMAIL_SORT_DATE },
70 { NULL, 0 },
71 // clang-format on
72};
73
77const struct Mapping SortMethods[] = {
78 // clang-format off
79 { "date", EMAIL_SORT_DATE },
80 { "date-received", EMAIL_SORT_DATE_RECEIVED },
81 { "from", EMAIL_SORT_FROM },
82 { "label", EMAIL_SORT_LABEL },
83 { "score", EMAIL_SORT_SCORE },
84 { "size", EMAIL_SORT_SIZE },
85 { "spam", EMAIL_SORT_SPAM },
86 { "subject", EMAIL_SORT_SUBJECT },
87 { "threads", EMAIL_SORT_THREADS },
88 { "to", EMAIL_SORT_TO },
89 { "unsorted", EMAIL_SORT_UNSORTED },
90 // Compatibility
91 { "date-sent", EMAIL_SORT_DATE },
92 { "mailbox-order", EMAIL_SORT_UNSORTED },
93 { NULL, 0 },
94 // clang-format on
95};
96
103static const struct ExpandoDefinition AttachFormatDef[] = {
104 // clang-format off
105 { "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
106 { ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
107 { "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
108 { "c", "charset-convert", ED_BODY, ED_BOD_CHARSET_CONVERT, NULL },
109 { "C", "charset", ED_ATTACH, ED_ATT_CHARSET, NULL },
110 { "d", "description", ED_BODY, ED_BOD_DESCRIPTION, NULL },
111 { "D", "deleted", ED_BODY, ED_BOD_DELETED, NULL },
112 { "e", "mime-encoding", ED_BODY, ED_BOD_MIME_ENCODING, NULL },
113 { "f", "file", ED_BODY, ED_BOD_FILE, NULL },
114 { "F", "file-disposition", ED_BODY, ED_BOD_FILE_DISPOSITION, NULL },
115 { "I", "disposition", ED_BODY, ED_BOD_DISPOSITION, NULL },
116 { "m", "mime-major", ED_BODY, ED_BOD_MIME_MAJOR, NULL },
117 { "M", "mime-minor", ED_BODY, ED_BOD_MIME_MINOR, NULL },
118 { "n", "number", ED_ATTACH, ED_ATT_NUMBER, NULL },
119 { "Q", "attach-qualifies", ED_BODY, ED_BOD_ATTACH_QUALIFIES, NULL },
120 { "s", "file-size", ED_BODY, ED_BOD_FILE_SIZE, NULL },
121 { "t", "tagged", ED_BODY, ED_BOD_TAGGED, NULL },
122 { "T", "tree", ED_ATTACH, ED_ATT_TREE, NULL },
123 { "u", "unlink", ED_BODY, ED_BOD_UNLINK, NULL },
124 { "X", "attach-count", ED_BODY, ED_BOD_ATTACH_COUNT, NULL },
125 { NULL, NULL, 0, -1, NULL }
126 // clang-format on
127};
128
136 struct ExpandoFormat *fmt, int did,
137 int uid, ExpandoParserFlags flags,
138 const char **parsed_until,
139 struct ExpandoParseError *err)
140{
141 if (flags & EP_CONDITIONAL)
142 {
143 return node_conddate_parse(str, did, uid, parsed_until, err);
144 }
145
146 return node_expando_parse_enclosure(str, did, uid, ')', fmt, parsed_until, err);
147}
148
155struct ExpandoNode *parse_index_date_local(const char *str, struct ExpandoFormat *fmt,
156 int did, int uid, ExpandoParserFlags flags,
157 const char **parsed_until,
158 struct ExpandoParseError *err)
159{
160 if (flags & EP_CONDITIONAL)
161 {
162 return node_conddate_parse(str, did, uid, parsed_until, err);
163 }
164
165 return node_expando_parse_enclosure(str, did, uid, ']', fmt, parsed_until, err);
166}
167
174struct ExpandoNode *parse_index_date(const char *str, struct ExpandoFormat *fmt,
175 int did, int uid, ExpandoParserFlags flags,
176 const char **parsed_until,
177 struct ExpandoParseError *err)
178{
179 if (flags & EP_CONDITIONAL)
180 {
181 return node_conddate_parse(str, did, uid, parsed_until, err);
182 }
183
184 struct ExpandoNode *node = node_expando_parse_enclosure(str, did, uid, '}',
185 fmt, parsed_until, err);
186 if (!node)
187 return NULL;
188
189 const char *pc = strchr(NONULL(node->text), '%');
190 if (!pc)
191 {
192 snprintf(err->message, sizeof(err->message), _("Unknown expando: %%{%s}"), node->text);
193 err->position = str;
194 node_free(&node);
195 }
196
197 return node;
198}
199
207struct ExpandoNode *parse_index_format_hook(const char *str, struct ExpandoFormat *fmt,
208 int did, int uid, ExpandoParserFlags flags,
209 const char **parsed_until,
210 struct ExpandoParseError *err)
211{
212 if (flags & EP_CONDITIONAL)
213 {
214 snprintf(err->message, sizeof(err->message),
215 _("index-hook cannot be used as a condition"));
216 err->position = str;
217 return NULL;
218 }
219
220 return node_expando_parse_enclosure(str, did, uid, '@', fmt, parsed_until, err);
221}
222
228struct ExpandoNode *parse_tags_transformed(const char *str, struct ExpandoFormat *fmt,
229 int did, int uid, ExpandoParserFlags flags,
230 const char **parsed_until,
231 struct ExpandoParseError *err)
232{
233 // Tag expando %G must use a suffix from [A-Za-z0-9], e.g. %Ga, %GL
234 if (!mutt_isalnum(str[1]))
235 return NULL;
236
237 struct ExpandoNode *node = node_expando_new(fmt, did, uid);
238
239 node->text = mutt_strn_dup(str, 2);
240
241 if (flags & EP_CONDITIONAL)
242 {
243 node->type = ENT_CONDBOOL;
245 }
246
247 (*parsed_until) = str + 2;
248
249 return node;
250}
251
258struct ExpandoNode *parse_subject(const char *str, struct ExpandoFormat *fmt,
259 int did, int uid, ExpandoParserFlags flags,
260 const char **parsed_until, struct ExpandoParseError *err)
261{
262 struct ExpandoNode *node_subj = node_expando_new(NULL, did, uid);
264 struct ExpandoNode *node_cont = node_container_new();
265
266 // Apply the formatting info to the container
267 node_cont->format = fmt;
268
269 node_add_child(node_cont, node_tree);
270 node_add_child(node_cont, node_subj);
271
272 if (*parsed_until[0] != '}')
273 (*parsed_until)++;
274
275 return node_cont;
276}
277
294 // clang-format off
295 { "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
296 { ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
297 { "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
300 { "a", "from", ED_ENVELOPE, ED_ENV_FROM, NULL },
301 { "A", "reply-to", ED_ENVELOPE, ED_ENV_REPLY_TO, NULL },
302 { "b", "mailbox-name", ED_MAILBOX, ED_MBX_MAILBOX_NAME, NULL },
303 { "B", "list-address", ED_ENVELOPE, ED_ENV_LIST_ADDRESS, NULL },
304 { "cr", "body-characters", ED_EMAIL, ED_EMA_BODY_CHARACTERS, NULL },
305 { "c", "size", ED_EMAIL, ED_EMA_SIZE, NULL },
306 { "C", "number", ED_EMAIL, ED_EMA_NUMBER, NULL },
307 { "d", "date-format", ED_EMAIL, ED_EMA_DATE_FORMAT, NULL },
308 { "D", "date-format-local", ED_EMAIL, ED_EMA_DATE_FORMAT_LOCAL, NULL },
309 { "e", "thread-number", ED_EMAIL, ED_EMA_THREAD_NUMBER, NULL },
310 { "E", "thread-count", ED_EMAIL, ED_EMA_THREAD_COUNT, NULL },
311 { "f", "from-full", ED_ENVELOPE, ED_ENV_FROM_FULL, NULL },
312 { "Fp", "sender-plain", ED_ENVELOPE, ED_ENV_SENDER_PLAIN, NULL },
313 { "F", "sender", ED_ENVELOPE, ED_ENV_SENDER, NULL },
314 { "g", "tags", ED_EMAIL, ED_EMA_TAGS, NULL },
315 { "G", "tags-transformed", ED_EMAIL, ED_EMA_TAGS_TRANSFORMED, parse_tags_transformed },
316 { "H", "spam", ED_ENVELOPE, ED_ENV_SPAM, NULL },
317 { "i", "message-id", ED_ENVELOPE, ED_ENV_MESSAGE_ID, NULL },
318 { "I", "initials", ED_ENVELOPE, ED_ENV_INITIALS, NULL },
319 { "J", "thread-tags", ED_EMAIL, ED_EMA_THREAD_TAGS, NULL },
320 { "K", "list-empty", ED_ENVELOPE, ED_ENV_LIST_EMPTY, NULL },
321 { "l", "lines", ED_EMAIL, ED_EMA_LINES, NULL },
322 { "L", "from-list", ED_EMAIL, ED_EMA_FROM_LIST, NULL },
323 { "m", "message-count", ED_MAILBOX, ED_MBX_MESSAGE_COUNT, NULL },
324 { "M", "thread-hidden-count", ED_EMAIL, ED_EMA_THREAD_HIDDEN_COUNT, NULL },
325 { "n", "name", ED_ENVELOPE, ED_ENV_NAME, NULL },
326 { "N", "score", ED_EMAIL, ED_EMA_SCORE, NULL },
327 { "O", "save-folder", ED_EMAIL, ED_EMA_LIST_OR_SAVE_FOLDER, NULL },
328 { "P", "percentage", ED_MAILBOX, ED_MBX_PERCENTAGE, NULL },
329 { "q", "newsgroup", ED_ENVELOPE, ED_ENV_NEWSGROUP, NULL },
330 { "r", "to-all", ED_ENVELOPE, ED_ENV_TO_ALL, NULL },
331 { "R", "cc-all", ED_ENVELOPE, ED_ENV_CC_ALL, NULL },
332 { "s", "subject", ED_ENVELOPE, ED_ENV_SUBJECT, parse_subject },
333 { "S", "flag-chars", ED_EMAIL, ED_EMA_FLAG_CHARS, NULL },
334 { "t", "to", ED_ENVELOPE, ED_ENV_TO, NULL },
335 { "T", "to-chars", ED_EMAIL, ED_EMA_TO_CHARS, NULL },
336 { "u", "username", ED_ENVELOPE, ED_ENV_USERNAME, NULL },
337 { "v", "first-name", ED_ENVELOPE, ED_ENV_FIRST_NAME, NULL },
338 { "W", "organization", ED_ENVELOPE, ED_ENV_ORGANIZATION, NULL },
339 { "x", "x-comment-to", ED_ENVELOPE, ED_ENV_X_COMMENT_TO, NULL },
340 { "X", "attachment-count", ED_EMAIL, ED_EMA_ATTACHMENT_COUNT, NULL },
341 { "y", "x-label", ED_ENVELOPE, ED_ENV_X_LABEL, NULL },
342 { "Y", "thread-x-label", ED_ENVELOPE, ED_ENV_THREAD_X_LABEL, NULL },
343 { "Z", "combined-flags", ED_EMAIL, ED_EMA_COMBINED_FLAGS, NULL },
344 { "zc", "crypto-flags", ED_EMAIL, ED_EMA_CRYPTO_FLAGS, NULL },
345 { "zs", "status-flags", ED_EMAIL, ED_EMA_STATUS_FLAGS, NULL },
346 { "zt", "message-flags", ED_EMAIL, ED_EMA_MESSAGE_FLAGS, NULL },
349 { NULL, NULL, 0, -1, NULL }
350 // clang-format on
351};
352
355
359struct ConfigDef MainVars[] = {
360 // clang-format off
361 { "abort_backspace", DT_BOOL, true, 0, NULL,
362 "Hitting backspace against an empty prompt aborts the prompt"
363 },
364 { "abort_key", DT_STRING|D_NOT_EMPTY|D_ON_STARTUP, IP "\007", 0, NULL,
365 "String representation of key to abort prompts"
366 },
367 { "ascii_chars", DT_BOOL, false, 0, NULL,
368 "Use plain ASCII characters, when drawing email threads"
369 },
371 "If a message is missing a character set, assume this character set"
372 },
373 { "attach_format", DT_EXPANDO|D_NOT_EMPTY, IP "%u%D%I %t%4n %T%d %> [%.7m/%.10M, %.6e%<C?, %C>, %s] ", IP &AttachFormatDef, NULL,
374 "printf-like format string for the attachment menu"
375 },
376 { "auto_edit", DT_BOOL, false, 0, NULL,
377 "Skip the initial compose menu and edit the email"
378 },
379 { "auto_tag", DT_BOOL, false, 0, NULL,
380 "Automatically apply actions to all tagged messages"
381 },
382 { "braille_friendly", DT_BOOL, false, 0, NULL,
383 "Move the cursor to the beginning of the line"
384 },
386 "Default character set for displaying text on screen"
387 },
388 { "color_directcolor", DT_BOOL|D_ON_STARTUP, false, 0, NULL,
389 "Use 24bit colors (aka truecolor aka directcolor)"
390 },
391 { "config_charset", DT_STRING, 0, 0, charset_validator,
392 "Character set that the config files are in"
393 },
394 { "confirm_append", DT_BOOL, true, 0, NULL,
395 "Confirm before appending emails to a mailbox"
396 },
397 { "confirm_create", DT_BOOL, true, 0, NULL,
398 "Confirm before creating a new mailbox"
399 },
400 { "copy_decode_weed", DT_BOOL, false, 0, NULL,
401 "Controls whether to weed headers when copying or saving emails"
402 },
403 { "date_format", DT_STRING|D_NOT_EMPTY, IP "!%a, %b %d, %Y at %I:%M:%S%p %Z", 0, NULL,
404 "strftime format string for the `%d` expando"
405 },
406 { "debug_file", DT_PATH|D_PATH_FILE, IP "~/.neomuttdebug", 0, NULL,
407 "File to save debug logs"
408 },
409 { "debug_level", DT_NUMBER, 0, 0, debug_level_validator,
410 "Logging level for debug logs"
411 },
412 { "delete", DT_QUAD, MUTT_ASKYES, 0, NULL,
413 "Really delete messages, when the mailbox is closed"
414 },
415 { "delete_untag", DT_BOOL, true, 0, NULL,
416 "Untag messages when they are marked for deletion"
417 },
418 { "editor", DT_STRING|D_NOT_EMPTY|D_STRING_COMMAND, 0, 0, NULL,
419 "External command to use as an email editor"
420 },
421 { "flag_safe", DT_BOOL, false, 0, NULL,
422 "Protect flagged messages from deletion"
423 },
424 { "folder", DT_STRING|D_STRING_MAILBOX, IP "~/Mail", 0, NULL,
425 "Base folder for a set of mailboxes"
426 },
427 { "forward_decode", DT_BOOL, true, 0, NULL,
428 "Decode the message when forwarding it"
429 },
430 { "forward_quote", DT_BOOL, false, 0, NULL,
431 "Automatically quote a forwarded message using `$indent_string`"
432 },
433 { "from", DT_ADDRESS, 0, 0, NULL,
434 "Default 'From' address to use, if isn't otherwise set"
435 },
436 { "gecos_mask", DT_REGEX, IP "^[^,]*", 0, NULL,
437 "Regex for parsing GECOS field of /etc/passwd"
438 },
439 { "header", DT_BOOL, false, 0, NULL,
440 "Include the message headers in the reply email (Weed applies)"
441 },
442 { "hostname", DT_STRING, 0, 0, NULL,
443 "Fully-qualified domain name of this machine"
444 },
445 { "indent_string", DT_EXPANDO, IP "> ", IP IndexFormatDefNoPadding, NULL,
446 "String used to indent 'reply' text"
447 },
448 { "keep_flagged", DT_BOOL, false, 0, NULL,
449 "Don't move flagged messages from `$spool_file` to `$mbox`"
450 },
451 { "local_date_header", DT_BOOL, true, 0, NULL,
452 "Convert the date in the Date header of sent emails into local timezone, UTC otherwise"
453 },
454 { "mail_check", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 5, 0, NULL,
455 "Number of seconds before NeoMutt checks for new mail"
456 },
457 { "mail_check_recent", DT_BOOL, true, 0, NULL,
458 "Notify the user about new mail since the last time the mailbox was opened"
459 },
460 { "mail_check_stats", DT_BOOL, false, 0, NULL,
461 "Periodically check for new mail"
462 },
463 { "mail_check_stats_interval", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 60, 0, NULL,
464 "How often to check for new mail"
465 },
466 { "mark_old", DT_BOOL, true, 0, NULL,
467 "Mark new emails as old when leaving the mailbox"
468 },
469 { "mbox", DT_STRING|D_STRING_MAILBOX, IP "~/mbox", 0, NULL,
470 "Folder that receives read emails (see Move)"
471 },
472 { "mbox_type", DT_ENUM, MUTT_MBOX, IP &MboxTypeDef, NULL,
473 "Default type for creating new mailboxes"
474 },
475 { "message_cache_clean", DT_BOOL, false, 0, NULL,
476 "(imap/pop) Clean out obsolete entries from the message cache"
477 },
478 { "message_cache_dir", DT_PATH|D_PATH_DIR, 0, 0, NULL,
479 "(imap/pop) Directory for the message cache"
480 },
481 { "meta_key", DT_BOOL, false, 0, NULL,
482 "Interpret 'ALT-x' as 'ESC-x'"
483 },
484 { "move", DT_QUAD, MUTT_NO, 0, NULL,
485 "Move emails from `$spool_file` to `$mbox` when read"
486 },
487 { "pipe_decode", DT_BOOL, false, 0, NULL,
488 "Decode the message when piping it"
489 },
490 { "pipe_decode_weed", DT_BOOL, true, 0, NULL,
491 "Control whether to weed headers when piping an email"
492 },
493 { "pipe_sep", DT_STRING, IP "\n", 0, NULL,
494 "Separator to add between multiple piped messages"
495 },
496 { "pipe_split", DT_BOOL, false, 0, NULL,
497 "Run the pipe command on each message separately"
498 },
499 { "postponed", DT_STRING|D_STRING_MAILBOX, IP "~/postponed", 0, NULL,
500 "Folder to store postponed messages"
501 },
502 { "print", DT_QUAD, MUTT_ASKNO, 0, NULL,
503 "Confirm before printing a message"
504 },
505 { "print_command", DT_STRING|D_STRING_COMMAND, IP "lpr", 0, NULL,
506 "External command to print a message"
507 },
508 { "print_decode", DT_BOOL, true, 0, NULL,
509 "Decode message before printing it"
510 },
511 { "print_decode_weed", DT_BOOL, true, 0, NULL,
512 "Control whether to weed headers when printing an email"
513 },
514 { "print_split", DT_BOOL, false, 0, NULL,
515 "Print multiple messages separately"
516 },
517 { "quote_regex", DT_REGEX, IP "^([ \t]*[|>:}#])+", 0, NULL,
518 "Regex to match quoted text in a reply"
519 },
520 { "real_name", DT_STRING, 0, 0, NULL,
521 "Real name of the user"
522 },
523 { "record", DT_STRING|D_STRING_MAILBOX, IP "~/sent", 0, NULL,
524 "Folder to save 'sent' messages"
525 },
526 { "resolve", DT_BOOL, true, 0, NULL,
527 "Move to the next email whenever a command modifies an email"
528 },
529 { "resume_edited_draft_files", DT_BOOL, true, 0, NULL,
530 "Resume editing previously saved draft files"
531 },
532 { "save_address", DT_BOOL, false, 0, NULL,
533 "Use sender's full address as a default save folder"
534 },
535 { "save_empty", DT_BOOL, true, 0, NULL,
536 "(mbox,mmdf) Preserve empty mailboxes"
537 },
538 { "send_charset", DT_SLIST|D_SLIST_SEP_COLON|D_SLIST_ALLOW_EMPTY|D_CHARSET_STRICT, IP "us-ascii:iso-8859-1:utf-8", 0, charset_slist_validator,
539 "Character sets for outgoing mail"
540 },
541 { "shell", DT_STRING|D_STRING_COMMAND, IP "/bin/sh", 0, NULL,
542 "External command to run subshells in"
543 },
544 { "size_show_bytes", DT_BOOL, false, 0, NULL,
545 "Show smaller sizes in bytes"
546 },
547 { "size_show_fractions", DT_BOOL, true, 0, NULL,
548 "Show size fractions with a single decimal place"
549 },
550 { "size_show_mb", DT_BOOL, true, 0, NULL,
551 "Show sizes in megabytes for sizes greater than 1 megabyte"
552 },
553 { "size_units_on_left", DT_BOOL, false, 0, NULL,
554 "Show the units as a prefix to the size"
555 },
556 { "sleep_time", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 1, 0, NULL,
557 "Time to pause after certain info messages"
558 },
560 "Sort method for the index"
561 },
563 "Secondary sort method for the index"
564 },
565 { "spool_file", DT_STRING|D_STRING_MAILBOX, 0, 0, NULL,
566 "Inbox"
567 },
568 { "status_on_top", DT_BOOL, false, 0, NULL,
569 "Display the status bar at the top"
570 },
571 { "suspend", DT_BOOL, true, 0, NULL,
572 "Allow the user to suspend NeoMutt using '^Z'"
573 },
574 { "text_flowed", DT_BOOL, false, 0, NULL,
575 "Generate 'format=flowed' messages"
576 },
577 { "timeout", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 600, 0, NULL,
578 "Time to wait for user input in menus"
579 },
580 { "tmp_dir", DT_PATH|D_PATH_DIR|D_NOT_EMPTY, IP TMPDIR, 0, NULL,
581 "Directory for temporary files"
582 },
583 { "trash", DT_STRING|D_STRING_MAILBOX, 0, 0, NULL,
584 "Folder to put deleted emails"
585 },
586 { "use_domain", DT_BOOL, true, 0, NULL,
587 "Qualify local addresses using this domain"
588 },
589 { "use_threads", DT_ENUM, UT_UNSET, IP &UseThreadsTypeDef, NULL,
590 "Whether to use threads for the index"
591 },
592 { "wait_key", DT_BOOL, true, 0, NULL,
593 "Prompt to press a key after running external commands"
594 },
595 { "weed", DT_BOOL, true, 0, NULL,
596 "Filter headers when displaying/forwarding/printing/replying"
597 },
598 { "wrap", DT_NUMBER, 0, 0, NULL,
599 "Width to wrap text in the pager"
600 },
601 { "wrap_search", DT_BOOL, true, 0, NULL,
602 "Wrap around when the search hits the end"
603 },
604
605 { "cursor_overlay", D_INTERNAL_DEPRECATED|DT_BOOL, 0, IP "2020-07-20" },
606 { "escape", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2021-03-18" },
607 { "ignore_linear_white_space", D_INTERNAL_DEPRECATED|DT_BOOL, 0, IP "2021-03-18" },
608 { "mixmaster", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2024-05-30" },
609 { "mix_entry_format", D_INTERNAL_DEPRECATED|DT_EXPANDO,0, IP "2024-05-30" },
610 { "visual", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2021-03-18" },
611
612 { "autoedit", DT_SYNONYM, IP "auto_edit", IP "2021-03-21" },
613 { "confirmappend", DT_SYNONYM, IP "confirm_append", IP "2021-03-21" },
614 { "confirmcreate", DT_SYNONYM, IP "confirm_create", IP "2021-03-21" },
615 { "forw_decode", DT_SYNONYM, IP "forward_decode", IP "2021-03-21" },
616 { "forw_quote", DT_SYNONYM, IP "forward_quote", IP "2021-03-21" },
617 { "indent_str", DT_SYNONYM, IP "indent_string", IP "2021-03-21" },
618 { "message_cachedir", DT_SYNONYM, IP "message_cache_dir", IP "2023-01-25" },
619 { "print_cmd", DT_SYNONYM, IP "print_command", IP "2021-03-21" },
620 { "quote_regexp", DT_SYNONYM, IP "quote_regex", IP "2021-03-21" },
621 { "realname", DT_SYNONYM, IP "real_name", IP "2021-03-21" },
622 { "spoolfile", DT_SYNONYM, IP "spool_file", IP "2021-03-21" },
623 { "tmpdir", DT_SYNONYM, IP "tmp_dir", IP "2023-01-25" },
624
625 { "devel_security", DT_BOOL, false, 0, NULL,
626 "Devel feature: Security -- https://github.com/neomutt/neomutt/discussions/4251"
627 },
628
629 { NULL },
630 // clang-format on
631};
const struct ExpandoDefinition IndexFormatDef[]
Expando definitions.
GUI display the mailboxes in a side panel.
@ ED_ATT_NUMBER
AttachPtr.num.
Definition attach.h:55
@ ED_ATT_TREE
AttachPtr.tree.
Definition attach.h:56
@ ED_ATT_CHARSET
AttachPtr.body.
Definition attach.h:54
Convenience wrapper for the config headers.
#define IP
Definition set.h:54
Convenience wrapper for the core headers.
@ ED_MBX_MESSAGE_COUNT
Mailbox.msg_count.
Definition mailbox.h:158
@ ED_MBX_PERCENTAGE
EmailFormatInfo.pager_progress.
Definition mailbox.h:159
@ ED_MBX_MAILBOX_NAME
Mailbox, mailbox_path()
Definition mailbox.h:157
@ MUTT_MBOX
'mbox' Mailbox type
Definition mailbox.h:44
bool mutt_isalnum(int arg)
Wrapper for isalnum(3)
Definition ctype.c:40
uint8_t ExpandoParserFlags
Flags for expando_parse(), e.g. EP_CONDITIONAL.
Definition definition.h:33
#define EP_CONDITIONAL
Expando is being used as a condition.
Definition definition.h:35
@ ED_ENVELOPE
Envelope ED_ENV_ ExpandoDataEnvelope.
Definition domain.h:42
@ ED_EMAIL
Email ED_EMA_ ExpandoDataEmail.
Definition domain.h:41
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition domain.h:44
@ ED_BODY
Body ED_BOD_ ExpandoDataBody.
Definition domain.h:38
@ ED_MAILBOX
Mailbox ED_MBX_ ExpandoDataMailbox.
Definition domain.h:47
@ ED_ATTACH
Attach ED_ATT_ ExpandoDataAttach.
Definition domain.h:36
@ ED_BOD_DESCRIPTION
Body.description.
Definition body.h:106
@ ED_BOD_CHARSET_CONVERT
Body.type.
Definition body.h:104
@ ED_BOD_DELETED
Body.deleted.
Definition body.h:105
@ ED_BOD_UNLINK
Body.unlink.
Definition body.h:115
@ ED_BOD_FILE_SIZE
Body.filename.
Definition body.h:110
@ ED_BOD_DISPOSITION
Body.disposition.
Definition body.h:107
@ ED_BOD_ATTACH_QUALIFIES
Body.attach_qualifies.
Definition body.h:103
@ ED_BOD_MIME_MAJOR
Body.type, Body.xtype.
Definition body.h:112
@ ED_BOD_TAGGED
Body.tagged.
Definition body.h:114
@ ED_BOD_ATTACH_COUNT
Body.attach_count.
Definition body.h:102
@ ED_BOD_FILE
Body.filename.
Definition body.h:108
@ ED_BOD_MIME_MINOR
Body.subtype.
Definition body.h:113
@ ED_BOD_FILE_DISPOSITION
Body.d_filename.
Definition body.h:109
@ ED_BOD_MIME_ENCODING
Body.encoding.
Definition body.h:111
Structs that make up an email.
@ EMAIL_SORT_LABEL
Sort by the emails label.
Definition sort.h:57
@ EMAIL_SORT_DATE_RECEIVED
Sort by when the message was delivered locally.
Definition sort.h:55
@ EMAIL_SORT_SPAM
Sort by the email's spam score.
Definition sort.h:60
@ EMAIL_SORT_SCORE
Sort by the email's score.
Definition sort.h:58
@ EMAIL_SORT_DATE
Sort by the date the email was sent.
Definition sort.h:54
@ EMAIL_SORT_THREADS
Sort by email threads.
Definition sort.h:62
@ EMAIL_SORT_SUBJECT
Sort by the email's subject.
Definition sort.h:61
@ EMAIL_SORT_FROM
Sort by the email's From field.
Definition sort.h:56
@ EMAIL_SORT_UNSORTED
Sort by the order the messages appear in the mailbox.
Definition sort.h:64
@ EMAIL_SORT_SIZE
Sort by the size of the email.
Definition sort.h:59
@ EMAIL_SORT_TO
Sort by the email's To field.
Definition sort.h:63
@ ED_EMA_DATE_STRF_LOCAL
Email.date_sent.
Definition email.h:143
@ ED_EMA_ATTACHMENT_COUNT
Email, mutt_count_body_parts()
Definition email.h:136
@ ED_EMA_DATE_FORMAT_LOCAL
Email.date_sent.
Definition email.h:141
@ ED_EMA_TAGS_TRANSFORMED
Email.tags, driver_tags_get_transformed()
Definition email.h:156
@ ED_EMA_THREAD_HIDDEN_COUNT
Email.collapsed, Email.num_hidden, ...
Definition email.h:158
@ ED_EMA_DATE_FORMAT
Email.date_sent.
Definition email.h:140
@ ED_EMA_THREAD_TAGS
Email.tags.
Definition email.h:160
@ ED_EMA_TAGS
Email.tags.
Definition email.h:155
@ ED_EMA_SIZE
Body.length.
Definition email.h:152
@ ED_EMA_FLAG_CHARS
Email.deleted, Email.attach_del, ...
Definition email.h:144
@ ED_EMA_THREAD_NUMBER
Email, mutt_messages_in_thread()
Definition email.h:159
@ ED_EMA_TO_CHARS
Email, User_is_recipient()
Definition email.h:161
@ ED_EMA_BODY_CHARACTERS
Body.length.
Definition email.h:137
@ ED_EMA_COMBINED_FLAGS
Email.read, Email.old, thread_is_new(), ...
Definition email.h:138
@ ED_EMA_THREAD_COUNT
Email, mutt_messages_in_thread()
Definition email.h:157
@ ED_EMA_STATUS_FLAGS
Email.deleted, Email.attach_del, ...
Definition email.h:153
@ ED_EMA_NUMBER
Email.msgno.
Definition email.h:150
@ ED_EMA_DATE_STRF
Email.date_sent, Email.zhours, Email.zminutes, Email.zoccident.
Definition email.h:142
@ ED_EMA_FROM_LIST
Envelope.to, Envelope.cc.
Definition email.h:145
@ ED_EMA_SCORE
Email.score.
Definition email.h:151
@ ED_EMA_CRYPTO_FLAGS
Email.security, SecurityFlags.
Definition email.h:139
@ ED_EMA_STRF_RECV_LOCAL
Email.received.
Definition email.h:154
@ ED_EMA_LIST_OR_SAVE_FOLDER
Envelope.to, Envelope.cc, check_for_mailing_list()
Definition email.h:148
@ ED_EMA_INDEX_HOOK
Mailbox, Email, mutt_idxfmt_hook()
Definition email.h:146
@ ED_EMA_LINES
Email.lines.
Definition email.h:147
@ ED_EMA_MESSAGE_FLAGS
Email.tagged, Email.flagged.
Definition email.h:149
@ ED_ENV_SUBJECT
Envelope.subject, Envelope.disp_subj.
Definition envelope.h:116
@ ED_ENV_NEWSGROUP
Envelope.newsgroups.
Definition envelope.h:109
@ ED_ENV_INITIALS
Envelope.from (first)
Definition envelope.h:104
@ ED_ENV_FROM_FULL
Envelope.from (all)
Definition envelope.h:103
@ ED_ENV_X_COMMENT_TO
Envelope.x_comment_to.
Definition envelope.h:123
@ ED_ENV_FROM
Envelope.from (first)
Definition envelope.h:102
@ ED_ENV_LIST_ADDRESS
Envelope.to, Envelope.cc.
Definition envelope.h:105
@ ED_ENV_SPAM
Envelope.spam.
Definition envelope.h:115
@ ED_ENV_SENDER
Envelope, make_from()
Definition envelope.h:113
@ ED_ENV_TO_ALL
Envelope.to (all)
Definition envelope.h:120
@ ED_ENV_X_LABEL
Envelope.x_label.
Definition envelope.h:124
@ ED_ENV_NAME
Envelope.from (first)
Definition envelope.h:108
@ ED_ENV_CC_ALL
Envelope.cc.
Definition envelope.h:100
@ ED_ENV_ORGANIZATION
Envelope.organization.
Definition envelope.h:110
@ ED_ENV_REPLY_TO
Envelope.reply_to.
Definition envelope.h:112
@ ED_ENV_LIST_EMPTY
Envelope.to, Envelope.cc.
Definition envelope.h:106
@ ED_ENV_THREAD_X_LABEL
Envelope.x_label.
Definition envelope.h:118
@ ED_ENV_MESSAGE_ID
Envelope.message_id.
Definition envelope.h:107
@ ED_ENV_SENDER_PLAIN
Envelope, make_from()
Definition envelope.h:114
@ ED_ENV_USERNAME
Envelope.from.
Definition envelope.h:121
@ ED_ENV_THREAD_TREE
Email.tree.
Definition envelope.h:117
@ ED_ENV_TO
Envelope.to, Envelope.cc (first)
Definition envelope.h:119
@ ED_ENV_FIRST_NAME
Envelope.from, Envelope.to, Envelope.cc.
Definition envelope.h:101
Parse Expando string.
const struct Mapping SortMethods[]
Sort methods for '$sort' for the index.
Definition mutt_config.c:77
int sort_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "sort" config variable - Implements ConfigDef::validator() -.
Definition thread.c:105
int charset_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "charset" config variables - Implements ConfigDef::validator() -.
Definition charset.c:45
int charset_slist_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the multiple "charset" config variables - Implements ConfigDef::validator() -.
Definition charset.c:84
int debug_level_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "debug_level" config variable - Implements ConfigDef::validator() -.
struct ExpandoNode * node_padding_parse(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Padding Expando - Implements ExpandoDefinition::parse() -.
struct ExpandoNode * parse_index_format_hook(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse an index-hook - Implements ExpandoDefinition::parse() -.
struct ExpandoNode * parse_subject(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Subject Expando - Implements ExpandoDefinition::parse() -.
struct ExpandoNode * parse_index_date_recv_local(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Date Expando - Implements ExpandoDefinition::parse() -.
struct ExpandoNode * parse_index_date_local(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Date Expando - Implements ExpandoDefinition::parse() -.
struct ExpandoNode * parse_index_date(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Date Expando - Implements ExpandoDefinition::parse() -.
struct ExpandoNode * parse_tags_transformed(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Tags-Transformed Expando - Implements ExpandoDefinition::parse() -.
int node_condbool_render(const struct ExpandoNode *node, const struct ExpandoRenderCallback *erc, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Callback for every bool node - Implements ExpandoNode::render() -.
Convenience wrapper for the gui headers.
const struct EnumDef UseThreadsTypeDef
Data for the $use_threads enumeration.
Definition thread.c:64
@ UT_UNSET
Not yet set by user, stick to legacy semantics.
Definition thread.h:97
struct ConfigDef MainVars[]
General Config definitions for NeoMutt.
Convenience wrapper for the library headers.
#define _(a)
Definition message.h:28
char * mutt_strn_dup(const char *begin, size_t len)
Duplicate a sub-string.
Definition string.c:384
static const struct ExpandoDefinition *const IndexFormatDefNoPadding
IndexFormatDefNoPadding - Index format definitions, without padding.
static const struct Mapping SortAuxMethods[]
Sort methods for '$sort_aux' for the index.
Definition mutt_config.c:54
static const struct ExpandoDefinition AttachFormatDef[]
Expando definitions.
NeoMutt Logging.
const struct EnumDef MboxTypeDef
Data for the $mbox_type enumeration.
Definition mx.c:89
API for mailboxes.
void node_add_child(struct ExpandoNode *node, struct ExpandoNode *child)
Add a child to an ExpandoNode.
Definition node.c:76
void node_free(struct ExpandoNode **ptr)
Free an ExpandoNode and its private data.
Definition node.c:48
@ ENT_CONDBOOL
True/False boolean condition.
Definition node.h:42
struct ExpandoNode * node_conddate_parse(const char *str, int did, int uid, const char **parsed_until, struct ExpandoParseError *err)
Parse a CondDate format string.
struct ExpandoNode * node_container_new(void)
Create a new Container ExpandoNode.
struct ExpandoNode * node_expando_new(struct ExpandoFormat *fmt, int did, int uid)
Create a new Expando ExpandoNode.
struct ExpandoNode * node_expando_parse_enclosure(const char *str, int did, int uid, char terminator, struct ExpandoFormat *fmt, const char **parsed_until, struct ExpandoParseError *err)
Parse an enclosed Expando.
@ MUTT_ASKNO
Ask the user, defaulting to 'No'.
Definition quad.h:40
@ MUTT_NO
User answered 'No', or assume 'No'.
Definition quad.h:38
@ MUTT_ASKYES
Ask the user, defaulting to 'Yes'.
Definition quad.h:41
#define NONULL(x)
Definition string2.h:44
Definition of a format string.
Definition definition.h:43
Formatting information for an Expando.
Definition node.h:53
Basic Expando Node.
Definition node.h:67
int uid
Unique ID, e.g. ED_EMA_SIZE.
Definition node.h:70
struct ExpandoFormat * format
Formatting info.
Definition node.h:72
int(* render)(const struct ExpandoNode *node, const struct ExpandoRenderCallback *erc, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Definition node.h:92
int did
Domain ID, e.g. ED_EMAIL.
Definition node.h:69
const char * text
Node-specific text.
Definition node.h:73
enum ExpandoNodeType type
Type of Node, e.g. ENT_EXPANDO.
Definition node.h:68
Buffer for parsing errors.
Definition parse.h:37
char message[1024]
Error message.
Definition parse.h:38
const char * position
Position of error in original string.
Definition parse.h:39
Mapping between user-readable string and a constant.
Definition mapping.h:33
#define D_CHARSET_SINGLE
Flag for charset_validator to allow only one charset.
Definition types.h:84
#define D_SLIST_SEP_COLON
Slist items are colon-separated.
Definition types.h:112
#define D_INTERNAL_DEPRECATED
Config item shouldn't be used any more.
Definition types.h:88
#define D_STRING_COMMAND
A command.
Definition types.h:99
#define D_SLIST_ALLOW_EMPTY
Slist may be empty.
Definition types.h:116
#define D_PATH_DIR
Path is a directory.
Definition types.h:103
#define D_CHARSET_STRICT
Flag for charset_validator to use strict char check.
Definition types.h:85
#define D_PATH_FILE
Path is a file.
Definition types.h:104
@ DT_NUMBER
a number
Definition types.h:38
@ DT_SLIST
a list of strings
Definition types.h:42
@ DT_BOOL
boolean option
Definition types.h:32
@ DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition types.h:40
@ DT_SYNONYM
synonym for another variable
Definition types.h:45
@ DT_STRING
a string
Definition types.h:44
@ DT_SORT
sorting methods
Definition types.h:43
@ DT_ADDRESS
e-mail address
Definition types.h:31
@ DT_EXPANDO
an expando
Definition types.h:34
@ DT_ENUM
an enumeration
Definition types.h:33
@ DT_REGEX
regular expressions
Definition types.h:41
@ DT_PATH
a path to a file/directory
Definition types.h:39
#define D_STRING_MAILBOX
Don't perform path expansions.
Definition types.h:98
#define D_SORT_LAST
Sort flag for -last prefix.
Definition types.h:119
#define D_SORT_REVERSE
Sort flag for -reverse prefix.
Definition types.h:120
#define D_NOT_EMPTY
Empty strings are not allowed.
Definition types.h:80
#define D_INTEGER_NOT_NEGATIVE
Negative numbers are not allowed.
Definition types.h:101
#define D_ON_STARTUP
May only be set at startup.
Definition types.h:79
@ ED_GLO_PADDING_EOL
Padding to end-of-line.
Definition uid.h:38
@ ED_GLO_PADDING_HARD
Hard Padding.
Definition uid.h:39
@ ED_GLO_PADDING_SOFT
Soft Padding.
Definition uid.h:40