NeoMutt  2025-12-11-911-gd8d604
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 <stdint.h>
38#include <stdio.h>
39#include <string.h>
40#include "mutt/lib.h"
41#include "config/lib.h"
42#include "email/lib.h"
43#include "core/lib.h"
44#include "gui/lib.h"
45#include "attach/lib.h"
46#include "expando/lib.h"
47#include "mutt_logging.h"
48#include "mx.h"
49
50extern const struct ExpandoDefinition IndexFormatDef[];
51
55static int key_timeout_validator(const struct ConfigDef *cdef, intptr_t value,
56 struct Buffer *err)
57{
58 const int min_timeout = 50;
59 const int max_timeout = 10000;
60
61 if ((value >= min_timeout) && (value <= max_timeout))
62 return CSR_SUCCESS;
63
64 // L10N: This applies to the "$key_timeout_idle" and "$key_timeout_partial" config variables.
65 buf_printf(err, _("Option %s must be between %d and %d inclusive"),
66 cdef->name, min_timeout, max_timeout);
67 return CSR_ERR_INVALID;
68}
69
73static const struct Mapping SortAuxMethods[] = {
74 // clang-format off
75 { "date", EMAIL_SORT_DATE },
76 { "date-received", EMAIL_SORT_DATE_RECEIVED },
77 { "from", EMAIL_SORT_FROM },
78 { "label", EMAIL_SORT_LABEL },
79 { "score", EMAIL_SORT_SCORE },
80 { "size", EMAIL_SORT_SIZE },
81 { "spam", EMAIL_SORT_SPAM },
82 { "subject", EMAIL_SORT_SUBJECT },
83 { "to", EMAIL_SORT_TO },
84 { "unsorted", EMAIL_SORT_UNSORTED },
85 // Compatibility
86 { "date-sent", EMAIL_SORT_DATE },
87 { "mailbox-order", EMAIL_SORT_UNSORTED },
88 { "threads", EMAIL_SORT_DATE },
89 { NULL, 0 },
90 // clang-format on
91};
92
96const struct Mapping SortMethods[] = {
97 // clang-format off
98 { "date", EMAIL_SORT_DATE },
99 { "date-received", EMAIL_SORT_DATE_RECEIVED },
100 { "from", EMAIL_SORT_FROM },
101 { "label", EMAIL_SORT_LABEL },
102 { "score", EMAIL_SORT_SCORE },
103 { "size", EMAIL_SORT_SIZE },
104 { "spam", EMAIL_SORT_SPAM },
105 { "subject", EMAIL_SORT_SUBJECT },
106 { "threads", EMAIL_SORT_THREADS },
107 { "to", EMAIL_SORT_TO },
108 { "unsorted", EMAIL_SORT_UNSORTED },
109 // Compatibility
110 { "date-sent", EMAIL_SORT_DATE },
111 { "mailbox-order", EMAIL_SORT_UNSORTED },
112 { NULL, 0 },
113 // clang-format on
114};
115
122static const struct ExpandoDefinition AttachFormatDef[] = {
123 // clang-format off
124 { "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
125 { ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
126 { "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
127 { "c", "charset-convert", ED_BODY, ED_BOD_CHARSET_CONVERT, NULL },
128 { "C", "charset", ED_ATTACH, ED_ATT_CHARSET, NULL },
129 { "d", "description", ED_BODY, ED_BOD_DESCRIPTION, NULL },
130 { "D", "deleted", ED_BODY, ED_BOD_DELETED, NULL },
131 { "e", "mime-encoding", ED_BODY, ED_BOD_MIME_ENCODING, NULL },
132 { "f", "file", ED_BODY, ED_BOD_FILE, NULL },
133 { "F", "file-disposition", ED_BODY, ED_BOD_FILE_DISPOSITION, NULL },
134 { "I", "disposition", ED_BODY, ED_BOD_DISPOSITION, NULL },
135 { "m", "mime-major", ED_BODY, ED_BOD_MIME_MAJOR, NULL },
136 { "M", "mime-minor", ED_BODY, ED_BOD_MIME_MINOR, NULL },
137 { "n", "number", ED_ATTACH, ED_ATT_NUMBER, NULL },
138 { "Q", "attach-qualifies", ED_BODY, ED_BOD_ATTACH_QUALIFIES, NULL },
139 { "s", "file-size", ED_BODY, ED_BOD_FILE_SIZE, NULL },
140 { "t", "tagged", ED_BODY, ED_BOD_TAGGED, NULL },
141 { "T", "tree", ED_ATTACH, ED_ATT_TREE, NULL },
142 { "u", "unlink", ED_BODY, ED_BOD_UNLINK, NULL },
143 { "X", "attach-count", ED_BODY, ED_BOD_ATTACH_COUNT, NULL },
144 { NULL, NULL, 0, -1, NULL }
145 // clang-format on
146};
147
155 struct ExpandoFormat *fmt, int did,
156 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_local(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 return node_expando_parse_enclosure(str, did, uid, ']', fmt, parsed_until, err);
185}
186
193struct ExpandoNode *parse_index_date(const char *str, struct ExpandoFormat *fmt,
194 int did, int uid, ExpandoParserFlags flags,
195 const char **parsed_until,
196 struct ExpandoParseError *err)
197{
198 if (flags & EP_CONDITIONAL)
199 {
200 return node_conddate_parse(str, did, uid, parsed_until, err);
201 }
202
203 struct ExpandoNode *node = node_expando_parse_enclosure(str, did, uid, '}',
204 fmt, parsed_until, err);
205 if (!node)
206 return NULL;
207
208 const char *pc = strchr(NONULL(node->text), '%');
209 if (!pc)
210 {
211 snprintf(err->message, sizeof(err->message), _("Unknown expando: %%{%s}"), node->text);
212 err->position = str;
213 node_free(&node);
214 }
215
216 return node;
217}
218
226struct ExpandoNode *parse_index_format_hook(const char *str, struct ExpandoFormat *fmt,
227 int did, int uid, ExpandoParserFlags flags,
228 const char **parsed_until,
229 struct ExpandoParseError *err)
230{
231 if (flags & EP_CONDITIONAL)
232 {
233 snprintf(err->message, sizeof(err->message),
234 _("index-hook cannot be used as a condition"));
235 err->position = str;
236 return NULL;
237 }
238
239 return node_expando_parse_enclosure(str, did, uid, '@', fmt, parsed_until, err);
240}
241
247struct ExpandoNode *parse_tags_transformed(const char *str, struct ExpandoFormat *fmt,
248 int did, int uid, ExpandoParserFlags flags,
249 const char **parsed_until,
250 struct ExpandoParseError *err)
251{
252 // Tag expando %G must use a suffix from [A-Za-z0-9], e.g. %Ga, %GL
253 if (!mutt_isalnum(str[1]))
254 return NULL;
255
256 struct ExpandoNode *node = node_expando_new(fmt, did, uid);
257
258 node->text = mutt_strn_dup(str, 2);
259
260 if (flags & EP_CONDITIONAL)
261 {
262 node->type = ENT_CONDBOOL;
264 }
265
266 (*parsed_until) = str + 2;
267
268 return node;
269}
270
277struct ExpandoNode *parse_subject(const char *str, struct ExpandoFormat *fmt,
278 int did, int uid, ExpandoParserFlags flags,
279 const char **parsed_until, struct ExpandoParseError *err)
280{
281 struct ExpandoNode *node_subj = node_expando_new(NULL, did, uid);
283 struct ExpandoNode *node_cont = node_container_new();
284
285 // Apply the formatting info to the container
286 node_cont->format = fmt;
287
288 node_add_child(node_cont, node_tree);
289 node_add_child(node_cont, node_subj);
290
291 if (*parsed_until[0] != '}')
292 (*parsed_until)++;
293
294 return node_cont;
295}
296
313 // clang-format off
314 { "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
315 { ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
316 { "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
319 { "a", "from", ED_ENVELOPE, ED_ENV_FROM, NULL },
320 { "A", "reply-to", ED_ENVELOPE, ED_ENV_REPLY_TO, NULL },
321 { "b", "mailbox-name", ED_MAILBOX, ED_MBX_MAILBOX_NAME, NULL },
322 { "B", "list-address", ED_ENVELOPE, ED_ENV_LIST_ADDRESS, NULL },
323 { "cr", "body-characters", ED_EMAIL, ED_EMA_BODY_CHARACTERS, NULL },
324 { "c", "size", ED_EMAIL, ED_EMA_SIZE, NULL },
325 { "C", "number", ED_EMAIL, ED_EMA_NUMBER, NULL },
326 { "d", "date-format", ED_EMAIL, ED_EMA_DATE_FORMAT, NULL },
327 { "D", "date-format-local", ED_EMAIL, ED_EMA_DATE_FORMAT_LOCAL, NULL },
328 { "e", "thread-number", ED_EMAIL, ED_EMA_THREAD_NUMBER, NULL },
329 { "E", "thread-count", ED_EMAIL, ED_EMA_THREAD_COUNT, NULL },
330 { "f", "from-full", ED_ENVELOPE, ED_ENV_FROM_FULL, NULL },
331 { "Fp", "sender-plain", ED_ENVELOPE, ED_ENV_SENDER_PLAIN, NULL },
332 { "F", "sender", ED_ENVELOPE, ED_ENV_SENDER, NULL },
333 { "g", "tags", ED_EMAIL, ED_EMA_TAGS, NULL },
334 { "G", "tags-transformed", ED_EMAIL, ED_EMA_TAGS_TRANSFORMED, parse_tags_transformed },
335 { "H", "spam", ED_ENVELOPE, ED_ENV_SPAM, NULL },
336 { "i", "message-id", ED_ENVELOPE, ED_ENV_MESSAGE_ID, NULL },
337 { "I", "initials", ED_ENVELOPE, ED_ENV_INITIALS, NULL },
338 { "J", "thread-tags", ED_EMAIL, ED_EMA_THREAD_TAGS, NULL },
339 { "K", "list-empty", ED_ENVELOPE, ED_ENV_LIST_EMPTY, NULL },
340 { "l", "lines", ED_EMAIL, ED_EMA_LINES, NULL },
341 { "L", "from-list", ED_EMAIL, ED_EMA_FROM_LIST, NULL },
342 { "m", "message-count", ED_MAILBOX, ED_MBX_MESSAGE_COUNT, NULL },
343 { "M", "thread-hidden-count", ED_EMAIL, ED_EMA_THREAD_HIDDEN_COUNT, NULL },
344 { "n", "name", ED_ENVELOPE, ED_ENV_NAME, NULL },
345 { "N", "score", ED_EMAIL, ED_EMA_SCORE, NULL },
346 { "O", "save-folder", ED_EMAIL, ED_EMA_LIST_OR_SAVE_FOLDER, NULL },
347 { "P", "percentage", ED_MAILBOX, ED_MBX_PERCENTAGE, NULL },
348 { "q", "newsgroup", ED_ENVELOPE, ED_ENV_NEWSGROUP, NULL },
349 { "r", "to-all", ED_ENVELOPE, ED_ENV_TO_ALL, NULL },
350 { "R", "cc-all", ED_ENVELOPE, ED_ENV_CC_ALL, NULL },
351 { "s", "subject", ED_ENVELOPE, ED_ENV_SUBJECT, parse_subject },
352 { "S", "flag-chars", ED_EMAIL, ED_EMA_FLAG_CHARS, NULL },
353 { "t", "to", ED_ENVELOPE, ED_ENV_TO, NULL },
354 { "T", "to-chars", ED_EMAIL, ED_EMA_TO_CHARS, NULL },
355 { "u", "username", ED_ENVELOPE, ED_ENV_USERNAME, NULL },
356 { "v", "first-name", ED_ENVELOPE, ED_ENV_FIRST_NAME, NULL },
357 { "W", "organization", ED_ENVELOPE, ED_ENV_ORGANIZATION, NULL },
358 { "x", "x-comment-to", ED_ENVELOPE, ED_ENV_X_COMMENT_TO, NULL },
359 { "X", "attachment-count", ED_EMAIL, ED_EMA_ATTACHMENT_COUNT, NULL },
360 { "y", "x-label", ED_ENVELOPE, ED_ENV_X_LABEL, NULL },
361 { "Y", "thread-x-label", ED_ENVELOPE, ED_ENV_THREAD_X_LABEL, NULL },
362 { "Z", "combined-flags", ED_EMAIL, ED_EMA_COMBINED_FLAGS, NULL },
363 { "zc", "crypto-flags", ED_EMAIL, ED_EMA_CRYPTO_FLAGS, NULL },
364 { "zs", "status-flags", ED_EMAIL, ED_EMA_STATUS_FLAGS, NULL },
365 { "zt", "message-flags", ED_EMAIL, ED_EMA_MESSAGE_FLAGS, NULL },
368 { NULL, NULL, 0, -1, NULL }
369 // clang-format on
370};
371
374
378struct ConfigDef MainVars[] = {
379 // clang-format off
380 { "abort_backspace", DT_BOOL, true, 0, NULL,
381 "Hitting backspace against an empty prompt aborts the prompt"
382 },
383 { "abort_key", DT_STRING|D_NOT_EMPTY|D_ON_STARTUP, IP "\007", 0, NULL,
384 "String representation of key to abort prompts"
385 },
386 { "ascii_chars", DT_BOOL, false, 0, NULL,
387 "Use plain ASCII characters, when drawing email threads"
388 },
390 "If a message is missing a character set, assume this character set"
391 },
392 { "attach_format", DT_EXPANDO|D_NOT_EMPTY, IP "%u%D%I %t%4n %T%d %> [%.7m/%.10M, %.6e%<C?, %C>, %s] ", IP &AttachFormatDef, NULL,
393 "printf-like format string for the attachment menu"
394 },
395 { "auto_edit", DT_BOOL, false, 0, NULL,
396 "Skip the initial compose menu and edit the email"
397 },
398 { "auto_tag", DT_BOOL, false, 0, NULL,
399 "Automatically apply actions to all tagged messages"
400 },
401 { "braille_friendly", DT_BOOL, false, 0, NULL,
402 "Move the cursor to the beginning of the line"
403 },
405 "Default character set for displaying text on screen"
406 },
407 { "config_charset", DT_STRING, 0, 0, charset_validator,
408 "Character set that the config files are in"
409 },
410 { "confirm_append", DT_BOOL, true, 0, NULL,
411 "Confirm before appending emails to a mailbox"
412 },
413 { "confirm_create", DT_BOOL, true, 0, NULL,
414 "Confirm before creating a new mailbox"
415 },
416 { "copy_decode_weed", DT_BOOL, false, 0, NULL,
417 "Controls whether to weed headers when copying or saving emails"
418 },
419 { "date_format", DT_STRING|D_NOT_EMPTY, IP "!%a, %b %d, %Y at %I:%M:%S%p %Z", 0, NULL,
420 "strftime format string for the `%d` expando"
421 },
422 { "debug_file", DT_PATH|D_PATH_FILE, IP "~/.neomuttdebug", 0, NULL,
423 "File to save debug logs"
424 },
425 { "debug_level", DT_NUMBER, 0, 0, debug_level_validator,
426 "Logging level for debug logs"
427 },
428 { "delete", DT_QUAD, MUTT_ASKYES, 0, NULL,
429 "Really delete messages, when the mailbox is closed"
430 },
431 { "delete_untag", DT_BOOL, true, 0, NULL,
432 "Untag messages when they are marked for deletion"
433 },
434 { "editor", DT_STRING|D_NOT_EMPTY|D_STRING_COMMAND, 0, 0, NULL,
435 "External command to use as an email editor"
436 },
437 { "flag_safe", DT_BOOL, false, 0, NULL,
438 "Protect flagged messages from deletion"
439 },
440 { "folder", DT_STRING|D_STRING_MAILBOX, IP "~/Mail", 0, NULL,
441 "Base folder for a set of mailboxes"
442 },
443 { "forward_decode", DT_BOOL, true, 0, NULL,
444 "Decode the message when forwarding it"
445 },
446 { "forward_quote", DT_BOOL, false, 0, NULL,
447 "Automatically quote a forwarded message using `$indent_string`"
448 },
449 { "from", DT_ADDRESS, 0, 0, NULL,
450 "Default 'From' address to use, if isn't otherwise set"
451 },
452 { "gecos_mask", DT_REGEX, IP "^[^,]*", 0, NULL,
453 "Regex for parsing GECOS field of /etc/passwd"
454 },
455 { "header", DT_BOOL, false, 0, NULL,
456 "Include the message headers in the reply email (Weed applies)"
457 },
458 { "hostname", DT_STRING, 0, 0, NULL,
459 "Fully-qualified domain name of this machine"
460 },
461 { "indent_string", DT_EXPANDO, IP "> ", IP IndexFormatDefNoPadding, NULL,
462 "String used to indent 'reply' text"
463 },
464 { "keep_flagged", DT_BOOL, false, 0, NULL,
465 "Don't move flagged messages from `$spool_file` to `$mbox`"
466 },
467 { "key_timeout_idle", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 1000, 0, key_timeout_validator,
468 "Timeout (ms) before the first keypress"
469 },
470 { "key_timeout_partial", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 700, 0, key_timeout_validator,
471 "Timeout (ms) to wait for more keys after a partial match"
472 },
473 { "local_date_header", DT_BOOL, true, 0, NULL,
474 "Convert the date in the Date header of sent emails into local timezone, UTC otherwise"
475 },
476 { "macro_repeat_max", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 1000, 0, NULL,
477 "Maximum number of times a macro may be repeated via a numeric prefix"
478 },
479 { "mail_check", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 5, 0, NULL,
480 "Number of seconds before NeoMutt checks for new mail"
481 },
482 { "mail_check_recent", DT_BOOL, true, 0, NULL,
483 "Notify the user about new mail since the last time the mailbox was opened"
484 },
485 { "mail_check_stats", DT_BOOL, false, 0, NULL,
486 "Periodically check for new mail"
487 },
488 { "mail_check_stats_interval", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 60, 0, NULL,
489 "How often to check for new mail"
490 },
491 { "mark_old", DT_BOOL, true, 0, NULL,
492 "Mark new emails as old when leaving the mailbox"
493 },
494 { "mbox", DT_STRING|D_STRING_MAILBOX, IP "~/mbox", 0, NULL,
495 "Folder that receives read emails (see Move)"
496 },
497 { "mbox_type", DT_ENUM, MUTT_MBOX, IP &MboxTypeDef, NULL,
498 "Default type for creating new mailboxes"
499 },
500 { "message_cache_clean", DT_BOOL, false, 0, NULL,
501 "(imap/pop) Clean out obsolete entries from the message cache"
502 },
503 { "message_cache_dir", DT_PATH|D_PATH_DIR, 0, 0, NULL,
504 "(imap/pop) Directory for the message cache"
505 },
506 { "meta_key", DT_BOOL, false, 0, NULL,
507 "Interpret 'ALT-x' as 'ESC-x'"
508 },
509 { "move", DT_QUAD, MUTT_NO, 0, NULL,
510 "Move emails from `$spool_file` to `$mbox` when read"
511 },
512 { "pipe_decode", DT_BOOL, false, 0, NULL,
513 "Decode the message when piping it"
514 },
515 { "pipe_decode_weed", DT_BOOL, true, 0, NULL,
516 "Control whether to weed headers when piping an email"
517 },
518 { "pipe_sep", DT_STRING, IP "\n", 0, NULL,
519 "Separator to add between multiple piped messages"
520 },
521 { "pipe_split", DT_BOOL, false, 0, NULL,
522 "Run the pipe command on each message separately"
523 },
524 { "postponed", DT_STRING|D_STRING_MAILBOX, IP "~/postponed", 0, NULL,
525 "Folder to store postponed messages"
526 },
527 { "print", DT_QUAD, MUTT_ASKNO, 0, NULL,
528 "Confirm before printing a message"
529 },
530 { "print_command", DT_STRING|D_STRING_COMMAND, IP "lpr", 0, NULL,
531 "External command to print a message"
532 },
533 { "print_decode", DT_BOOL, true, 0, NULL,
534 "Decode message before printing it"
535 },
536 { "print_decode_weed", DT_BOOL, true, 0, NULL,
537 "Control whether to weed headers when printing an email"
538 },
539 { "print_split", DT_BOOL, false, 0, NULL,
540 "Print multiple messages separately"
541 },
542 { "quote_regex", DT_REGEX, IP "^([ \t]*[|>:}#])+", 0, NULL,
543 "Regex to match quoted text in a reply"
544 },
545 { "real_name", DT_STRING, 0, 0, NULL,
546 "Real name of the user"
547 },
548 { "record", DT_STRING|D_STRING_MAILBOX, IP "~/sent", 0, NULL,
549 "Folder to save 'sent' messages"
550 },
551 { "resolve", DT_BOOL, true, 0, NULL,
552 "Move to the next email whenever a command modifies an email"
553 },
554 { "resume_edited_draft_files", DT_BOOL, true, 0, NULL,
555 "Resume editing previously saved draft files"
556 },
557 { "save_address", DT_BOOL, false, 0, NULL,
558 "Use sender's full address as a default save folder"
559 },
560 { "save_empty", DT_BOOL, true, 0, NULL,
561 "(mbox,mmdf) Preserve empty mailboxes"
562 },
563 { "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,
564 "Character sets for outgoing mail"
565 },
566 { "shell", DT_STRING|D_STRING_COMMAND, IP "/bin/sh", 0, NULL,
567 "External command to run subshells in"
568 },
569 { "size_show_bytes", DT_BOOL, false, 0, NULL,
570 "Show smaller sizes in bytes"
571 },
572 { "size_show_fractions", DT_BOOL, true, 0, NULL,
573 "Show size fractions with a single decimal place"
574 },
575 { "size_show_mb", DT_BOOL, true, 0, NULL,
576 "Show sizes in megabytes for sizes greater than 1 megabyte"
577 },
578 { "size_units_on_left", DT_BOOL, false, 0, NULL,
579 "Show the units as a prefix to the size"
580 },
581 { "sleep_time", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 1, 0, NULL,
582 "Time to pause after certain info messages"
583 },
585 "Sort method for the index"
586 },
588 "Secondary sort method for the index"
589 },
590 { "spool_file", DT_STRING|D_STRING_MAILBOX, 0, 0, NULL,
591 "Inbox"
592 },
593 { "status_on_top", DT_BOOL, false, 0, NULL,
594 "Display the status bar at the top"
595 },
596 { "suspend", DT_BOOL, true, 0, NULL,
597 "Allow the user to suspend NeoMutt using '^Z'"
598 },
599 { "text_flowed", DT_BOOL, false, 0, NULL,
600 "Generate 'format=flowed' messages"
601 },
602 { "timeout", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 600, 0, NULL,
603 "Time to wait for user input in menus"
604 },
605 { "tmp_dir", DT_PATH|D_PATH_DIR|D_NOT_EMPTY, IP TMPDIR, 0, NULL,
606 "Directory for temporary files"
607 },
608 { "tmp_draft_dir", DT_PATH|D_PATH_DIR|D_NOT_EMPTY, IP "/var/tmp", 0, NULL,
609 "Directory for temporary draft files"
610 },
611 { "trash", DT_STRING|D_STRING_MAILBOX, 0, 0, NULL,
612 "Folder to put deleted emails"
613 },
614 { "use_domain", DT_BOOL, true, 0, NULL,
615 "Qualify local addresses using this domain"
616 },
617 { "use_threads", DT_ENUM, UT_UNSET, IP &UseThreadsTypeDef, NULL,
618 "Whether to use threads for the index"
619 },
620 { "wait_key", DT_BOOL, true, 0, NULL,
621 "Prompt to press a key after running external commands"
622 },
623 { "weed", DT_BOOL, true, 0, NULL,
624 "Filter headers when displaying/forwarding/printing/replying"
625 },
626 { "wrap", DT_NUMBER, 0, 0, NULL,
627 "Width to wrap text in the pager"
628 },
629 { "wrap_search", DT_BOOL, true, 0, NULL,
630 "Wrap around when the search hits the end"
631 },
632
633 { "cursor_overlay", D_INTERNAL_DEPRECATED|DT_BOOL, 0, IP "2020-07-20" },
634 { "escape", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2021-03-18" },
635 { "ignore_linear_white_space", D_INTERNAL_DEPRECATED|DT_BOOL, 0, IP "2021-03-18" },
636 { "mixmaster", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2024-05-30" },
637 { "mix_entry_format", D_INTERNAL_DEPRECATED|DT_EXPANDO,0, IP "2024-05-30" },
638 { "visual", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2021-03-18" },
639
640 { "autoedit", DT_SYNONYM, IP "auto_edit", IP "2021-03-21" },
641 { "confirmappend", DT_SYNONYM, IP "confirm_append", IP "2021-03-21" },
642 { "confirmcreate", DT_SYNONYM, IP "confirm_create", IP "2021-03-21" },
643 { "forw_decode", DT_SYNONYM, IP "forward_decode", IP "2021-03-21" },
644 { "forw_quote", DT_SYNONYM, IP "forward_quote", IP "2021-03-21" },
645 { "indent_str", DT_SYNONYM, IP "indent_string", IP "2021-03-21" },
646 { "message_cachedir", DT_SYNONYM, IP "message_cache_dir", IP "2023-01-25" },
647 { "print_cmd", DT_SYNONYM, IP "print_command", IP "2021-03-21" },
648 { "quote_regexp", DT_SYNONYM, IP "quote_regex", IP "2021-03-21" },
649 { "realname", DT_SYNONYM, IP "real_name", IP "2021-03-21" },
650 { "spoolfile", DT_SYNONYM, IP "spool_file", IP "2021-03-21" },
651 { "tmpdir", DT_SYNONYM, IP "tmp_dir", IP "2023-01-25" },
652 { "tmpdraftdir", DT_SYNONYM, IP "tmp_draft_dir", IP "2026-03-14" },
653
654 { "devel_security", DT_BOOL, false, 0, NULL,
655 "Devel feature: Security -- https://github.com/neomutt/neomutt/discussions/4251"
656 },
657
658 { NULL },
659 // clang-format on
660};
const struct ExpandoDefinition IndexFormatDef[]
Expando definitions.
GUI display the mailboxes in a side panel.
@ ED_ATT_NUMBER
AttachPtr.num.
Definition attach.h:57
@ ED_ATT_TREE
AttachPtr.tree.
Definition attach.h:58
@ ED_ATT_CHARSET
AttachPtr.body.
Definition attach.h:56
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition buffer.c:161
Convenience wrapper for the config headers.
#define CSR_ERR_INVALID
Value hasn't been set.
Definition set.h:36
#define CSR_SUCCESS
Action completed successfully.
Definition set.h:33
#define IP
Definition set.h:55
Convenience wrapper for the core headers.
@ ED_MBX_MESSAGE_COUNT
Mailbox.msg_count.
Definition mailbox.h:161
@ ED_MBX_PERCENTAGE
EmailFormatInfo.pager_progress.
Definition mailbox.h:162
@ ED_MBX_MAILBOX_NAME
Mailbox, mailbox_path()
Definition mailbox.h:160
@ 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
Definition definition.h:41
@ EP_CONDITIONAL
Expando is being used as a condition.
Definition definition.h:39
@ 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:96
static int key_timeout_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate key_timeout_idle and key_timeout_partial - Implements ConfigDef::validator() -.
Definition mutt_config.c:55
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:103
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:73
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
String manipulation buffer.
Definition buffer.h:36
const char * name
User-visible name.
Definition set.h:66
Definition of a format string.
Definition definition.h:49
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