1036{
1037 char *subject = NULL;
1038 char *include_file = NULL;
1039 char *draft_file = NULL;
1040 char *new_type = NULL;
1041 char *dlevel = NULL;
1042 char *dfile = NULL;
1043 const char *cli_nntp = NULL;
1044 struct Email *e = NULL;
1053 int version = 0;
1054 int i;
1055 bool explicit_folder = false;
1056 bool dump_variables = false;
1057 bool one_liner = false;
1058 bool hide_sensitive = false;
1059 bool batch_mode = false;
1060 bool edit_infile = false;
1061 int double_dash = argc, nargc = 1;
1062 int rc = 1;
1063 bool repeat_error = false;
1068
1070
1071
1072 if (getegid() != getgid())
1073 {
1074 mutt_error(
"%s: I don't want to run with privileges!", (argc != 0) ? argv[0] :
"neomutt");
1075 goto main_exit;
1076 }
1077
1079
1081 for (optind = 1; optind < double_dash;)
1082 {
1083
1084
1085
1086
1087 for (; optind < argc; optind++)
1088 {
1089 if ((argv[optind][0] == '-') && (argv[optind][1] != '\0'))
1090 {
1091 if ((argv[optind][1] == '-') && (argv[optind][2] == '\0'))
1092 double_dash = optind;
1093 break;
1094 }
1095
1096
1099 else
1100 argv[nargc++] = argv[optind];
1101 }
1102
1103 i = getopt(argc, argv, "+A:a:Bb:F:f:Cc:Dd:l:Ee:g:GH:i:hm:nOpQ:RSs:TvyzZ");
1104 if (i != EOF)
1105 {
1106 switch (i)
1107 {
1108 case 'A':
1110 break;
1111 case 'a':
1113 break;
1114 case 'B':
1115 batch_mode = true;
1116 break;
1117 case 'b':
1119 break;
1120 case 'C':
1122 break;
1123 case 'c':
1125 break;
1126 case 'D':
1127 dump_variables = true;
1128 break;
1129 case 'd':
1130 dlevel = optarg;
1131 break;
1132 case 'E':
1133 edit_infile = true;
1134 break;
1135 case 'e':
1137 break;
1138 case 'F':
1140 break;
1141 case 'f':
1143 explicit_folder = true;
1144 break;
1145 case 'g':
1146 cli_nntp = optarg;
1148
1149 case 'G':
1151 break;
1152 case 'H':
1153 draft_file = optarg;
1154 break;
1155 case 'i':
1156 include_file = optarg;
1157 break;
1158 case 'l':
1159 dfile = optarg;
1160 break;
1161 case 'm':
1162 new_type = optarg;
1163 break;
1164 case 'n':
1166 break;
1167 case 'O':
1168 one_liner = true;
1169 break;
1170 case 'p':
1172 break;
1173 case 'Q':
1175 break;
1176 case 'R':
1178 break;
1179 case 'S':
1180 hide_sensitive = true;
1181 break;
1182 case 's':
1183 subject = optarg;
1184 break;
1185 case 'v':
1186 version++;
1187 break;
1188 case 'y':
1190 break;
1191 case 'Z':
1193 break;
1194 case 'z':
1196 break;
1197 default:
1200 goto main_ok;
1201 else
1202 goto main_curses;
1203 }
1204 }
1205 }
1206
1207
1208 while (optind < argc)
1209 argv[nargc++] = argv[optind++];
1210 optind = 1;
1211 argc = nargc;
1212
1213 if (version > 0)
1214 {
1216 bool done;
1217 if (version == 1)
1219 else
1222 if (done)
1223 goto main_ok;
1224 else
1225 goto main_curses;
1226 }
1227
1230
1232 if (!cs)
1233 goto main_curses;
1234
1237
1238
1243
1244#ifdef USE_DEBUG_NOTIFY
1246#endif
1247
1249 goto main_exit;
1250
1252#ifdef ENABLE_NLS
1254#endif
1255
1256 if (dfile)
1258
1259 if (dlevel)
1260 {
1261 short num = 0;
1262 if (!mutt_str_atos_full(dlevel, &num) || (num <
LL_MESSAGE) || (num >=
LL_MAX))
1263 {
1264 mutt_error(
_(
"Error: value '%s' is invalid for -d"), dlevel);
1265 goto main_exit;
1266 }
1267
1269 }
1270
1276
1278 {
1281
1284 {
1286 }
1287
1289 {
1291 }
1292
1295 }
1296
1297
1299 dump_variables || batch_mode)
1300 {
1305 }
1306
1307
1309 goto main_curses;
1310
1311
1312
1314 {
1316 if (crc != 0)
1317 goto main_curses;
1318 }
1319
1320
1321
1323
1325 {
1326
1330 }
1331
1338#ifdef USE_LUA
1340#endif
1342
1345#ifdef USE_NOTMUCH
1347#endif
1348
1349
1351 if (rc2 != 0)
1352 goto main_curses;
1353
1356
1357#ifdef USE_NOTMUCH
1359 if (c_virtual_spool_file)
1360 {
1361
1365 if (mp)
1368 }
1369#endif
1370
1372
1373
1374 if (!cli_nntp)
1376
1377 if (!cli_nntp)
1379
1380 if (!cli_nntp)
1381 {
1382 char buf[1024] = { 0 };
1384 }
1385
1386 if (cli_nntp)
1388
1389
1391
1393 goto main_curses;
1394
1396 {
1397 const bool tty = isatty(STDOUT_FILENO);
1398
1400 if (tty)
1402 if (hide_sensitive)
1404 if (one_liner)
1406
1408 if (dump_variables)
1409 {
1411 rc = 0;
1412 }
1413 else
1414 {
1416 }
1417
1420 goto main_curses;
1421 }
1422
1424 {
1425 rc = 0;
1426 for (; optind < argc; optind++)
1430 {
1432 if (al)
1433 {
1434
1440 }
1441 else
1442 {
1443 rc = 1;
1445 }
1446 }
1448 goto main_curses;
1449 }
1450
1452 {
1454 clear();
1458 }
1459
1460#ifdef USE_AUTOCRYPT
1461
1462
1464 if (c_autocrypt)
1466#endif
1467
1468
1471 {
1472 struct stat st = { 0 };
1474
1477 bool skip = false;
1478
1482 if (!skip && (stat(
buf_string(fpath), &st) == -1) && (errno == ENOENT))
1483 {
1484 char msg2[256] = { 0 };
1485 snprintf(msg2,
sizeof(msg2),
_(
"%s does not exist. Create it?"), c_folder);
1487 {
1488 if ((mkdir(
buf_string(fpath), 0700) == -1) && (errno != EEXIST))
1489 mutt_error(
_(
"Can't create %s: %s"), c_folder, strerror(errno));
1490 }
1491 }
1493 }
1494
1495 if (batch_mode)
1496 {
1497 goto main_ok;
1498 }
1500
1505
1507 {
1511 rc = 0;
1512
1513
1515 repeat_error = true;
1516 goto main_curses;
1517 }
1518 else if (subject || e || draft_file || include_file ||
1520 {
1521 FILE *fp_in = NULL;
1522 FILE *fp_out = NULL;
1523 char *infile = NULL;
1524 char *bodytext = NULL;
1525 const char *bodyfile = NULL;
1526 int rv = 0;
1527
1530
1531 if (!e)
1535
1536 for (i = optind; i < argc; i++)
1537 {
1539 {
1541 {
1544 goto main_curses;
1545 }
1546 }
1547 else
1548 {
1550 }
1551 }
1552
1556 {
1559 goto main_curses;
1560 }
1561
1562 if (subject)
1563 {
1564
1567 }
1568
1569 if (draft_file)
1570 {
1571 infile = draft_file;
1572 include_file = NULL;
1573 }
1574 else if (include_file)
1575 {
1576 infile = include_file;
1577 }
1578 else
1579 {
1580 edit_infile = false;
1581 }
1582
1583 if (infile || bodytext)
1584 {
1585
1586 if (infile)
1587 {
1589 {
1590 if (edit_infile)
1591 {
1594 goto main_curses;
1595 }
1596 fp_in = stdin;
1597 }
1598 else
1599 {
1603 if (!fp_in)
1604 {
1607 goto main_curses;
1608 }
1609 }
1610 }
1611
1612 if (edit_infile)
1613 {
1614
1615
1617 }
1618 else
1619 {
1620
1621
1622
1624
1626 if (!fp_out)
1627 {
1631 goto main_curses;
1632 }
1633 if (fp_in)
1634 {
1636 if (fp_in == stdin)
1638 else
1640 }
1641 else if (bodytext)
1642 {
1643 fputs(bodytext, fp_out);
1644 }
1646
1648 if (!fp_in)
1649 {
1652 goto main_curses;
1653 }
1654 }
1655
1656
1657
1658
1659 if (draft_file)
1660 {
1662 struct stat st = { 0 };
1663
1665
1666
1667
1671 if (fstat(fileno(fp_in), &st) != 0)
1672 {
1676 goto main_curses;
1677 }
1679
1681 {
1682 mutt_error(
_(
"Can't parse message template: %s"), draft_file);
1685 goto main_curses;
1686 }
1687
1688
1689 struct ListNode *np = NULL, *tmp = NULL;
1692 {
1694 {
1695 if (c_resume_edited_draft_files)
1697
1701 }
1702 }
1703
1709
1712 }
1713
1714
1715 else if (edit_infile)
1717
1718 else
1720
1722 }
1723
1725
1727 {
1729
1730 while (b && b->
next)
1732
1735 {
1736 if (b)
1737 {
1740 }
1741 else
1742 {
1745 }
1746 if (!b)
1747 {
1751 goto main_curses;
1752 }
1753 }
1755 }
1756
1758
1762
1763 if (edit_infile)
1764 {
1765 if (draft_file)
1766 {
1767 if (truncate(
buf_string(expanded_infile), 0) == -1)
1768 {
1771 goto main_curses;
1772 }
1774 if (!fp_out)
1775 {
1778 goto main_curses;
1779 }
1780
1781
1782
1783 if (rv < 0)
1784 {
1790 }
1791
1794 c_crypt_protected_headers_read &&
1798 if (c_resume_edited_draft_files)
1799 fprintf(fp_out, "X-Mutt-Resume-Draft: 1\n");
1800 fputc('\n', fp_out);
1802 {
1805 goto main_curses;
1806 }
1808 }
1809
1811 }
1812
1813
1816
1818
1819 if (rv != 0)
1820 goto main_curses;
1821 }
1823 {
1824
1825
1827 goto main_curses;
1828 }
1829 else
1830 {
1832 {
1837 {
1839 repeat_error = true;
1840 goto main_curses;
1841 }
1845 }
1847 {
1849 {
1854 goto main_curses;
1855 }
1857 {
1859 goto main_curses;
1860 }
1864 {
1865 goto main_ok;
1866 }
1867 }
1868
1870 {
1872 if (c_spool_file)
1873 {
1874
1876 if (m_desc)
1878 else
1880 }
1881 else if (c_folder)
1882 {
1884 }
1885
1886 }
1887
1889 {
1893 }
1894 else
1895 {
1897 }
1898
1901
1903 {
1904
1906 {
1907 case -1:
1909 goto main_curses;
1910 case 1:
1912 goto main_curses;
1913 }
1914 }
1915
1917
1924
1927
1928 repeat_error = true;
1932 {
1935
1938 repeat_error = false;
1939 }
1940 if (m || !explicit_folder)
1941 {
1944
1949
1953 repeat_error = false;
1954 }
1956#ifdef USE_SASL_CYRUS
1958#endif
1959#ifdef USE_SASL_GNU
1961#endif
1962#ifdef USE_AUTOCRYPT
1964#endif
1965
1966
1967 }
1968
1969main_ok:
1970 rc = 0;
1971main_curses:
1974
1977main_exit:
1979 {
1984 }
2000
2002
2005
2011
2014
2015
2025
2027
2033
2035
2037
2040
2043
2054 return rc;
2055}
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_FREE(head)
Release all memory.
#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 commands_init(void)
Initialize commands array and register default commands.
void source_stack_cleanup(void)
Free memory from the stack used for the source command.
void mutt_comp_init(void)
Setup feature 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_cleanup(void)
Free Commands array.
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.
char ** EnvList
Private copy of the environment variables.
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 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 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.
struct HashElemArray get_elem_list(struct ConfigSet *cs, enum GetElemListFlags flags)
Create a sorted list of all config items.
@ GEL_ALL_CONFIG
All the normal config (no synonyms or deprecated)
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.