1092{
1093 struct Email *e = NULL;
1095 int rc = 1;
1096 bool repeat_error = false;
1101
1103
1104
1105 if (getegid() != getgid())
1106 {
1107 mutt_error(
"%s: I don't want to run with privileges!", (argc != 0) ? argv[0] :
"neomutt");
1108 goto main_exit;
1109 }
1110
1113
1115 if (!cs)
1116 goto main_curses;
1117
1119
1123
1125
1127
1129 goto main_ok;
1130
1131
1136
1137#ifdef USE_DEBUG_NOTIFY
1139#endif
1140
1142 goto main_exit;
1143
1145#ifdef ENABLE_NLS
1147#endif
1148
1150 goto main_exit;
1151
1157
1158
1161 {
1166 }
1167
1168
1169 if (
OptGui && !isatty(STDOUT_FILENO))
1170 goto main_curses;
1171
1172
1173
1175 {
1177 if (crc != 0)
1178 goto main_curses;
1179 }
1180
1181
1182
1184
1186 {
1187
1191 }
1192
1202
1205#ifdef USE_NOTMUCH
1207#endif
1208
1209
1213 if (rc2 != 0)
1214 goto main_curses;
1215
1218
1219#ifdef USE_NOTMUCH
1221 if (c_virtual_spool_file)
1222 {
1223
1226 if (mp)
1229 }
1230#endif
1231
1233
1235
1236
1238
1241 {
1242 goto main_curses;
1243 }
1244
1246 goto main_ok;
1247
1249 {
1251 clear();
1255 }
1256
1257#ifdef USE_AUTOCRYPT
1258
1259
1261 if (c_autocrypt)
1263#endif
1264
1265
1268 {
1269 struct stat st = { 0 };
1271
1274 bool skip = false;
1275
1279 if (!skip && (stat(
buf_string(fpath), &st) == -1) && (errno == ENOENT))
1280 {
1281 char msg2[256] = { 0 };
1282 snprintf(msg2,
sizeof(msg2),
_(
"%s does not exist. Create it?"), c_folder);
1284 {
1285 if ((mkdir(
buf_string(fpath), 0700) == -1) && (errno != EEXIST))
1286 mutt_error(
_(
"Can't create %s: %s"), c_folder, strerror(errno));
1287 }
1288 }
1290 }
1291
1293
1297
1299 {
1303 rc = 0;
1304
1305
1307 repeat_error = true;
1308 goto main_curses;
1309 }
1311 {
1312 FILE *fp_in = NULL;
1313 FILE *fp_out = NULL;
1314 const char *infile = NULL;
1315 char *bodytext = NULL;
1316 const char *bodyfile = NULL;
1317 int rv = 0;
1318
1321
1324
1325 const char **cp = NULL;
1327 {
1329 }
1330
1332 {
1334 }
1335
1337 {
1339 {
1341 {
1344 goto main_curses;
1345 }
1346 }
1347 else
1348 {
1350 }
1351 }
1352
1356 {
1359 goto main_curses;
1360 }
1361
1363 {
1364
1367 }
1368
1370 {
1372 }
1374 {
1376 }
1377 else
1378 {
1380 }
1381
1382 if (infile || bodytext)
1383 {
1384
1385 if (infile)
1386 {
1388 {
1390 {
1393 goto main_curses;
1394 }
1395 fp_in = stdin;
1396 }
1397 else
1398 {
1402 if (!fp_in)
1403 {
1406 goto main_curses;
1407 }
1408 }
1409 }
1410
1412 {
1413
1414
1416 }
1417 else
1418 {
1419
1420
1421
1423
1425 if (!fp_out)
1426 {
1430 goto main_curses;
1431 }
1432 if (fp_in)
1433 {
1435 if (fp_in == stdin)
1437 else
1439 }
1440 else if (bodytext)
1441 {
1442 fputs(bodytext, fp_out);
1443 }
1445
1447 if (!fp_in)
1448 {
1451 goto main_curses;
1452 }
1453 }
1454
1455
1456
1457
1459 {
1461 struct stat st = { 0 };
1462
1464
1465
1466
1470 if (fstat(fileno(fp_in), &st) != 0)
1471 {
1475 goto main_curses;
1476 }
1478
1480 {
1485 goto main_curses;
1486 }
1487
1488
1493 {
1495 {
1496 if (c_resume_edited_draft_files)
1498
1502 }
1503 }
1504
1510
1513 }
1515 {
1516
1517
1519 }
1520 else
1521 {
1522
1524 }
1525
1527 }
1528
1530
1532 {
1534
1535 while (b && b->
next)
1537
1539 {
1540 if (b)
1541 {
1544 }
1545 else
1546 {
1549 }
1550 if (!b)
1551 {
1554 goto main_curses;
1555 }
1556 }
1557 }
1558
1560
1564
1566 {
1568 {
1569 if (truncate(
buf_string(expanded_infile), 0) == -1)
1570 {
1573 goto main_curses;
1574 }
1576 if (!fp_out)
1577 {
1580 goto main_curses;
1581 }
1582
1583
1584
1585 if (rv < 0)
1586 {
1592 }
1593
1596 c_crypt_protected_headers_read &&
1600 if (c_resume_edited_draft_files)
1601 fprintf(fp_out, "X-Mutt-Resume-Draft: 1\n");
1602 fputc('\n', fp_out);
1604 {
1607 goto main_curses;
1608 }
1610 }
1611
1613 }
1614
1615
1618
1620
1621 if (rv != 0)
1622 goto main_curses;
1623 }
1625 {
1626
1627
1629 goto main_curses;
1630 }
1631 else
1632 {
1635
1637 {
1642 {
1644 repeat_error = true;
1645 goto main_curses;
1646 }
1650 }
1652 {
1654 {
1659 goto main_curses;
1660 }
1662 {
1664 goto main_curses;
1665 }
1669 {
1670 goto main_ok;
1671 }
1672 }
1673
1675 {
1677 if (c_spool_file)
1678 {
1679
1681 if (m_desc)
1683 else
1685 }
1686 else if (c_folder)
1687 {
1689 }
1690
1691 }
1692
1694 {
1698 }
1699 else
1700 {
1702 }
1703
1706
1708 {
1709
1711 {
1712 case -1:
1714 goto main_curses;
1715 case 1:
1717 goto main_curses;
1718 }
1719 }
1720
1722
1729
1732
1733 repeat_error = true;
1737 {
1740
1743 repeat_error = false;
1744 }
1745 if (m || !explicit_folder)
1746 {
1749
1754
1758 repeat_error = false;
1759 }
1761#ifdef USE_SASL_CYRUS
1763#endif
1764#ifdef USE_SASL_GNU
1766#endif
1767#ifdef USE_AUTOCRYPT
1769#endif
1770
1771
1772 }
1773
1774main_ok:
1775 rc = 0;
1776main_curses:
1779
1782main_exit:
1784 {
1788 }
1803
1805
1808
1814
1817
1818
1827
1829
1833
1835
1837
1840
1844
1856 return rc;
1857}
void mutt_addrlist_copy(struct AddressList *dst, const struct AddressList *src, bool prune)
Copy a list of addresses into another list.
int mutt_addrlist_parse(struct AddressList *al, const char *s)
Parse a list of email addresses.
void alias_cleanup(void)
Clean up the Alias globals.
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_FIRST(head)
Convenience method to get the first element.
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.
void buf_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
bool cli_parse(int argc, char *const *argv, struct CommandLine *cli)
Parse the Command Line.
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 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.
bool StartupComplete
When the config has been read.
void config_cache_cleanup(void)
Cleanup the cache of charset config variables.
void 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.
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.
void mutt_flushinp(void)
Empty all the keyboard buffers.
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?
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 -.
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 km_init(void)
Initialise all the menu keybindings.
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_t MuttLogger
@ LL_DEBUG3
Log at debug level 3.
@ LL_NOTIFY
Log of notifications.
void lua_init(void)
Setup feature commands.
void lua_cleanup(void)
Clean up Lua.
static void init_locale(void)
Initialise the Locale/NLS settings.
static void localise_config(struct ConfigSet *cs)
Localise some config.
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 log_gui(void)
Log info about the GUI.
static void reset_tilde(struct ConfigSet *cs)
Temporary measure.
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 bool get_user_info(struct ConfigSet *cs)
Find the user's name, home and shell.
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.
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.
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.
struct MailboxArray neomutt_mailboxes_get(struct NeoMutt *n, enum MailboxType type)
Get an Array of matching 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.
struct CommandLine * command_line_new(void)
Create a new CommandLine.
void command_line_free(struct CommandLine **ptr)
Free a CommandLine.
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_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_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.
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
size_t dsize
Length of data.
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 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:
struct StringArray commands
-e Run these commands
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
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.
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.
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 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.
mode_t user_default_umask
User's default file writing permissions (inferred from umask)
struct Notify * notify
Notifications handler.
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://.