128#define GNULIB_defined_setlocale
185#if defined(USE_DEBUG_NOTIFY) || defined(USE_DEBUG_BACKTRACE)
193#define MUTT_CLI_NO_FLAGS 0
194#define MUTT_CLI_IGNORE (1 << 0)
195#define MUTT_CLI_MAILBOX (1 << 1)
196#define MUTT_CLI_NOSYSRC (1 << 2)
197#define MUTT_CLI_RO (1 << 3)
198#define MUTT_CLI_SELECT (1 << 4)
199#define MUTT_CLI_NEWS (1 << 5)
208 static const char *names[] = {
"folder",
"mbox",
"postponed",
"record" };
232 static const char *names[] = {
235 "forward_attribution_intro",
236 "forward_attribution_trailer",
253 const char *l10n = gettext(
buf_string(value));
269#ifdef USE_DEBUG_BACKTRACE
287 puts(
_(
" neomutt [-CEn] [-e <command>] [-F <config>] [-H <draft>] [-i <include>]\n"
288 " [-b <address>] [-c <address>] [-s <subject>] [-a <file> [...] --]\n"
289 " <address> [...]"));
290 puts(
_(
" neomutt [-Cn] [-e <command>] [-F <config>] [-b <address>] [-c <address>]\n"
291 " [-s <subject>] [-a <file> [...] --] <address> [...] < message"));
292 puts(
_(
" neomutt [-nRy] [-e <command>] [-F <config>] [-f <mailbox>] [-m <type>]"));
293 puts(
_(
" neomutt [-n] [-e <command>] [-F <config>] -A <alias>"));
294 puts(
_(
" neomutt [-n] [-e <command>] [-F <config>] -B"));
295 puts(
_(
" neomutt [-n] [-e <command>] [-F <config>] -D [-S] [-O]"));
296 puts(
_(
" neomutt [-n] [-e <command>] [-F <config>] -d <level> -l <file>"));
297 puts(
_(
" neomutt [-n] [-e <command>] [-F <config>] -G"));
298 puts(
_(
" neomutt [-n] [-e <command>] [-F <config>] -g <server>"));
299 puts(
_(
" neomutt [-n] [-e <command>] [-F <config>] -p"));
300 puts(
_(
" neomutt [-n] [-e <command>] [-F <config>] -Q <variable> [-O]"));
301 puts(
_(
" neomutt [-n] [-e <command>] [-F <config>] -Z"));
302 puts(
_(
" neomutt [-n] [-e <command>] [-F <config>] -z [-f <mailbox>]"));
303 puts(
_(
" neomutt -v[v]\n"));
307 puts(
_(
" -- Special argument forces NeoMutt to stop option parsing and treat\n"
308 " remaining arguments as addresses even if they start with a dash"));
309 puts(
_(
" -A <alias> Print an expanded version of the given alias to stdout and exit"));
310 puts(
_(
" -a <file> Attach one or more files to a message (must be the last option)\n"
311 " Add any addresses after the '--' argument"));
312 puts(
_(
" -B Run in batch mode (do not start the ncurses UI)"));
313 puts(
_(
" -b <address> Specify a blind carbon copy (Bcc) recipient"));
314 puts(
_(
" -c <address> Specify a carbon copy (Cc) recipient"));
315 puts(
_(
" -C Enable Command-line Crypto (signing/encryption)"));
316 puts(
_(
" -D Dump all config variables as 'name=value' pairs to stdout"));
317 puts(
_(
" -D -O Like -D, but show one-liner documentation"));
318 puts(
_(
" -D -S Like -D, but hide the value of sensitive variables"));
319 puts(
_(
" -d <level> Log debugging output to a file (default is \"~/.neomuttdebug0\")\n"
320 " The level can range from 1-5 and affects verbosity"));
321 puts(
_(
" -E Edit draft (-H) or include (-i) file during message composition"));
322 puts(
_(
" -e <command> Specify a command to be run after reading the config files"));
323 puts(
_(
" -F <config> Specify an alternative initialization file to read"));
324 puts(
_(
" -f <mailbox> Specify a mailbox (as defined with 'mailboxes' command) to load"));
325 puts(
_(
" -G Start NeoMutt with a listing of subscribed newsgroups"));
326 puts(
_(
" -g <server> Like -G, but start at specified news server"));
327 puts(
_(
" -H <draft> Specify a draft file with header and body for message composing"));
328 puts(
_(
" -h Print this help message and exit"));
329 puts(
_(
" -i <include> Specify an include file to be embedded in the body of a message"));
330 puts(
_(
" -l <file> Specify a file for debugging output (default \"~/.neomuttdebug0\")"));
331 puts(
_(
" -m <type> Specify a default mailbox format type for newly created folders\n"
332 " The type is either MH, MMDF, Maildir or mbox (case-insensitive)"));
333 puts(
_(
" -n Do not read the system-wide configuration file"));
334 puts(
_(
" -p Resume a prior postponed message, if any"));
335 puts(
_(
" -Q <variable> Query a configuration variable and print its value to stdout\n"
336 " (after the config has been read and any commands executed)\n"
337 " Add -O for one-liner documentation"));
338 puts(
_(
" -R Open mailbox in read-only mode"));
339 puts(
_(
" -s <subject> Specify a subject (must be enclosed in quotes if it has spaces)"));
340 puts(
_(
" -v Print the NeoMutt version and compile-time definitions and exit"));
341 puts(
_(
" -vv Print the NeoMutt license and copyright information and exit"));
342 puts(
_(
" -y Start NeoMutt with a listing of all defined mailboxes"));
343 puts(
_(
" -Z Open the first mailbox with new message or exit immediately with\n"
344 " exit code 1 if none is found in all defined mailboxes"));
345 puts(
_(
" -z Open the first or specified (-f) mailbox if it holds any message\n"
346 " or exit immediately with exit code 1 otherwise"));
350 return !ferror(stdout);
373 keypad(stdscr,
true);
392 setlocale(LC_ALL,
"");
397 bindtextdomain(PACKAGE, domdir);
399 bindtextdomain(PACKAGE, MUTTLOCALEDIR);
425 struct passwd *pw = getpwuid(getuid());
444 mutt_error(
_(
"unable to determine home directory"));
461 const char *header =
"";
463 const char *label =
"Language:";
468 lang += strlen(label);
470 char *nl = strchr(lang,
'\n');
489 bool true_color =
false;
490#ifdef NEOMUTT_DIRECT_COLORS
510 static time_t last_run = 0;
520 if (now < (last_run + c_timeout))
546#ifdef ENABLE_FUZZ_TESTS
551(
int argc,
char *argv[],
char *envp[])
553 char *subject = NULL;
554 char *include_file = NULL;
555 char *draft_file = NULL;
556 char *new_type = NULL;
559 const char *cli_nntp = NULL;
560 struct Email *e = NULL;
571 bool explicit_folder =
false;
572 bool dump_variables =
false;
573 bool one_liner =
false;
574 bool hide_sensitive =
false;
575 bool batch_mode =
false;
576 bool edit_infile =
false;
577 int double_dash = argc, nargc = 1;
579 bool repeat_error =
false;
588 if (getegid() != getgid())
590 mutt_error(
"%s: I don't want to run with privileges!", (argc != 0) ? argv[0] :
"neomutt");
597 for (optind = 1; optind < double_dash;)
603 for (; optind < argc; optind++)
605 if ((argv[optind][0] ==
'-') && (argv[optind][1] !=
'\0'))
607 if ((argv[optind][1] ==
'-') && (argv[optind][2] ==
'\0'))
608 double_dash = optind;
616 argv[nargc++] = argv[optind];
619 i = getopt(argc, argv,
"+A:a:Bb:F:f:Cc:Dd:l:Ee:g:GH:i:hm:nOpQ:RSs:TvyzZ");
643 dump_variables =
true;
659 explicit_folder =
true;
672 include_file = optarg;
696 hide_sensitive =
true;
724 while (optind < argc)
725 argv[nargc++] = argv[optind++];
760#ifdef USE_DEBUG_NOTIFY
781 if (!mutt_str_atos_full(dlevel, &num) || (num <
LL_MESSAGE) || (num >=
LL_MAX))
783 mutt_error(
_(
"Error: value '%s' is invalid for -d"), dlevel);
818 dump_variables || batch_mode)
867 char buf[1024] = { 0 };
913 for (; optind < argc; optind++)
959 struct stat st = { 0 };
969 if (!skip && (stat(
buf_string(fpath), &st) == -1) && (errno == ENOENT))
971 char msg2[256] = { 0 };
972 snprintf(msg2,
sizeof(msg2),
_(
"%s does not exist. Create it?"), c_folder);
975 if ((mkdir(
buf_string(fpath), 0700) == -1) && (errno != EEXIST))
976 mutt_error(
_(
"Can't create %s: %s"), c_folder, strerror(errno));
1002 repeat_error =
true;
1005 else if (subject || e || draft_file || include_file ||
1009 FILE *fp_out = NULL;
1010 char *infile = NULL;
1011 char *bodytext = NULL;
1012 const char *bodyfile = NULL;
1023 for (i = optind; i < argc; i++)
1058 infile = draft_file;
1059 include_file = NULL;
1061 else if (include_file)
1063 infile = include_file;
1067 edit_infile =
false;
1070 if (infile || bodytext)
1130 fputs(bodytext, fp_out);
1149 struct stat st = { 0 };
1158 if (fstat(fileno(fp_in), &st) != 0)
1169 mutt_error(
_(
"Can't parse message template: %s"), draft_file);
1176 struct ListNode *np = NULL, *tmp = NULL;
1182 if (c_resume_edited_draft_files)
1202 else if (edit_infile)
1217 while (b && b->
next)
1254 if (truncate(
buf_string(expanded_infile), 0) == -1)
1281 c_crypt_protected_headers_read &&
1285 if (c_resume_edited_draft_files)
1286 fprintf(fp_out,
"X-Mutt-Resume-Draft: 1\n");
1287 fputc(
'\n', fp_out);
1411 repeat_error =
true;
1421 repeat_error =
false;
1423 if (m || !explicit_folder)
1436 repeat_error =
false;
1439#ifdef USE_SASL_CYRUS
void mutt_addrlist_copy(struct AddressList *dst, const struct AddressList *src, bool prune)
Copy a list of addresses into another list.
size_t mutt_addrlist_write(const struct AddressList *al, struct Buffer *buf, bool display)
Write an Address to a buffer.
int mutt_addrlist_parse(struct AddressList *al, const char *s)
Parse a list of email addresses.
int mutt_addrlist_to_intl(struct AddressList *al, char **err)
Convert an Address list to Punycode.
struct AddressList * alias_lookup(const char *name)
Find an Alias.
void alternates_cleanup(void)
Free the alternates lists.
void alternates_init(void)
Set up the alternates lists.
Alternate address handling.
GUI display the mailboxes in a side panel.
void attach_init(void)
Set up the attachments lists.
void attach_cleanup(void)
Free the attachments lists.
Autocrypt end-to-end encryption.
void mutt_autocrypt_cleanup(void)
Shutdown Autocrypt.
int mutt_autocrypt_init(bool can_create)
Initialise Autocrypt.
void show_backtrace(void)
Log the program's call stack.
Select a Mailbox from a list.
#define MUTT_SEL_MAILBOX
Select a mailbox.
#define MUTT_SEL_FOLDER
Select a local directory.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
void buf_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Color and attribute parsing.
void mutt_colors_init(void)
Initialize colours.
@ MT_COLOR_NORMAL
Plain text.
bool dump_config(struct ConfigSet *cs, ConfigDumpFlags flags, FILE *fp)
Write all the config to a file.
#define CS_DUMP_HIDE_SENSITIVE
Obscure sensitive information like passwords.
uint16_t ConfigDumpFlags
Flags for dump_config(), e.g. CS_DUMP_ONLY_CHANGED.
#define CS_DUMP_NO_FLAGS
No flags are set.
#define CS_DUMP_SHOW_DOCS
Show one-liner documentation for the config item.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
char * HomeDir
User's home directory.
struct HashElem * cs_get_elem(const struct ConfigSet *cs, const char *name)
Get the HashElem representing a config item.
int cs_str_initial_set(const struct ConfigSet *cs, const char *name, const char *value, struct Buffer *err)
Set the initial value of a config item.
void cs_free(struct ConfigSet **ptr)
Free a Config Set.
int cs_str_reset(const struct ConfigSet *cs, const char *name, struct Buffer *err)
Reset a config item to its initial value.
struct ConfigSet * cs_new(size_t size)
Create a new Config Set.
int cs_he_reset(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *err)
Reset a config item to its initial value.
int cs_str_native_set(const struct ConfigSet *cs, const char *name, intptr_t value, struct Buffer *err)
Natively set the value of a string config item.
int cs_he_initial_set(const struct ConfigSet *cs, struct HashElem *he, const char *value, struct Buffer *err)
Set the initial value of a config item.
int cs_he_initial_get(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *result)
Get the initial, or parent, value of a config item.
#define CSR_SUCCESS
Action completed successfully.
void config_cache_cleanup(void)
Cleanup the cache of charset config variables.
bool account_mailbox_remove(struct Account *a, struct Mailbox *m)
Remove a Mailbox from an Account.
Convenience wrapper for the core headers.
void mailbox_free(struct Mailbox **ptr)
Free a Mailbox.
struct Mailbox * mailbox_find_name(const char *name)
Find the mailbox with a given name.
struct Mailbox * mailbox_find(const char *path)
Find the mailbox with a given path.
@ MUTT_POP
'POP3' Mailbox type
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
@ MUTT_IMAP
'IMAP' Mailbox type
bool mutt_should_hide_protected_subject(struct Email *e)
Should NeoMutt hide the protected subject?
void crypto_module_cleanup(void)
Clean up the crypto modules.
void crypt_cleanup(void)
Clean up backend.
void crypt_init(void)
Initialise the crypto backends.
void mutt_endwin(void)
Shutdown curses.
void mutt_flushinp(void)
Empty all the keyboard buffers.
Convenience wrapper for the debug headers.
int debug_all_observer(struct NotifyCallback *nc)
void dialog_push(struct MuttWindow *dlg)
Display a Window to the user.
void dialog_pop(void)
Hide a Window from the user.
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
void mutt_browser_cleanup(void)
Clean up working Buffers.
struct MuttWindow * index_pager_init(void)
Allocate the Windows for the Index/Pager.
struct Body * mutt_body_new(void)
Create a new Body.
struct Email * email_new(void)
Create a new Email.
void email_free(struct Email **ptr)
Free an Email.
Structs that make up an email.
bool mutt_parse_mailto(struct Envelope *env, char **body, const char *src)
Parse a mailto:// url.
void mutt_filter_commandline_header_value(char *header)
Sanitise characters in a header value.
int mutt_env_to_intl(struct Envelope *env, const char **tag, char **err)
Convert an Envelope's Address fields to Punycode format.
void mutt_env_free(struct Envelope **ptr)
Free an Envelope.
struct Envelope * mutt_env_new(void)
Create a new Envelope.
void mutt_env_set_subject(struct Envelope *env, const char *subj)
Set both subject and real_subj to subj.
void envlist_free(char ***envp)
Free the private copy of the environment.
char ** envlist_init(char **envp)
Create a copy of the environment.
void external_cleanup(void)
Clean up commands globals.
Manage where the email is piped to external commands.
int mutt_file_copy_stream(FILE *fp_in, FILE *fp_out)
Copy the contents of one file into another.
char * mutt_file_read_keyword(const char *file, char *buf, size_t buflen)
Read a keyword from a file.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
bool OptNews
(pseudo) used to change reader mode
char * LastFolder
Previously selected mailbox.
bool OptNoCurses
(pseudo) when sending in batch mode
char ErrorBuf[1024]
Copy of the last error message.
bool ErrorBufMessage
true if the last message was an error
char * CurrentFolder
Currently selected mailbox.
struct ListHead Muttrc
List of config files to read.
char * Username
User's login name.
char ** EnvList
Private copy of the environment variables.
void dlg_browser(struct Buffer *file, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles)
Let the user select a file -.
struct Mailbox * dlg_index(struct MuttWindow *dlg, struct Mailbox *m_init)
Display a list of emails -.
int log_disp_queue(time_t stamp, const char *file, int line, const char *function, enum LogLevel level, const char *format,...)
Save a log line to an internal queue - Implements log_dispatcher_t -.
int log_disp_terminal(time_t stamp, const char *file, int line, const char *function, enum LogLevel level, const char *format,...)
Save a log line to the terminal - Implements log_dispatcher_t -.
int log_disp_curses(time_t stamp, const char *file, int line, const char *function, enum LogLevel level, const char *format,...)
Display a log line in the message line - Implements log_dispatcher_t -.
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
enum MailboxType nntp_path_probe(const char *path, const struct stat *st)
Is this an NNTP Mailbox? - Implements MxOps::path_probe() -.
enum MailboxType pop_path_probe(const char *path, const struct stat *st)
Is this a POP Mailbox? - Implements MxOps::path_probe() -.
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe() -.
int main_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
int main_hist_observer(struct NotifyCallback *nc)
Notification that a Config Variable has change - Implements observer_t -.
int main_timeout_observer(struct NotifyCallback *nc)
Notification that a timeout has occurred - Implements observer_t -.
int main_log_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
void mutt_gsasl_cleanup(void)
Shutdown GNU SASL library.
Convenience wrapper for the gui headers.
Read/write command history from/to a file.
void mutt_timeout_hook(void)
Execute any timeout hooks.
void mutt_startup_shutdown_hook(HookFlags type)
Execute any startup/shutdown hooks.
void mutt_folder_hook(const char *path, const char *desc)
Perform a folder hook.
Parse and execute user-defined hooks.
#define MUTT_STARTUP_HOOK
startup-hook: run when starting NeoMutt
void imap_logout_all(void)
Close all open connections.
GUI manage the main index (list of emails)
int mutt_query_variables(struct ListHead *queries, bool show_docs)
Implement the -Q command line flag.
int mutt_init(struct ConfigSet *cs, const char *dlevel, const char *dfile, bool skip_sys_rc, struct ListHead *commands)
Initialise NeoMutt.
void mutt_opts_cleanup(void)
Clean up before quitting.
void init_config(struct ConfigSet *cs)
Initialise the config system.
void km_init(void)
Initialise all the menu keybindings.
void mutt_keys_cleanup(void)
Free the key maps.
void init_extended_keys(void)
Initialise map of ncurses extended keys.
void mutt_init_abort_key(void)
Parse the abort_key config string.
struct ListNode * mutt_list_insert_tail(struct ListHead *h, char *s)
Append a string to the end of a List.
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
int(*) log_dispatcher_ MuttLogger)
@ LL_DEBUG3
Log at debug level 3.
@ LL_DEBUG5
Log at debug level 5.
@ LL_MESSAGE
Log informational message.
@ LL_DEBUG1
Log at debug level 1.
@ LL_NOTIFY
Log of notifications.
#define MUTT_CLI_SELECT
-y Start with a list of all mailboxes
static void init_locale(void)
Initialise the Locale/NLS settings.
static void localise_config(struct ConfigSet *cs)
Localise some config.
uint8_t CliFlags
Flags for command line options, e.g. MUTT_CLI_IGNORE.
static void log_translation(void)
Log the translation being used.
#define MUTT_CLI_MAILBOX
-Z Open first mailbox if is has new mail
static void log_gui(void)
Log info about the GUI.
void mutt_exit(int code)
Leave NeoMutt NOW.
static void reset_tilde(struct ConfigSet *cs)
Temporary measure.
static bool usage(void)
Display NeoMutt command line.
static int start_curses(void)
Start the Curses UI.
bool StartupComplete
When the config has been read.
static bool get_user_info(struct ConfigSet *cs)
Find the user's name, home and shell.
#define MUTT_CLI_RO
-R Open mailbox in read-only mode
#define MUTT_CLI_NO_FLAGS
No flags are set.
int main(int argc, char *argv[], char *envp[])
Start NeoMutt.
#define MUTT_CLI_IGNORE
-z Open first mailbox if it has mail
#define MUTT_CLI_NEWS
-g/-G Start with a list of all newsgroups
#define MUTT_CLI_NOSYSRC
-n Do not read the system-wide config file
bool OptLocales
(pseudo) set if user has valid locale definition
#define mutt_array_size(x)
struct Body * mutt_make_multipart(struct Body *b)
Create a multipart email.
void mutt_ch_cache_cleanup(void)
Clean up the cached iconv handles and charset strings.
time_t mutt_date_now(void)
Return the number of seconds since the Unix epoch.
Convenience wrapper for the library headers.
void log_queue_empty(void)
Free the contents of the queue.
void log_queue_set_max_size(int size)
Set a upper limit for the queue length.
void log_queue_flush(log_dispatcher_t disp)
Replay the log queue.
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
const char * mutt_str_getenv(const char *name)
Get an environment variable.
const char * mutt_istr_find(const char *haystack, const char *needle)
Find first occurrence of string (ignoring case)
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Many unsorted constants and some structs.
void mutt_temp_attachments_cleanup(void)
Delete all temporary attachments.
enum MuttCursorState mutt_curses_set_cursor(enum MuttCursorState state)
Set the cursor state.
const struct AttrColor * mutt_curses_set_color_by_id(enum ColorId cid)
Set the colour and attributes by the colour id.
void mutt_resize_screen(void)
Update NeoMutt's opinion about the window size.
@ MUTT_CURSOR_INVISIBLE
Hide the cursor.
@ MUTT_CURSOR_VISIBLE
Display a normal cursor.
void mutt_log_stop(void)
Close the log file.
void mutt_log_prep(void)
Prepare to log.
int mutt_mailbox_check(struct Mailbox *m_cur, CheckStatsFlags flags)
Check all all Mailboxes for new mail.
struct Mailbox * mutt_mailbox_next(struct Mailbox *m_cur, struct Buffer *s)
Incoming folders completion routine.
Mailbox helper functions.
void mutt_signal_init(void)
Initialise the signal handling.
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
struct MuttWindow * window_get_focus(void)
Get the currently focused Window.
@ WT_DLG_INDEX
Index Dialog, dlg_index()
void buf_expand_path_regex(struct Buffer *buf, bool regex)
Create the canonical path (with regex char escaping)
const char * mutt_make_version(void)
Generate the NeoMutt version string.
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
Some miscellaneous functions.
bool mx_mbox_open(struct Mailbox *m, OpenMailboxFlags flags)
Open a mailbox and parse it.
struct Mailbox * mx_resolve(const char *path_or_name)
Get a Mailbox from either a path or name.
int mx_path_is_empty(struct Buffer *path)
Is the mailbox empty.
#define MUTT_READONLY
Open in read-only mode.
#define MUTT_MAILBOX_CHECK_IMMEDIATE
Don't postpone the actual checking.
#define MUTT_OPEN_NO_FLAGS
No flags are set.
uint8_t CheckStatsFlags
Flags for mutt_mailbox_check.
API for encryption/signing of emails.
struct NeoMutt * neomutt_new(struct ConfigSet *cs)
Create the main NeoMutt object.
void neomutt_free(struct NeoMutt **ptr)
Free a NeoMutt.
@ NT_GLOBAL_STARTUP
NeoMutt is initialised.
Nntp-specific Account data.
Usenet network mailbox type; talk to an NNTP server.
void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct)
Make fully qualified url from newsgroup name.
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
struct NntpAccountData * nntp_select_server(struct Mailbox *m, const char *server, bool leave_lock)
Open a connection to an NNTP server.
@ NT_TIMEOUT
Timeout has occurred.
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
@ NT_ALL
Register for all notifications.
@ NT_GLOBAL
Not object-related, NotifyGlobal.
@ NT_RESIZE
Window has been resized.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
void buf_pool_cleanup(void)
Release the Buffer pool.
int mutt_prepare_template(FILE *fp, struct Mailbox *m, struct Email *e_new, struct Email *e, bool resend)
Prepare a message template.
void mutt_prex_cleanup(void)
Cleanup heap memory allocated by compiled regexes.
Prototypes for many functions.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
enum QuadOption query_yesorno(const char *prompt, enum QuadOption def)
Ask the user a Yes/No question.
#define STAILQ_REMOVE(head, elm, type, field)
#define STAILQ_HEAD_INITIALIZER(head)
#define STAILQ_FOREACH(var, head, field)
#define STAILQ_EMPTY(head)
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
#define TAILQ_EMPTY(head)
void rootwin_cleanup(void)
Free all the default Windows.
struct MuttWindow * RootWindow
Parent of all Windows.
void rootwin_new(void)
Create the default Windows.
void mutt_sasl_cleanup(void)
Invoke when processing is complete.
int mutt_write_mime_body(struct Body *b, FILE *fp, struct ConfigSubset *sub)
Write a MIME part.
Convenience wrapper for the send headers.
void mutt_encode_descriptions(struct Body *b, bool recurse, struct ConfigSubset *sub)
RFC2047 encode the content-descriptions.
int mutt_send_message(SendFlags flags, struct Email *e_templ, const char *tempfile, struct Mailbox *m, struct EmailArray *ea, struct ConfigSubset *sub)
Send an email.
#define SEND_BATCH
Send email in batch mode (without user interaction)
#define SEND_NO_FREE_HEADER
Used by the -E flag.
#define SEND_DRAFT_FILE
Used by the -H flag.
uint32_t SendFlags
Flags for mutt_send_message(), e.g. SEND_REPLY.
#define SEND_POSTPONED
Recall a postponed email.
#define SEND_CONSUMED_STDIN
stdin has been read; don't read it twice
#define SEND_CLI_CRYPTO
Enable message security in modes that by default don't enable it.
#define SEND_NO_FLAGS
No flags are set.
struct Body * mutt_make_file_attach(const char *path, struct ConfigSubset *sub)
Create a file attachment.
void mutt_prepare_envelope(struct Envelope *env, bool final, struct ConfigSubset *sub)
Prepare an email header.
LOFF_T length
length (in bytes) of attachment
struct Body * next
next attachment in the list
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
Container for lots of config items.
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
struct ConnAccount account
Account details: username, password, etc.
The envelope/body of an email.
struct Envelope * env
Envelope information.
struct Body * body
List of MIME parts.
LOFF_T offset
Where in the stream does this message begin?
struct ListHead userhdrs
user defined headers
char *const subject
Email's subject.
struct AddressList to
Email's 'To' list.
struct AddressList cc
Email's 'Cc' list.
struct AddressList bcc
Email's 'Bcc' list.
The item stored in a Hash Table.
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
char * name
A short name for the Mailbox.
struct Account * account
Account that owns this Mailbox.
struct WindowState state
Current state of the Window.
struct MuttWindow * focus
Focused Window.
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Container for Accounts, Notifications.
struct Notify * notify_resize
Window resize notifications handler.
struct AccountList accounts
List of all Accounts.
mode_t user_default_umask
User's default file writing permissions (inferred from umask)
struct Notify * notify
Notifications handler.
struct ConfigSubset * sub
Inherited config items.
struct Connection * conn
Connection to NNTP Server.
Data passed to a notification function.
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
void subjrx_init(void)
Create new Subject Regex List.
void subjrx_cleanup(void)
Free the Subject Regex List.
int cs_subset_str_native_set(const struct ConfigSubset *sub, const char *name, intptr_t value, struct Buffer *err)
Natively set the value of a string config item.
bool TsSupported
Terminal Setting is supported.
bool mutt_ts_capability(void)
Check terminal capabilities.
enum UrlScheme url_check_scheme(const char *str)
Check the protocol of a URL.
@ U_MAILTO
Url is mailto://.
bool print_copyright(void)
Print copyright message.
bool print_version(FILE *fp)
Print system and compile info to a file.
Display version and copyright about NeoMutt.