88#define GNULIB_defined_setlocale
98#include <sys/utsname.h>
147#if defined(USE_DEBUG_NOTIFY) || defined(USE_DEBUG_BACKTRACE)
192#ifdef USE_HCACHE_COMPRESSION
223 const char **cp = NULL;
255static char *
find_cfg(
const char *home,
const char *xdg_cfg_home)
257 const char *names[] = {
263 const char *locations[][2] = {
264 { xdg_cfg_home,
"neomutt/" },
265 { xdg_cfg_home,
"mutt/" },
266 { home,
".neomutt/" },
275 for (
int i = 0; locations[i][0] || locations[i][1]; i++)
277 if (!locations[i][0])
280 for (
int j = 0; names[j]; j++)
282 buf_printf(buf,
"%s/%s%s", locations[i][0], locations[i][1], names[j]);
304 char *mailname = NULL;
305 static const char *mn_files[] = {
"/etc/mailname",
"/etc/mail/mailname" };
307 for (
size_t i = 0; i <
countof(mn_files); i++)
316 if (mailname && *mailname)
337 const char *short_host = NULL;
338 struct utsname utsname = { 0 };
343 short_host = c_hostname;
350 if ((uname(&utsname)) == -1)
352 mutt_perror(
_(
"unable to determine nodename via uname()"));
356 short_host = utsname.nodename;
360 const char *dot = strchr(short_host,
'.');
422 struct Buffer *dfile,
bool skip_sys_rc,
423 struct StringArray *user_files,
struct StringArray *commands)
425 bool need_pause =
false;
430 const char **cp = NULL;
432#ifdef NEOMUTT_DIRECT_COLORS
443 if (COLORS == 16777216)
448 if (env_colorterm && (
mutt_str_equal(env_colorterm,
"truecolor") ||
488 struct Slist *sl_mc = NULL;
526 char name[256] = { 0 };
530 struct passwd *pw = getpwuid(getuid());
654 mutt_error(
_(
"Can't create %s: %s"), c_tmp_dir, strerror(errno));
677 const char **cp = NULL;
744 keypad(stdscr,
true);
772 struct passwd *pw = getpwuid(getuid());
780 shell = pw->pw_shell;
791 mutt_error(
_(
"unable to determine home directory"));
810 const char *header =
"";
812 const char *label =
"Language:";
817 lang += strlen(label);
819 const char *nl = strchr(lang,
'\n');
836 static time_t last_run = 0;
846 if (now < (last_run + c_timeout))
875 const bool tty = isatty(STDOUT_FILENO);
911 if (!mutt_str_atos_full(dlevel, &num) || (num <
LL_MESSAGE) || (num >=
LL_MAX))
913 mutt_error(
_(
"Error: value '%s' is invalid for -d"), dlevel);
930 const char *cli_nntp = NULL;
943 char buf[1024] = { 0 };
964 const bool tty = isatty(STDOUT_FILENO);
990 const char **cp = NULL;
1005 printf(
"%s\n",
NONULL(*cp));
1021int main(
int argc,
char *argv[],
char *envp[])
1025 struct Email *e = NULL;
1028 bool repeat_error =
false;
1035 if (getegid() != getgid())
1037 mutt_error(
"%s: I don't want to run with privileges!", (argc != 0) ? argv[0] :
"neomutt");
1057#ifdef USE_DEBUG_NOTIFY
1082 if (
OptGui && !isatty(STDOUT_FILENO))
1138 struct stat st = { 0 };
1148 if (!skip && (stat(
buf_string(fpath), &st) == -1) && (errno == ENOENT))
1150 char msg2[256] = { 0 };
1151 snprintf(msg2,
sizeof(msg2),
_(
"%s does not exist. Create it?"), c_folder);
1154 if ((mkdir(
buf_string(fpath), 0700) == -1) && (errno != EEXIST))
1155 mutt_error(
_(
"Can't create %s: %s"), c_folder, strerror(errno));
1176 repeat_error =
true;
1182 FILE *fp_out = NULL;
1183 const char *infile = NULL;
1184 char *bodytext = NULL;
1185 const char *bodyfile = NULL;
1197 const char **cp = NULL;
1254 if (infile || bodytext)
1314 fputs(bodytext, fp_out);
1333 struct stat st = { 0 };
1342 if (fstat(fileno(fp_in), &st) != 0)
1368 if (c_resume_edited_draft_files)
1407 while (b && b->
next)
1441 if (truncate(
buf_string(expanded_infile), 0) == -1)
1468 c_crypt_protected_headers_read &&
1472 if (c_resume_edited_draft_files)
1473 fprintf(fp_out,
"X-Mutt-Resume-Draft: 1\n");
1474 fputc(
'\n', fp_out);
1608 repeat_error =
true;
1618 repeat_error =
false;
1620 if (m || !explicit_folder)
1633 repeat_error =
false;
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.
const struct Module ModuleAddress
Module for the Address library.
void alias_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Alias Keybindings - Implements ::init_keys_api.
const struct Module ModuleAlias
Module for the Alias library.
struct AddressList * alias_lookup(const char *name)
Find an Alias.
#define ARRAY_SET(head, idx, elem)
Set an element in the array.
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_EMPTY(head)
Check if an array is empty.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
void attach_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Attach Keybindings - Implements ::init_keys_api.
GUI display the mailboxes in a side panel.
const struct Module ModuleAttach
Module for the Attach library.
void autocrypt_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Autocrypt Keybindings - Implements ::init_keys_api.
Autocrypt end-to-end encryption.
const struct Module ModuleAutocrypt
Module for the Autocrypt library.
int mutt_autocrypt_init(bool can_create)
Initialise Autocrypt.
const struct Module ModuleBcache
Module for the Bcache library.
void browser_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Browser Keybindings - Implements ::init_keys_api.
Select a Mailbox from a list.
@ MUTT_SEL_MAILBOX
Select a mailbox.
@ MUTT_SEL_FOLDER
Select a local directory.
const struct Module ModuleBrowser
Module for the Browser library.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
void buf_seek(struct Buffer *buf, size_t offset)
Set current read/write position to offset from beginning.
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.
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
size_t buf_concat_path(struct Buffer *buf, const char *dir, const char *fname)
Join a directory name and a filename.
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".
bool cli_parse(int argc, char *const *argv, struct CommandLine *cli)
Parse the Command Line.
Color and attribute parsing.
const struct Module ModuleColor
Module for the Color library.
Color private Module data.
void colors_init(struct ColorModuleData *mod_data)
Initialize colours.
@ CMD_MY_HEADER
:my-header
@ CMD_STARTUP_HOOK
:startup-hook
CommandResult
Error codes for command_t parse functions.
@ MUTT_CMD_ERROR
Error: Can't help the user.
@ MUTT_CMD_WARNING
Warning: Help given to the user.
const struct Command * command_find_by_id(const struct CommandArray *ca, enum CommandId id)
Find a NeoMutt Command by its CommandId.
const struct Module ModuleCommands
Module for the Commands library.
const struct Module ModuleComplete
Module for the Complete library.
const struct Module ModuleCompmbox
Module for the Compmbox library.
void compose_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Compose Keybindings - Implements ::init_keys_api.
GUI editor for an email's headers.
const struct Module ModuleCompose
Module for the Compose library.
const struct Module ModuleCompress
Module for the Compress library.
bool dump_config(struct ConfigSet *cs, struct HashElemArray *hea, ConfigDumpFlags flags, FILE *fp)
Write all the config to a file.
@ CS_DUMP_SHOW_DOCS
Show one-liner documentation for the config item.
@ CS_DUMP_NONE
No flags are set.
@ CS_DUMP_LINK_DOCS
Link to the online docs.
@ CS_DUMP_HIDE_SENSITIVE
Obscure sensitive information like passwords.
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.
const char * cs_subset_path(const struct ConfigSubset *sub, const char *name)
Get a path config item by name.
bool config_str_set_initial(struct ConfigSet *cs, const char *name, const char *value)
Set the initial value of a Config Option.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
const struct Module ModuleConfig
Module for the Config library.
int cs_str_initial_get(const struct ConfigSet *cs, const char *name, struct Buffer *result)
Get the initial, or parent, value of a config item.
int cs_str_reset(const struct ConfigSet *cs, const char *name, struct Buffer *err)
Reset a config item to its initial value.
int cs_str_string_set(const struct ConfigSet *cs, const char *name, const char *value, struct Buffer *err)
Set a config item by string.
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.
bool StartupComplete
When the config has been read.
void config_cache_cleanup(void)
Cleanup the cache of charset config variables.
const struct Module ModuleConn
Module for the Conn library.
const struct Module ModuleConvert
Module for the Convert library.
void 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
const struct Module ModuleCore
Module for the Core library.
bool mutt_should_hide_protected_subject(struct Email *e)
Should NeoMutt hide the protected subject?
void crypt_init(void)
Initialise the crypto backends.
int mutt_any_key_to_continue(const char *s)
Prompt the user to 'press any key' and wait.
Convenience wrapper for the debug headers.
int debug_all_observer(struct NotifyCallback *nc)
Debug observer for all notifications.
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.
struct MuttWindow * index_pager_init(void)
Allocate the Windows for the Index/Pager.
void editor_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Editor Keybindings - Implements ::init_keys_api.
const struct Module ModuleEditor
Module for the Editor library.
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.
const struct Module ModuleEmail
Module for the Email library.
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.
const struct Module ModuleEnvelope
Module for the Envelope library.
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.
const struct Module ModuleExpando
Module for the Expando library.
void ext_keys_init(struct Mapping *key_names)
Initialise map of ncurses extended keys.
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_line(char *line, size_t *size, FILE *fp, int *line_num, ReadLineFlags flags)
Read a line from a file.
char * mutt_file_read_keyword(const char *file, char *buf, size_t buflen)
Read a keyword from a file.
int mutt_file_mkdir(const char *path, mode_t mode)
Recursively create directories.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
@ MUTT_RL_NONE
No flags are set.
const struct Module ModulePop
Module for the Pop library.
const struct Module ModuleParse
Module for the Parse library.
const struct Module ModuleMaildir
Module for the Maildir library.
const struct Module ModulePostpone
Module for the Postpone library.
const struct Module ModuleSidebar
Module for the Sidebar library.
const struct Module ModuleMh
Module for the Mh library.
const struct Module ModuleLua
Module for the Lua library.
const struct Module ModulePager
Module for the Pager library.
const struct Module ModuleGui
Module for the Gui library.
const struct Module ModuleProgress
Module for the Progress library.
const struct Module ModuleMenu
Module for the Menu library.
static const struct Module * Modules[]
All the library Modules.
const struct Module ModuleNcrypt
Module for the Ncrypt library.
const struct Module ModuleMutt
Module for the Mutt library.
const struct Module ModuleHcache
Module for the Hcache library.
const struct Module ModuleSend
Module for the Send library.
const struct Module ModuleQuestion
Module for the Question library.
const struct Module ModuleImap
Module for the Imap library.
const struct Module ModuleMain
Module for the Main library.
const struct Module ModuleStore
Module for the Store library.
const struct Module ModuleMbox
Module for the Mbox library.
const struct Module ModulePattern
Module for the Pattern library.
const struct Module ModuleNntp
Module for the Nntp library.
const struct Module ModuleHelpbar
Module for the Helpbar library.
const struct Module ModuleHistory
Module for the History library.
const struct Module ModuleNotmuch
Module for the Notmuch library.
const struct Module ModuleKey
Module for the Key library.
const struct Module ModuleIndex
Module for the Index library.
const struct Module ModuleHooks
Module for the Hooks library.
void mutt_flushinp(void)
MacroEvents moved to KeyModuleData UngetKeyEvents moved to KeyModuleData.
int getdnsdomainname(struct Buffer *result)
Lookup the host's name using DNS.
bool OptNews
(pseudo) used to change reader mode
char * LastFolder
Previously selected mailbox.
char * ShortHostname
Short version of the hostname.
char ErrorBuf[1024]
Copy of the last error message.
bool ErrorBufMessage
true if the last message was an error
char * CurrentFolder
Currently selected mailbox.
bool OptGui
(pseudo) when the gui (and curses) are started
enum CommandResult parse_my_header(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'my-header' command - Implements Command::parse() -.
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 -.
#define mutt_warning(...)
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 -.
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
enum MailboxType nntp_path_probe(const char *path, const struct stat *st)
Is this an NNTP Mailbox?
enum MailboxType pop_path_probe(const char *path, const struct stat *st)
Is this a POP Mailbox?
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox?
int main_hist_observer(struct NotifyCallback *nc)
Notification that a Config Variable has change - Implements observer_t -.
static 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 -.
struct SubMenu * generic_init_keys(struct NeoMutt *n)
Initialise the Generic Keybindings.
Convenience wrapper for the gui headers.
Read/write command history from/to a file.
void exec_startup_shutdown_hook(enum CommandId id)
Execute any startup/shutdown hooks.
void exec_folder_hook(const char *path, const char *desc)
Perform a folder hook.
void exec_timeout_hook(void)
Execute any timeout hooks.
void imap_logout_all(void)
Close all open connections.
void index_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Index Keybindings - Implements ::init_keys_api.
GUI manage the main index (list of emails)
void km_sort(void)
Sort all the menu keybindings.
int log_dispatcher_t MuttLogger
@ LL_DEBUG5
Log at debug level 5.
@ LL_MESSAGE
Log informational message.
@ LL_DEBUG1
Log at debug level 1.
@ LL_NOTIFY
Log of notifications.
static char * find_cfg(const char *home, const char *xdg_cfg_home)
Find a config file.
static char * getmailname(void)
Try to retrieve the FQDN from mailname files.
static bool init_logging(struct CliShared *shared, struct ConfigSet *cs)
Initialise the Logging.
static void log_translation(void)
Log the translation being used.
static void init_nntp(struct Buffer *server, struct ConfigSet *cs)
Initialise the NNTP config.
static bool show_help(struct CliHelp *help)
Show the Help.
static int start_curses(void)
Start the Curses UI.
static bool dump_info(struct CliInfo *ci, struct ConfigSet *cs)
Show config info.
static void init_keys(struct NeoMutt *n)
Initialise the Keybindings.
static bool get_user_info(struct ConfigSet *cs)
Find the user's name, home and shell.
void show_cli(enum HelpMode mode, bool use_color)
Show Instructions on how to run NeoMutt.
static bool get_hostname(struct ConfigSet *cs)
Find the Fully-Qualified Domain Name.
static int get_elem_queries(struct StringArray *queries, struct HashElemArray *hea)
Lookup the HashElems for a set of queries.
static int execute_commands(struct StringArray *sa)
Execute a set of NeoMutt commands.
int main(int argc, char *argv[], char *envp[])
Start NeoMutt.
static int mutt_init(struct ConfigSet *cs, struct Buffer *dlevel, struct Buffer *dfile, bool skip_sys_rc, struct StringArray *user_files, struct StringArray *commands)
Initialise NeoMutt.
#define FREE(x)
Free memory and set the pointer to NULL.
@ MODULE_ID_COLOR
ModuleColor, Color
@ MODULE_ID_GUI
ModuleGui, Graphical code
@ MODULE_ID_KEY
ModuleKey, Key mappings
@ MODULE_ID_NNTP
ModuleNntp, Nntp
struct Body * mutt_make_multipart(struct Body *b)
Create a multipart email.
char * mutt_ch_get_langinfo_charset(void)
Get the user's choice of character set.
void mutt_ch_cache_cleanup(void)
Clean up the cached iconv handles and charset strings.
void mutt_ch_set_charset(const char *charset)
Update the records for a new character set.
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_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.
struct Slist * slist_parse(const char *str, uint32_t flags)
Parse a list of strings into a list.
void slist_free(struct Slist **ptr)
Free an Slist object.
int slist_to_buffer(const struct Slist *list, struct Buffer *buf)
Export an Slist to a Buffer.
char * mutt_strn_dup(const char *begin, size_t len)
Duplicate a sub-string.
char * mutt_str_dup(const char *str)
Copy a string, safely.
int mutt_str_asprintf(char **strp, const char *fmt,...)
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.
@ XDG_CONFIG_DIRS
XDG system dir: /etc/xdg.
void mutt_signal_init(void)
Initialise the signal handling.
int mutt_set_xdg_path(enum XdgType type, struct Buffer *buf)
Find an XDG path or its fallback.
enum MuttCursorState mutt_curses_set_cursor(enum MuttCursorState state)
Set the cursor state.
@ MUTT_CURSOR_INVISIBLE
Hide the cursor.
@ MUTT_CURSOR_VISIBLE
Display a normal cursor.
void mutt_log_stop(void)
Close the log file.
int mutt_log_start(void)
Enable file logging.
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 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()
char * mutt_gecos_name(char *dest, size_t destlen, struct passwd *pw)
Lookup a user's real name in /etc/passwd.
void expand_path(struct Buffer *buf, bool regex)
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.
@ MUTT_READONLY
Open in read-only mode.
@ MUTT_OPEN_NONE
No flags are set.
@ MUTT_MAILBOX_CHECK_IMMEDIATE
Don't postpone the actual checking.
void pgp_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the PGP Keybindings - Implements ::init_keys_api.
API for encryption/signing of emails.
void neomutt_cleanup(struct NeoMutt *n)
Clean up NeoMutt and Modules.
bool neomutt_init(struct NeoMutt *n, char **envp, const struct Module **modules)
Initialise NeoMutt.
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
void neomutt_gui_cleanup(struct NeoMutt *n)
Clean up the GUI Modules.
struct NeoMutt * neomutt_new(void)
Create the main NeoMutt object.
void neomutt_free(struct NeoMutt **ptr)
Free a NeoMutt.
bool neomutt_gui_init(struct NeoMutt *n)
Initialise the GUI Modules.
@ 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 * 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 CommandLine * command_line_new(void)
Create a new CommandLine.
void command_line_free(struct CommandLine **ptr)
Free a CommandLine.
HelpMode
Show detailed help.
void parse_context_free(struct ParseContext **pptr)
Free a ParseContext.
struct ParseContext * parse_context_new(void)
Create a new ParseContext.
void parse_error_free(struct ParseError **pptr)
Free a ParseError.
struct ParseError * parse_error_new(void)
Create a new ParseError.
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.
void postponed_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Postponed Keybindings - Implements ::init_keys_api.
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.
@ 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_FOREACH_SAFE(var, head, field, tvar)
#define TAILQ_EMPTY(head)
enum CommandResult parse_rc_line(struct Buffer *line, struct ParseContext *pc, struct ParseError *pe)
Parse a line of user config.
void rootwin_new(struct GuiModuleData *mod_data)
Create the default Windows.
void rootwin_cleanup(struct GuiModuleData *mod_data)
Free all the default Windows.
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.
@ SEND_CONSUMED_STDIN
stdin has been read; don't read it twice
@ SEND_NO_FREE_HEADER
Used by the -E flag.
@ SEND_NONE
No flags are set.
@ SEND_BATCH
Send email in batch mode (without user interaction)
@ SEND_CLI_CRYPTO
Enable message security in modes that by default don't enable it.
@ SEND_DRAFT_FILE
Used by the -H flag.
@ SEND_POSTPONED
Recall a postponed email.
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.
void source_stack_cleanup(void)
Free memory from the stack used for the source command.
int source_rc(const char *rcfile_path, struct ParseContext *pc, struct ParseError *pe)
Read an initialization file.
bool unlink
If true, filename should be unlink()ed before free()ing this structure.
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.
Help Mode Command Line options.
bool license
-vv Print license
enum HelpMode mode
Display detailed help.
bool is_set
This struct has been used.
Info Mode Command Line options.
bool show_help
-O Show one-liner help
bool is_set
This struct has been used.
struct StringArray queries
-Q Query a config option
struct StringArray alias_queries
-A Lookup an alias
bool dump_config
-D Dump the config options
bool dump_changed
-DD Dump the changed config options
bool hide_sensitive
-S Hide sensitive config
struct Buffer draft_file
-H Use this draft file
bool is_set
This struct has been used.
struct Buffer include_file
-i Use this include file
struct StringArray cc_list
-c Add a Cc:
struct StringArray attach
-a Attach a file
bool use_crypto
-C Use CLI crypto
bool edit_infile
-E Edit the draft/include
struct StringArray bcc_list
-b Add a Bcc:
struct StringArray addresses
Send to these addresses.
struct Buffer subject
-s Use this Subject:
Shared Command Line options.
struct Buffer log_level
-d Debug log level
struct Buffer log_file
-l Debug log file
struct StringArray commands
-e Run these commands
bool is_set
This struct has been used.
bool disable_system
-n Don't read the system config file
struct StringArray user_files
-F Use these user config files
struct Buffer mbox_type
-m Set the default Mailbox type
bool read_only
-R Open Mailbox read-only
bool start_any_mail
-z Check for Any Mail
bool start_nntp
-G Open an NNTP Mailbox
struct Buffer nntp_server
-g Open this NNTP Mailbox
struct Buffer folder
-f Open this Mailbox
bool start_postponed
-p Open Postponed emails
bool start_new_mail
-Z Check for New Mail
bool start_browser
-y Open the Mailbox Browser
Color private Module data.
struct CliSend send
Send Mode command line options.
struct CliShared shared
Shared command line options.
struct CliHelp help
Help Mode command line options.
struct CliInfo info
Info Mode command line options.
struct CliTui tui
Tui Mode command line options.
Container for lots of config items.
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
struct ConfigSet * cs
Parent ConfigSet.
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.
int type
Type of data stored in Hash Table, e.g. DT_STRING.
struct Mapping * key_names
Key name lookup 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 MuttWindow * focus
Focused Window.
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Container for Accounts, Notifications.
struct AccountArray accounts
All Accounts.
struct CommandArray commands
NeoMutt commands.
struct Notify * notify_resize
Window resize notifications handler.
char ** env
Private copy of the environment variables.
char * username
User's login name.
char * home_dir
User's home directory.
struct Notify * notify
Notifications handler.
struct ConfigSubset * sub
Inherited config items.
struct Connection * conn
Connection to NNTP Server.
Nntp private Module data.
struct NntpAccountData * current_news_srv
Current NNTP news server.
Data passed to a notification function.
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
Context for config parsing (history/backtrace)
Detailed error information from config parsing.
struct Buffer * message
Error message.
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.
struct HashElemArray get_elem_list(struct ConfigSet *cs, enum GetElemListFlags flags)
Create a sorted list of all config items.
struct HashElem * cs_subset_lookup(const struct ConfigSubset *sub, const char *name)
Find an inherited config item.
GetElemListFlags
Filtering modes for get_elem_list()
@ GEL_CHANGED_CONFIG
Only config that has been changed.
@ GEL_ALL_CONFIG
All the normal config (no synonyms or deprecated)
#define buf_mktemp_draft(buf)
#define D_SLIST_SEP_COLON
Slist items are colon-separated.
#define D_INTERNAL_DEPRECATED
Config item shouldn't be used any more.
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, bool use_ansi)
Print system and compile info to a file.
Display version and copyright about NeoMutt.