1024{
1025 char *subject = NULL;
1026 char *include_file = NULL;
1027 char *draft_file = NULL;
1028 char *new_type = NULL;
1029 char *dlevel = NULL;
1030 char *dfile = NULL;
1031 const char *cli_nntp = NULL;
1032 struct Email *e = NULL;
1041 int version = 0;
1042 int i;
1043 bool explicit_folder = false;
1044 bool dump_variables = false;
1045 bool dump_changed = false;
1046 bool one_liner = false;
1047 bool hide_sensitive = false;
1048 bool edit_infile = false;
1049 int double_dash = argc, nargc = 1;
1050 int rc = 1;
1051 bool repeat_error = false;
1056
1058
1059
1060 if (getegid() != getgid())
1061 {
1062 mutt_error(
"%s: I don't want to run with privileges!", (argc != 0) ? argv[0] :
"neomutt");
1063 goto main_exit;
1064 }
1065
1067
1069 if (!cs)
1070 goto main_curses;
1071
1073
1077
1079
1080 for (optind = 1; optind < double_dash;)
1081 {
1082
1083
1084
1085
1086 for (; optind < argc; optind++)
1087 {
1088 if ((argv[optind][0] == '-') && (argv[optind][1] != '\0'))
1089 {
1090 if ((argv[optind][1] == '-') && (argv[optind][2] == '\0'))
1091 double_dash = optind;
1092 break;
1093 }
1094
1095
1098 else
1099 argv[nargc++] = argv[optind];
1100 }
1101
1102 i = getopt(argc, argv, "+A:a:b:F:f:Cc:Dd:l:Ee:g:GH:i:hm:nOpQ:RSs:TvyzZ");
1103 if (i != EOF)
1104 {
1105 switch (i)
1106 {
1107 case 'A':
1109 break;
1110 case 'a':
1112 break;
1113 case 'b':
1115 break;
1116 case 'C':
1118 break;
1119 case 'c':
1121 break;
1122 case 'D':
1123 if (dump_variables)
1124 dump_changed = true;
1125 else
1126 dump_variables = true;
1127 break;
1128 case 'd':
1129 dlevel = optarg;
1130 break;
1131 case 'E':
1132 edit_infile = true;
1133 break;
1134 case 'e':
1136 break;
1137 case 'F':
1139 break;
1140 case 'f':
1142 explicit_folder = true;
1143 break;
1144 case 'g':
1145 cli_nntp = optarg;
1147
1148 case 'G':
1150 break;
1151 case 'H':
1152 draft_file = optarg;
1153 break;
1154 case 'i':
1155 include_file = optarg;
1156 break;
1157 case 'l':
1158 dfile = optarg;
1159 break;
1160 case 'm':
1161 new_type = optarg;
1162 break;
1163 case 'n':
1165 break;
1166 case 'O':
1167 one_liner = true;
1168 break;
1169 case 'p':
1171 break;
1172 case 'Q':
1174 break;
1175 case 'R':
1177 break;
1178 case 'S':
1179 hide_sensitive = true;
1180 break;
1181 case 's':
1182 subject = optarg;
1183 break;
1184 case 'v':
1185 version++;
1186 break;
1187 case 'y':
1189 break;
1190 case 'Z':
1192 break;
1193 case 'z':
1195 break;
1196 default:
1199 goto main_ok;
1200 else
1201 goto main_curses;
1202 }
1203 }
1204 }
1205
1206
1207 while (optind < argc)
1208 argv[nargc++] = argv[optind++];
1209 optind = 1;
1210 argc = nargc;
1211
1212 if (version > 0)
1213 {
1215 bool done;
1216 if (version == 1)
1218 else
1221 if (done)
1222 goto main_ok;
1223 else
1224 goto main_curses;
1225 }
1226
1227
1232
1233#ifdef USE_DEBUG_NOTIFY
1235#endif
1236
1238 goto main_exit;
1239
1241#ifdef ENABLE_NLS
1243#endif
1244
1245 if (dfile)
1247
1248 if (dlevel)
1249 {
1250 short num = 0;
1251 if (!mutt_str_atos_full(dlevel, &num) || (num <
LL_MESSAGE) || (num >=
LL_MAX))
1252 {
1253 mutt_error(
_(
"Error: value '%s' is invalid for -d"), dlevel);
1254 goto main_exit;
1255 }
1256
1258 }
1259
1265
1267 {
1270
1273 {
1275 }
1276
1278 {
1280 }
1281
1284 }
1285
1286
1287 if (!isatty(STDIN_FILENO) || !
STAILQ_EMPTY(&queries) ||
1289 {
1294 }
1295
1296
1298 goto main_curses;
1299
1300
1301
1303 {
1305 if (crc != 0)
1306 goto main_curses;
1307 }
1308
1309
1310
1312
1314 {
1315
1319 }
1320
1327#ifdef USE_LUA
1329#endif
1331
1334#ifdef USE_NOTMUCH
1336#endif
1337
1338
1340 if (rc2 != 0)
1341 goto main_curses;
1342
1345
1346#ifdef USE_NOTMUCH
1348 if (c_virtual_spool_file)
1349 {
1350
1354 if (mp)
1357 }
1358#endif
1359
1361
1362
1363 if (!cli_nntp)
1365
1366 if (!cli_nntp)
1368
1369 if (!cli_nntp)
1370 {
1371 char buf[1024] = { 0 };
1373 }
1374
1375 if (cli_nntp)
1377
1378
1380
1382 goto main_curses;
1383
1385 {
1386 const bool tty = isatty(STDOUT_FILENO);
1387
1389 if (tty)
1391 if (hide_sensitive)
1393 if (one_liner)
1395
1397 if (dump_variables)
1398 {
1401 rc = 0;
1402 }
1403 else
1404 {
1406 }
1407
1410 goto main_curses;
1411 }
1412
1414 {
1415 rc = 0;
1416 for (; optind < argc; optind++)
1420 {
1422 if (al)
1423 {
1424
1430 }
1431 else
1432 {
1433 rc = 1;
1435 }
1436 }
1438 goto main_curses;
1439 }
1440
1442 {
1444 clear();
1448 }
1449
1450#ifdef USE_AUTOCRYPT
1451
1452
1454 if (c_autocrypt)
1456#endif
1457
1458
1461 {
1462 struct stat st = { 0 };
1464
1467 bool skip = false;
1468
1472 if (!skip && (stat(
buf_string(fpath), &st) == -1) && (errno == ENOENT))
1473 {
1474 char msg2[256] = { 0 };
1475 snprintf(msg2,
sizeof(msg2),
_(
"%s does not exist. Create it?"), c_folder);
1477 {
1478 if ((mkdir(
buf_string(fpath), 0700) == -1) && (errno != EEXIST))
1479 mutt_error(
_(
"Can't create %s: %s"), c_folder, strerror(errno));
1480 }
1481 }
1483 }
1484
1486
1491
1493 {
1497 rc = 0;
1498
1499
1501 repeat_error = true;
1502 goto main_curses;
1503 }
1504 else if (subject || e || draft_file || include_file ||
1506 {
1507 FILE *fp_in = NULL;
1508 FILE *fp_out = NULL;
1509 char *infile = NULL;
1510 char *bodytext = NULL;
1511 const char *bodyfile = NULL;
1512 int rv = 0;
1513
1516
1517 if (!e)
1521
1522 for (i = optind; i < argc; i++)
1523 {
1525 {
1527 {
1530 goto main_curses;
1531 }
1532 }
1533 else
1534 {
1536 }
1537 }
1538
1542 {
1545 goto main_curses;
1546 }
1547
1548 if (subject)
1549 {
1550
1553 }
1554
1555 if (draft_file)
1556 {
1557 infile = draft_file;
1558 include_file = NULL;
1559 }
1560 else if (include_file)
1561 {
1562 infile = include_file;
1563 }
1564 else
1565 {
1566 edit_infile = false;
1567 }
1568
1569 if (infile || bodytext)
1570 {
1571
1572 if (infile)
1573 {
1575 {
1576 if (edit_infile)
1577 {
1580 goto main_curses;
1581 }
1582 fp_in = stdin;
1583 }
1584 else
1585 {
1589 if (!fp_in)
1590 {
1593 goto main_curses;
1594 }
1595 }
1596 }
1597
1598 if (edit_infile)
1599 {
1600
1601
1603 }
1604 else
1605 {
1606
1607
1608
1610
1612 if (!fp_out)
1613 {
1617 goto main_curses;
1618 }
1619 if (fp_in)
1620 {
1622 if (fp_in == stdin)
1624 else
1626 }
1627 else if (bodytext)
1628 {
1629 fputs(bodytext, fp_out);
1630 }
1632
1634 if (!fp_in)
1635 {
1638 goto main_curses;
1639 }
1640 }
1641
1642
1643
1644
1645 if (draft_file)
1646 {
1648 struct stat st = { 0 };
1649
1651
1652
1653
1657 if (fstat(fileno(fp_in), &st) != 0)
1658 {
1662 goto main_curses;
1663 }
1665
1667 {
1668 mutt_error(
_(
"Can't parse message template: %s"), draft_file);
1671 goto main_curses;
1672 }
1673
1674
1675 struct ListNode *np = NULL, *tmp = NULL;
1678 {
1680 {
1681 if (c_resume_edited_draft_files)
1683
1687 }
1688 }
1689
1695
1698 }
1699 else if (edit_infile)
1700 {
1701
1702
1704 }
1705 else
1706 {
1707
1709 }
1710
1712 }
1713
1715
1717 {
1719
1720 while (b && b->
next)
1722
1725 {
1726 if (b)
1727 {
1730 }
1731 else
1732 {
1735 }
1736 if (!b)
1737 {
1741 goto main_curses;
1742 }
1743 }
1745 }
1746
1748
1752
1753 if (edit_infile)
1754 {
1755 if (draft_file)
1756 {
1757 if (truncate(
buf_string(expanded_infile), 0) == -1)
1758 {
1761 goto main_curses;
1762 }
1764 if (!fp_out)
1765 {
1768 goto main_curses;
1769 }
1770
1771
1772
1773 if (rv < 0)
1774 {
1780 }
1781
1784 c_crypt_protected_headers_read &&
1788 if (c_resume_edited_draft_files)
1789 fprintf(fp_out, "X-Mutt-Resume-Draft: 1\n");
1790 fputc('\n', fp_out);
1792 {
1795 goto main_curses;
1796 }
1798 }
1799
1801 }
1802
1803
1806
1808
1809 if (rv != 0)
1810 goto main_curses;
1811 }
1813 {
1814
1815
1817 goto main_curses;
1818 }
1819 else
1820 {
1822 {
1827 {
1829 repeat_error = true;
1830 goto main_curses;
1831 }
1835 }
1837 {
1839 {
1844 goto main_curses;
1845 }
1847 {
1849 goto main_curses;
1850 }
1854 {
1855 goto main_ok;
1856 }
1857 }
1858
1860 {
1862 if (c_spool_file)
1863 {
1864
1866 if (m_desc)
1868 else
1870 }
1871 else if (c_folder)
1872 {
1874 }
1875
1876 }
1877
1879 {
1883 }
1884 else
1885 {
1887 }
1888
1891
1893 {
1894
1896 {
1897 case -1:
1899 goto main_curses;
1900 case 1:
1902 goto main_curses;
1903 }
1904 }
1905
1907
1914
1917
1918 repeat_error = true;
1922 {
1925
1928 repeat_error = false;
1929 }
1930 if (m || !explicit_folder)
1931 {
1934
1939
1943 repeat_error = false;
1944 }
1946#ifdef USE_SASL_CYRUS
1948#endif
1949#ifdef USE_SASL_GNU
1951#endif
1952#ifdef USE_AUTOCRYPT
1954#endif
1955
1956
1957 }
1958
1959main_ok:
1960 rc = 0;
1961main_curses:
1964
1967main_exit:
1969 {
1974 }
1991
1993
1996
2002
2005
2006
2016
2018
2022
2024
2026
2029
2033
2044 return rc;
2045}
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.
void alias_cleanup(void)
Clean up the Alias globals.
struct AddressList * alias_lookup(const char *name)
Find an Alias.
void alias_init(void)
Set up the Alias globals.
void alternates_cleanup(void)
Free the alternates lists.
void alternates_init(void)
Set up the alternates lists.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
void attach_init(void)
Set up the attachments lists.
void attach_cleanup(void)
Free the attachments lists.
void mutt_autocrypt_cleanup(void)
Shutdown Autocrypt.
int mutt_autocrypt_init(bool can_create)
Initialise Autocrypt.
#define MUTT_SEL_MAILBOX
Select a mailbox.
#define MUTT_SEL_FOLDER
Select a local directory.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
void buf_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
void colors_cleanup(void)
Cleanup all the colours.
@ MT_COLOR_NORMAL
Plain text.
void source_stack_cleanup(void)
Free memory from the stack used for the source command.
bool commands_init(void)
Initialize commands array and register default commands.
void mutt_comp_init(void)
Setup Compressed Mailbox commands.
bool dump_config(struct ConfigSet *cs, struct HashElemArray *hea, 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_LINK_DOCS
Link to the online docs.
#define CS_DUMP_NO_FLAGS
No flags are set.
#define CS_DUMP_SHOW_DOCS
Show one-liner documentation for the config item.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
void cs_free(struct ConfigSet **ptr)
Free a Config Set.
struct ConfigSet * cs_new(size_t size)
Create a new Config Set.
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.
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.
void commands_clear(struct CommandArray *ca)
Clear an Array of Commands.
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.
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
@ 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.
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.
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.
struct ReplaceList SpamList
List of regexes to match subscribed mailing lists.
struct RegexList SubscribedLists
List of header patterns to unignore (see)
struct RegexList UnSubscribedLists
struct RegexList UnMailLists
List of regexes to exclude false matches in SubscribedLists.
struct RegexList MailLists
List of permitted fields in a mailto: url.
struct ListHead Ignore
List of regexes to match mailing lists.
struct RegexList NoSpamList
List of regexes and patterns to match spam emails.
struct ListHead UnIgnore
List of regexes to exclude false matches in MailLists.
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.
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.
bool OptNews
(pseudo) used to change reader mode
char * LastFolder
Previously selected mailbox.
struct ListHead MimeLookupList
List of mime types that that shouldn't use the mailcap entry.
struct ListHead AlternativeOrderList
List of preferred mime types to display.
struct ListHead AutoViewList
List of mime types to auto view.
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 UserHeader
List of custom headers to add to outgoing emails.
struct ListHead HeaderOrderList
List of header fields in the order they should be displayed.
void mutt_grouplist_init(void)
Initialize the GroupList singleton.
void mutt_grouplist_cleanup(void)
Free GroupList singleton resource.
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_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(...)
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 -.
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 -.
void mutt_gsasl_cleanup(void)
Shutdown GNU SASL library.
void mutt_hist_read_file(void)
Read the History from a file.
void mutt_hist_init(void)
Create a set of empty History ring buffers.
void mutt_hist_cleanup(void)
Free all the history lists.
void mutt_startup_shutdown_hook(HookFlags type)
Execute any startup/shutdown hooks.
void mutt_delete_hooks(HookFlags type)
Delete matching hooks.
void mutt_folder_hook(const char *path, const char *desc)
Perform a folder hook.
void hooks_init(void)
Setup feature commands.
#define MUTT_STARTUP_HOOK
startup-hook: run when starting NeoMutt
#define MUTT_HOOK_NO_FLAGS
No flags are set.
void imap_logout_all(void)
Close all open connections.
void imap_init(void)
Setup feature commands.
void mutt_keys_cleanup(void)
Free the key maps.
void mutt_init_abort_key(void)
Parse the abort_key config string.
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_MESSAGE
Log informational message.
@ 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.
static void reset_tilde(struct ConfigSet *cs)
Temporary measure.
static bool usage(void)
Display NeoMutt command line.
static int get_elem_queries(struct ListHead *queries, struct HashElemArray *hea)
Lookup the HashElems for a set of queries.
static int start_curses(void)
Start the Curses UI.
static int mutt_init(struct ConfigSet *cs, const char *dlevel, const char *dfile, bool skip_sys_rc, struct ListHead *commands)
Initialise NeoMutt.
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.
#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
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.
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.
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.
void mutt_regexlist_free(struct RegexList *rl)
Free a RegexList object.
void mutt_replacelist_free(struct ReplaceList *rl)
Free a ReplaceList object.
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.
void mutt_temp_attachments_cleanup(void)
Delete all temporary attachments.
void init_config(struct ConfigSet *cs)
Initialise the config system.
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.
void mutt_lua_init(void)
Setup feature commands.
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.
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.
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.
void neomutt_mailboxlist_clear(struct MailboxList *ml)
Free a Mailbox List.
size_t neomutt_mailboxlist_get_all(struct MailboxList *head, struct NeoMutt *n, enum MailboxType type)
Get a List of all Mailboxes.
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.
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.
void nm_init(void)
Setup feature commands.
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.
@ 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_FIRST(head)
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
#define TAILQ_EMPTY(head)
void rootwin_cleanup(void)
Free all the default 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.
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
size_t dsize
Length of 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.
struct Mailbox * mailbox
Mailbox in the list.
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 CommandArray commands
NeoMutt commands.
struct Notify * notify_resize
Window resize notifications handler.
char ** env
Private copy of the environment variables.
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 Connection * conn
Connection to NNTP Server.
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.
GetElemListFlags
Flags for get_elem_list()
@ GEL_CHANGED_CONFIG
Only config that has been changed.
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.