119 fputs(
"\n-- \n", fp);
134 struct Address *a = NULL, *tmp = NULL;
152 const struct AddressList *c)
154 const struct AddressList *
const als[] = { t, c };
158 const struct AddressList *al = als[i];
206 }
while (idna_ok != 0);
236 NULL, NULL, NULL) != 0)
247 const bool c_ask_followup_to =
cs_subset_bool(sub,
"ask_followup_to");
249 false, NULL, NULL, NULL) != 0))
261 const bool c_ask_x_comment_to =
cs_subset_bool(sub,
"ask_x_comment_to");
262 if (c_x_comment_to && c_ask_x_comment_to &&
264 NULL, NULL, NULL) != 0))
300 const bool c_reply_with_xorig =
cs_subset_bool(sub,
"reply_with_xorig");
320 const char *p = NULL;
337 NULL, NULL, NULL) != 0) ||
451 const char *
const c_forward_attribution_intro =
cs_subset_string(sub,
"forward_attribution_intro");
452 if (!c_forward_attribution_intro || !fp)
455 const char *
const c_attribution_locale =
cs_subset_string(sub,
"attribution_locale");
457 char buf[1024] = { 0 };
458 setlocale(LC_TIME,
NONULL(c_attribution_locale));
459 mutt_make_string(buf,
sizeof(buf), 0, c_forward_attribution_intro, NULL, -1,
461 setlocale(LC_TIME,
"");
474 const char *
const c_forward_attribution_trailer =
cs_subset_string(sub,
"forward_attribution_trailer");
475 if (!c_forward_attribution_trailer || !fp)
478 const char *
const c_attribution_locale =
cs_subset_string(sub,
"attribution_locale");
480 char buf[1024] = { 0 };
481 setlocale(LC_TIME,
NONULL(c_attribution_locale));
482 mutt_make_string(buf,
sizeof(buf), 0, c_forward_attribution_trailer, NULL, -1,
484 setlocale(LC_TIME,
"");
513 const bool c_forward_decode =
cs_subset_bool(sub,
"forward_decode");
526 if (c_forward_decode)
538 const bool c_forward_quote =
cs_subset_bool(sub,
"forward_quote");
562 struct Body **last = *plast;
563 struct Body *body = NULL;
583 for (i = 0; i < actx->
idxlen; i++)
603 _(
"Forward attachments?"));
616 last = &((*last)->next);
636 if (!c_attribution || !fp_out)
639 const char *
const c_attribution_locale =
cs_subset_string(sub,
"attribution_locale");
641 char buf[1024] = { 0 };
642 setlocale(LC_TIME,
NONULL(c_attribution_locale));
645 setlocale(LC_TIME,
"");
660 char op,
const char *src,
const char *prec,
661 const char *if_str,
const char *else_str,
682 if ((p = strpbrk(buf2,
"%@")))
697 if ((p = strpbrk(buf2,
" %@")))
703 snprintf(buf, buflen,
"%%%s%c", prec, op);
724 if (!c_greeting || !fp_out)
727 char buf[1024] = { 0 };
744 const char *
const c_post_indent_string =
cs_subset_string(sub,
"post_indent_string");
745 if (!c_post_indent_string || !fp_out)
748 char buf[256] = { 0 };
861 const bool multiple_reply_to = reply_to &&
864 const bool c_ignore_list_reply_to =
cs_subset_bool(sub,
"ignore_list_reply_to");
866 if ((from_is_reply_to && !multiple_reply_to && !reply_to->
personal) ||
878 else if (!(from_is_reply_to && !multiple_reply_to) && (c_reply_to !=
MUTT_YES))
880 char prompt[256] = { 0 };
887 snprintf(prompt,
sizeof(prompt),
_(
"Reply to %s%s?"), reply_to->
mailbox,
888 multiple_reply_to ?
",..." :
"");
933 char prompt[256] = { 0 };
934 snprintf(prompt,
sizeof(prompt),
_(
"Follow-up to %s%s?"), followup_to->
mailbox,
947 if (followup_to && (hmfupto ==
MUTT_YES) &&
966 (!followup_to || (hmfupto !=
MUTT_YES)))
1048 const char *
const c_forward_format =
cs_subset_string(sub,
"forward_format");
1050 char buf[256] = { 0 };
1066 if (!env || !curenv)
1079 const char *
const c_empty_subject =
cs_subset_string(sub,
"empty_subject");
1201 const bool c_forward_references =
cs_subset_bool(sub,
"forward_references");
1202 if (c_forward_references)
1242 mutt_error(
_(
"Could not include all requested messages"));
1247 fputc(
'\n', fp_tmp);
1262 while (last && last->
next)
1284 struct Body **last = NULL;
1287 const bool c_forward_decode =
cs_subset_bool(sub,
"forward_decode");
1289 if (c_forward_decode && (c_forward_attachments !=
MUTT_NO))
1293 last = &((*last)->next);
1300 if (c_forward_decode && (c_forward_attachments !=
MUTT_NO))
1313 struct Body *b = NULL;
1373 struct AddressList *al = NULL;
1449 const bool c_reverse_real_name =
cs_subset_bool(sub,
"reverse_real_name");
1450 if (!c_reverse_real_name)
1471 else if (c_use_domain)
1494 struct Buffer *tempfile = NULL;
1523 fputc(
'\n', fp_tmp);
1580 for (
struct Body *t = b; t; t = t->
next)
1585 rfc2047_encode(&t->description, NULL,
sizeof(
"Content-Description:"), c_send_charset);
1587 if (recurse && t->parts)
1598 for (
struct Body *t = b; t; t = t->
next)
1655 const bool c_smime_is_default =
cs_subset_bool(sub,
"smime_is_default");
1664 const bool c_crypt_opportunistic_encrypt =
cs_subset_bool(sub,
"crypt_opportunistic_encrypt");
1665 if (c_crypt_opportunistic_encrypt)
1689 if (!reply || !reply->
env || !orig || !orig->
env)
1712 if (!c_abort_noattach_regex || !c_abort_noattach_regex->
regex ||
1713 !c_quote_regex || !c_quote_regex->
regex)
1724 while (!feof(fp_att))
1726 fgets(inputline, 1024, fp_att);
1753 struct Body *clear_content,
char *pgpkeylist,
1757 struct Body *save_content = NULL;
1773 mutt_error(
_(
"Warning: Fcc to an IMAP mailbox is not supported in batch mode"));
1789 struct Body *save_sig = NULL;
1790 struct Body *save_parts = NULL;
1792 const bool c_fcc_before_send =
cs_subset_bool(sub,
"fcc_before_send");
1796 if (!c_fcc_before_send)
1802 e->
body = clear_content;
1811 bool save_atts =
true;
1836 save_parts = clear_content->
parts->
next;
1851 save_content = e->
body;
1879 _(
"Fcc failed. (r)etry, alternate (m)ailbox, or (s)kip?"),
1900 NULL, finalpath, sub);
1911 if (!c_fcc_before_send)
1918 if (save_content->
parts)
1921 save_content->
parts = NULL;
1952 char *pgpkeylist = NULL;
1953 const char *encrypt_as = NULL;
1954 struct Body *clear_content = NULL;
1959 mutt_error(
_(
"Can't postpone. $postponed is unset"));
1968 const bool c_postpone_encrypt =
cs_subset_bool(sub,
"postpone_encrypt");
1969 if ((
WithCrypto != 0) && c_postpone_encrypt &&
1974 const char *
const c_pgp_default_key =
cs_subset_string(sub,
"pgp_default_key");
1975 encrypt_as = c_pgp_default_key;
1979 const char *
const c_smime_default_key =
cs_subset_string(sub,
"smime_default_key");
1980 encrypt_as = c_smime_default_key;
1984 const char *
const c_postpone_encrypt_as =
cs_subset_string(sub,
"postpone_encrypt_as");
1985 encrypt_as = c_postpone_encrypt_as;
1996 mutt_error(
_(
"Error encrypting message. Check your crypt settings."));
2006 clear_content = e_post->
body;
2013 mutt_error(
_(
"Error encrypting message. Check your crypt settings."));
2025 e_post->
read =
false;
2026 e_post->
old =
false;
2033 true, fcc, NULL, sub) < 0)
2038 e_post->
body = clear_content;
2078 if (c_abort_noattach ==
MUTT_NO)
2084 bool has_keyword =
false;
2107 mutt_error(
_(
"Message contains text matching \"$abort_noattach_regex\". Not sending."));
2130 FILE *fp_tmp = NULL;
2131 struct Body *pbody = NULL;
2133 bool free_clear_content =
false;
2135 struct Body *clear_content = NULL;
2136 char *pgpkeylist = NULL;
2138 char *pgp_sign_as = NULL;
2139 char *smime_sign_as = NULL;
2140 const char *tag = NULL;
2142 const char *ctype = NULL;
2143 char *finalpath = NULL;
2145 struct Email *e_cur = NULL;
2188 const char *
const c_smime_sign_as =
cs_subset_string(sub,
"smime_sign_as");
2220 flags &= ~SEND_NEWS;
2260 e_templ->
body = pbody;
2263 ctype = c_content_type;
2265 ctype =
"text/plain";
2280 char buf[1024] = { 0 };
2322 const bool c_reply_with_xorig =
cs_subset_bool(sub,
"reply_with_xorig");
2341 const bool c_resume_draft_files =
cs_subset_bool(sub,
"resume_draft_files");
2371 if (!(flags &
SEND_BATCH) && !(c_auto_edit && c_edit_headers) &&
2428 mutt_message(
_(
"Try: echo | neomutt -s 'subject' user@example.com"));
2489 struct stat st = { 0 };
2495 if (mtime == (time_t) -1)
2516 (((flags &
SEND_FORWARD) == 0) || (c_edit_headers && c_auto_edit) ||
2529 else if (c_edit_headers)
2540 if (mtime != st.st_mtime)
2559 if ((mtime == st.st_mtime) && !e_templ->
body->
next &&
2583 bool c_autocrypt =
false;
2584 bool c_autocrypt_reply =
false;
2597 const bool c_crypt_auto_sign =
cs_subset_bool(sub,
"crypt_auto_sign");
2598 const bool c_crypt_auto_encrypt =
cs_subset_bool(sub,
"crypt_auto_encrypt");
2599 const bool c_crypt_reply_encrypt =
cs_subset_bool(sub,
"crypt_reply_encrypt");
2600 const bool c_crypt_reply_sign =
cs_subset_bool(sub,
"crypt_reply_sign");
2601 const bool c_crypt_reply_sign_encrypted =
cs_subset_bool(sub,
"crypt_reply_sign_encrypted");
2603 if (c_crypt_auto_sign)
2605 if (c_crypt_auto_encrypt)
2614 const bool c_crypt_opportunistic_encrypt =
cs_subset_bool(sub,
"crypt_opportunistic_encrypt");
2619 const bool c_pgp_auto_inline =
cs_subset_bool(sub,
"pgp_auto_inline");
2620 const bool c_pgp_reply_inline =
cs_subset_bool(sub,
"pgp_reply_inline");
2622 if (c_pgp_auto_inline)
2629 const bool c_crypt_opportunistic_encrypt =
cs_subset_bool(sub,
"crypt_opportunistic_encrypt");
2631 if (e_templ->
security || c_crypt_opportunistic_encrypt)
2633 const bool c_crypt_auto_pgp =
cs_subset_bool(sub,
"crypt_auto_pgp");
2634 const bool c_crypt_auto_smime =
cs_subset_bool(sub,
"crypt_auto_smime");
2657 const bool c_smime_is_default =
cs_subset_bool(sub,
"smime_is_default");
2679 if (c_crypt_opportunistic_encrypt)
2701 mutt_error(
_(
"No crypto backend configured. Disabling message security setting."));
2768 puts(
_(
"No recipients specified"));
2828 clear_content = NULL;
2829 free_clear_content =
false;
2836 clear_content = e_templ->
body;
2860 if (clear_content && (e_templ->
body != clear_content) &&
2861 (e_templ->
body->
parts != clear_content))
2862 free_clear_content =
true;
2870 const bool c_fcc_before_send =
cs_subset_bool(sub,
"fcc_before_send");
2871 if (c_fcc_before_send)
2872 save_fcc(m, e_templ, &fcc, clear_content, pgpkeylist, flags, &finalpath, sub);
2884 if (e_templ->
body != clear_content)
2887 e_templ->
body = clear_content;
2909 puts(
_(
"Could not send the message"));
2914 if (!c_fcc_before_send)
2915 save_fcc(m, e_templ, &fcc, clear_content, pgpkeylist, flags, &finalpath, sub);
2964 FREE(&smime_sign_as);
2987 const char *mailto,
const char *subj,
const char *body)
3005 char ctype[] =
"text/plain";
3018 fprintf(fp,
"%s\n",
body);
struct Address * mutt_addr_create(const char *personal, const char *mailbox)
Create and populate a new Address.
void mutt_addrlist_copy(struct AddressList *dst, const struct AddressList *src, bool prune)
Copy a list of addresses into another list.
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
void mutt_addr_free(struct Address **ptr)
Free a single Address.
bool mutt_addr_valid_msgid(const char *msgid)
Is this a valid Message ID?
bool mutt_addr_cmp(const struct Address *a, const struct Address *b)
Compare two e-mail addresses.
void mutt_addrlist_append(struct AddressList *al, struct Address *a)
Append an Address to an AddressList.
struct Address * mutt_addr_new(void)
Create a new Address.
size_t mutt_addrlist_write(const struct AddressList *al, char *buf, size_t buflen, bool display)
Write an Address to a buffer.
int mutt_addrlist_to_local(struct AddressList *al)
Convert an Address list from Punycode.
int mutt_addrlist_parse2(struct AddressList *al, const char *s)
Parse a list of email addresses.
struct Address * mutt_addr_copy(const struct Address *addr)
Copy the real address.
void mutt_addrlist_remove_xrefs(const struct AddressList *a, struct AddressList *b)
Remove cross-references.
int mutt_addrlist_count_recips(const struct AddressList *al)
Count the number of Addresses with valid recipients.
int mutt_addrlist_parse(struct AddressList *al, const char *s)
Parse a list of email addresses.
void mutt_addrlist_prepend(struct AddressList *al, struct Address *a)
Prepend an Address to an AddressList.
int mutt_addrlist_to_intl(struct AddressList *al, char **err)
Convert an Address list to Punycode.
bool mutt_addrlist_search(const struct AddressList *haystack, const struct Address *needle)
Search for an e-mail address in a list.
const char * mutt_addr_for_display(const struct Address *a)
Convert an Address for display purposes.
void mutt_addrlist_dedupe(struct AddressList *al)
Remove duplicate addresses.
void mutt_expand_aliases(struct AddressList *al)
Expand aliases in a List of Addresses.
bool mutt_addr_is_user(const struct Address *addr)
Does the address belong to the user.
void mutt_expand_aliases_env(struct Envelope *env)
Expand aliases in all the fields of an Envelope.
void mutt_actx_free(struct AttachCtx **ptr)
Free an Attachment Context.
GUI display the mailboxes in a side panel.
void mutt_parse_mime_message(struct Email *e, FILE *fp)
Parse a MIME email.
char * AutocryptDefaultKey
Autocrypt default key id (used for postponing messages)
Autocrypt end-to-end encryption.
int mutt_autocrypt_set_sign_as_default_key(struct Email *e)
Set the Autocrypt default key for signing.
Select a Mailbox from a list.
#define MUTT_SEL_NO_FLAGS
No flags are set.
struct Buffer mutt_buffer_make(size_t size)
Make a new buffer on the stack.
void mutt_buffer_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
void mutt_buffer_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
GUI editor for an email's headers.
#define MUTT_COMPOSE_NOFREEHEADER
int mutt_compose_menu(struct Email *e, struct Buffer *fcc, uint8_t flags, struct ConfigSubset *sub)
Allow the user to edit the message envelope.
const struct Regex * cs_subset_regex(const struct ConfigSubset *sub, const char *name)
Get a regex config item by name.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
const struct Slist * cs_subset_slist(const struct ConfigSubset *sub, const char *name)
Get a string-list config item by name.
enum QuadOption cs_subset_quad(const struct ConfigSubset *sub, const char *name)
Get a quad-value config item by name.
const char * cs_subset_path(const struct ConfigSubset *sub, const char *name)
Get a path config item by name.
const struct Address * cs_subset_address(const struct ConfigSubset *sub, const char *name)
Get an Address config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
char * HomeDir
User's home directory.
int mutt_copy_message(FILE *fp_out, struct Email *e, struct Message *msg, CopyMessageFlags cmflags, CopyHeaderFlags chflags, int wraplen)
Copy a message from a Mailbox.
Duplicate the structure of an entire email.
#define CH_DECODE
Do RFC2047 header decoding.
#define MUTT_CM_WEED
Weed message/rfc822 attachment headers.
#define MUTT_CM_REPLYING
Replying the message.
#define MUTT_CM_PREFIX
Quote the header and body.
#define MUTT_CM_DECODE
Decode the message body into text/plain.
#define CH_WEED
Weed the headers?
#define CH_REORDER
Re-order output of headers (specified by 'hdr_order')
#define MUTT_CM_CHARCONV
Perform character set conversions.
uint32_t CopyHeaderFlags
Flags for mutt_copy_header(), e.g. CH_UPDATE.
#define MUTT_CM_NO_FLAGS
No flags are set.
#define MUTT_CM_NOHEADER
Don't copy the message header.
uint16_t CopyMessageFlags
Flags for mutt_copy_message(), e.g. MUTT_CM_NOHEADER.
Convenience wrapper for the core headers.
void crypt_opportunistic_encrypt(struct Email *e)
Can all recipients be determined.
bool crypt_valid_passphrase(SecurityFlags flags)
Check that we have a usable passphrase, ask if not.
bool mutt_should_hide_protected_subject(struct Email *e)
Should NeoMutt hide the protected subject?
int mutt_protect(struct Email *e, char *keylist, bool postpone)
Encrypt and/or sign a message.
int crypt_get_keys(struct Email *e, char **keylist, bool oppenc_mode)
Check we have all the keys we need.
bool crypt_has_module_backend(SecurityFlags type)
Is there a crypto backend for a given type?
struct Body * crypt_pgp_make_key_attachment(void)
Wrapper for CryptModuleSpecs::pgp_make_key_attachment()
void mutt_edit_file(const char *editor, const char *file)
Let the user edit a file.
int mutt_buffer_enter_fname(const char *prompt, struct Buffer *fname, bool mailbox, struct Mailbox *m, bool multiple, char ***files, int *numfiles, SelectFileFlags flags)
Ask the user to select a file.
void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string.
time_t mutt_date_epoch(void)
Return the number of seconds since the Unix epoch.
bool mutt_is_quote_line(char *line, regmatch_t *pmatch)
Is a line of message text a quote?
void mutt_body_free(struct Body **ptr)
Free a Body.
struct Body * mutt_body_new(void)
Create a new Body.
int emaillist_add_email(struct EmailList *el, struct Email *e)
Add an Email to a list.
struct Email * email_new(void)
Create a new Email.
void email_free(struct Email **ptr)
Free an Email.
void emaillist_clear(struct EmailList *el)
Drop a private list of Emails.
Structs that make up an email.
int mutt_buffer_get_field(const char *field, struct Buffer *buf, CompletionFlags complete, bool multiple, struct Mailbox *m, char ***files, int *numfiles)
Ask the user for a string.
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_to_local(struct Envelope *env)
Convert an Envelope's Address fields to local format.
bool mutt_is_subscribed_list_recipient(bool all_addr, struct Envelope *env)
Matches subscribed mailing lists.
bool mutt_is_list_recipient(bool all_addr, struct Envelope *env)
Matches known mailing lists.
int mutt_file_copy_stream(FILE *fp_in, FILE *fp_out)
Copy the contents of one file into another.
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
long mutt_file_get_size_fp(FILE *fp)
Get the size of a file.
time_t mutt_file_decrease_mtime(const char *fp, struct stat *st)
Decrease a file's modification time by 1 second.
bool mutt_file_seek(FILE *fp, LOFF_T offset, int whence)
Wrapper for fseeko with error handling.
int filter_wait(pid_t pid)
Wait for the exit of a process and return its status.
bool mutt_is_mail_list(const struct Address *addr)
Is this the email address of a mailing list? - Implements addr_predicate_t -.
static const char * greeting_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags)
Format a greetings string - Implements format_t -.
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t callback, intptr_t data, MuttFormatFlags flags)
Expand expandos (x) in a string -.
#define mutt_warning(...)
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe() -.
Convenience wrapper for the gui headers.
bool mutt_prefer_as_attachment(struct Body *b)
Do we want this part as an attachment?
Decide how to display email content.
void mutt_make_string(char *buf, size_t buflen, int cols, const char *s, struct Mailbox *m, int inpgr, struct Email *e, MuttFormatFlags flags, const char *progress)
Create formatted strings using mailbox expandos.
String processing routines to generate the mail index.
void mutt_select_fcc(struct Buffer *path, struct Email *e)
Select the FCC path for an email.
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Parse and execute user-defined hooks.
#define MUTT_SEND_HOOK
send-hook: when composing a new email
#define MUTT_SEND2_HOOK
send2-hook: when changing fields in the compose menu
#define MUTT_REPLY_HOOK
reply-hook: when replying to an email
#define MUTT_MESSAGE_HOOK
message-hook: run before displaying a message
struct ListNode * mutt_list_insert_tail(struct ListHead *h, char *s)
Append a string to the end of a List.
struct ListNode * mutt_list_find(const struct ListHead *h, const char *data)
Find a string in a List.
struct ListNode * mutt_list_insert_head(struct ListHead *h, char *s)
Insert a string at the beginning of a List.
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
@ LL_DEBUG5
Log at debug level 5.
@ LL_DEBUG1
Log at debug level 1.
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
@ MUTT_IMAP
'IMAP' Mailbox type
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
void * mutt_mem_malloc(size_t size)
Allocate memory on the heap.
#define mutt_array_size(x)
@ TYPE_MULTIPART
Type: 'multipart/*'.
@ TYPE_APPLICATION
Type: 'application/*'.
@ TYPE_TEXT
Type: 'text/*'.
@ DISP_INLINE
Content is inline.
Support of Mixmaster anonymous remailer.
int mix_send_message(struct ListHead *chain, const char *tempfile)
Send an email via Mixmaster.
struct Body * mutt_remove_multipart(struct Body *b)
Extract the multipart body if it exists.
struct Body * mutt_make_multipart(struct Body *b)
Create a multipart email.
Convenience wrapper for the library headers.
bool mutt_path_canon(char *buf, size_t buflen, const char *homedir, bool is_dir)
Create the canonical version of a path.
bool mutt_regex_match(const struct Regex *regex, const char *str)
Shorthand to mutt_regex_capture()
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
char * mutt_str_dup(const char *str)
Copy a string, safely.
int mutt_str_asprintf(char **strp, const char *fmt,...)
char * mutt_str_skip_email_wsp(const char *s)
Skip over whitespace as defined by RFC5322.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
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.
#define MUTT_COMP_ALIAS
Alias completion (in alias dialog)
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
#define MUTT_COMP_NO_FLAGS
No flags are set.
@ MUTT_REPLIED
Messages that have been replied to.
bool mutt_edit_attachment(struct Body *a)
Edit an attachment.
int mutt_body_copy(FILE *fp, struct Body **tgt, struct Body *src)
Create a send-mode duplicate from a receive-mode body.
Representation of the body of an email.
Hundreds of global variables to back the user variables.
struct ListHead UserHeader
List of custom headers to add to outgoing emails.
char * Username
User's login name.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
void mutt_buffer_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
void mutt_buffer_expand_path(struct Buffer *buf)
Create the canonical path.
bool mutt_needs_mailcap(struct Body *m)
Does this type need a mailcap entry do display.
void mutt_sleep(short s)
Sleep for a while.
FILE * mutt_open_read(const char *path, pid_t *thepid)
Run a command to read from.
Some miscellaneous functions.
#define mutt_buffer_mktemp(buf)
#define mutt_mktemp(buf, buflen)
int mx_msg_close(struct Mailbox *m, struct Message **msg)
Close a message.
struct Message * mx_msg_open(struct Mailbox *m, int msgno)
Return a stream pointer for a message.
API for encryption/signing of emails.
#define SEC_INLINE
Email has an inline signature.
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
#define SEC_OPPENCRYPT
Opportunistic encrypt mode.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
#define SEC_NO_FLAGS
No flags are set.
#define SEC_ENCRYPT
Email is encrypted.
#define SEC_AUTOCRYPT_OVERRIDE
(Autocrypt) Indicates manual set/unset of encryption
#define SEC_SIGN
Email is signed.
Nntp-specific Mailbox data.
Notmuch virtual mailbox type.
int nm_record_message(struct Mailbox *m, char *path, struct Email *e)
Add a message to the Notmuch database.
Handling of global boolean variables.
bool OptNoCurses
(pseudo) when sending in batch mode
bool OptNewsSend
(pseudo) used to change behavior when posting
void mutt_param_delete(struct ParameterList *pl, const char *attribute)
Delete a matching Parameter.
void mutt_param_set(struct ParameterList *pl, const char *attribute, const char *value)
Set a Parameter.
void mutt_parse_content_type(const char *s, struct Body *ct)
Parse a content type.
bool mutt_parse_mailto(struct Envelope *env, char **body, const char *src)
Parse a mailto:// url.
char * mutt_extract_message_id(const char *s, size_t *len)
Find a message-id.
Match patterns to emails.
static size_t plen
Length of cached packet.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
int mutt_num_postponed(struct Mailbox *m, bool force)
Return the number of postponed messages.
void mutt_update_num_postponed(void)
Force the update of the number of postponed messages.
int mutt_get_postponed(struct Mailbox *m_cur, struct Email *hdr, struct Email **cur, struct Buffer *fcc)
Recall a postponed message.
int mutt_prepare_template(FILE *fp, struct Mailbox *m, struct Email *e_new, struct Email *e, bool resend)
Prepare a message template.
Prototypes for many functions.
#define mutt_set_flag(m, e, flag, bf)
QuadOption
Possible values for a quad-option.
@ MUTT_ABORT
User aborted the question (with Ctrl-G)
@ MUTT_ASKNO
Ask the user, defaulting to 'No'.
@ MUTT_NO
User answered 'No', or assume 'No'.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
int mutt_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question.
enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt)
Ask the user a quad-question.
#define TAILQ_FOREACH(var, head, field)
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
#define STAILQ_HEAD_INITIALIZER(head)
#define STAILQ_FIRST(head)
#define STAILQ_FOREACH(var, head, field)
#define TAILQ_FIRST(head)
#define STAILQ_EMPTY(head)
#define TAILQ_SWAP(head1, head2, type, field)
#define TAILQ_FOREACH_REVERSE(var, head, headname, field)
#define TAILQ_REMOVE(head, elm, field)
#define TAILQ_NEXT(elm, field)
#define TAILQ_EMPTY(head)
#define STAILQ_NEXT(elm, field)
void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Email *e, struct Body *parts, FILE *fp, int parent_type, int level, bool decrypted)
Create a list of attachments.
void rfc2047_encode(char **pd, const char *specials, int col, const struct Slist *charsets)
RFC-2047-encode a string.
void rfc2047_decode(char **pd)
Decode any RFC2047-encoded header fields.
void mutt_rfc3676_space_stuff(struct Email *e)
Perform RFC3676 space stuffing on an Email.
RFC3676 Format Flowed routines.
int mutt_write_mime_body(struct Body *a, FILE *fp, struct ConfigSubset *sub)
Write a MIME part.
static int postpone_message(struct Email *e_post, struct Email *e_cur, const char *fcc, SendFlags flags, struct ConfigSubset *sub)
Save an Email for another day.
void mutt_make_post_indent(struct Email *e, FILE *fp_out, struct ConfigSubset *sub)
Add suffix to replied email text.
static int generate_body(FILE *fp_tmp, struct Email *e, SendFlags flags, struct Mailbox *m, struct EmailList *el, struct ConfigSubset *sub)
Create a new email body.
static int include_reply(struct Mailbox *m, struct Email *e, FILE *fp_out, struct ConfigSubset *sub)
Generate the reply text for an email.
static bool is_reply(struct Email *reply, struct Email *orig)
Is one email a reply to another?
void mutt_encode_descriptions(struct Body *b, bool recurse, struct ConfigSubset *sub)
RFC2047 encode the content-descriptions.
void mutt_make_misc_reply_headers(struct Envelope *env, struct Envelope *curenv, struct ConfigSubset *sub)
Set subject for a reply.
static int save_fcc(struct Mailbox *m, struct Email *e, struct Buffer *fcc, struct Body *clear_content, char *pgpkeylist, SendFlags flags, char **finalpath, struct ConfigSubset *sub)
Save an Email to a 'sent mail' folder.
static bool send_simple_email(struct Mailbox *m, struct EmailList *el, const char *mailto, const char *subj, const char *body)
Compose an email given a few basic ingredients.
int mutt_edit_address(struct AddressList *al, const char *field, bool expand_aliases)
Edit an email address.
void mutt_forward_intro(struct Email *e, FILE *fp, struct ConfigSubset *sub)
Add the "start of forwarded message" text.
void mutt_make_forward_subject(struct Envelope *env, struct Email *e, struct ConfigSubset *sub)
Create a subject for a forwarded email.
void mutt_add_to_reference_headers(struct Envelope *env, struct Envelope *curenv, struct ConfigSubset *sub)
Generate references for a reply email.
static const struct AddressList * choose_default_to(const struct Address *from, const struct Envelope *env, struct ConfigSubset *sub)
Pick the best 'to:' value.
void mutt_fix_reply_recipients(struct Envelope *env, struct ConfigSubset *sub)
Remove duplicate recipients.
static char * nntp_get_header(const char *s)
Get the trimmed header.
int mutt_resend_message(FILE *fp, struct Mailbox *m, struct Email *e_cur, struct ConfigSubset *sub)
Resend an email.
static int include_forward(struct Mailbox *m, struct Email *e, FILE *fp_out, struct ConfigSubset *sub)
Write out a forwarded message.
static void remove_user(struct AddressList *al, bool leave_only)
Remove any address which matches the current user.
static void add_message_id(struct ListHead *head, struct Envelope *env)
Add the email's message ID to a list.
static void add_mailing_lists(struct AddressList *out, const struct AddressList *t, const struct AddressList *c)
Search Address lists for mailing lists.
int mutt_fetch_recips(struct Envelope *out, struct Envelope *in, SendFlags flags, struct ConfigSubset *sub)
Generate recpients for a reply email.
static int envelope_defaults(struct Envelope *env, struct EmailList *el, SendFlags flags, struct ConfigSubset *sub)
Fill in some defaults for a new email.
void mutt_make_attribution(struct Email *e, FILE *fp_out, struct ConfigSubset *sub)
Add "on DATE, PERSON wrote" header.
static void mutt_make_greeting(struct Email *e, FILE *fp_out, struct ConfigSubset *sub)
Add greetings string.
static int invoke_mta(struct Mailbox *m, struct Email *e, struct ConfigSubset *sub)
Send an email.
int mutt_send_message(SendFlags flags, struct Email *e_templ, const char *tempfile, struct Mailbox *m, struct EmailList *el, struct ConfigSubset *sub)
Send an email.
struct Address * mutt_default_from(struct ConfigSubset *sub)
Get a default 'from' Address.
static void process_user_recips(struct Envelope *env)
Process the user headers.
bool mutt_send_list_unsubscribe(struct Mailbox *m, struct Email *e)
Send a mailing-list unsubscription email.
static void process_user_header(struct Envelope *env)
Process the user headers.
static int edit_envelope(struct Envelope *en, SendFlags flags, struct ConfigSubset *sub)
Edit Envelope fields.
static bool abort_for_missing_attachments(const struct Body *b, struct ConfigSubset *sub)
Should we abort sending because of missing attachments?
static int default_to(struct AddressList *to, struct Envelope *env, SendFlags flags, int hmfupto, struct ConfigSubset *sub)
Generate default email addresses.
static void make_reference_headers(struct EmailList *el, struct Envelope *env, struct ConfigSubset *sub)
Generate reference headers for an email.
static void set_reverse_name(struct AddressList *al, struct Envelope *env, struct ConfigSubset *sub)
Try to set the 'from' field from the recipients.
static void fix_end_of_file(const char *data)
Ensure a file ends with a linefeed.
static bool search_attach_keyword(char *filename, struct ConfigSubset *sub)
Search an email for 'attachment' keywords.
void mutt_forward_trailer(struct Email *e, FILE *fp, struct ConfigSubset *sub)
Add a "end of forwarded message" text.
static bool is_text_plain(const struct Body *b)
Is a Body a text/plain MIME part?
static int inline_forward_attachments(struct Mailbox *m, struct Email *e, struct Body ***plast, enum QuadOption *forwardq, struct ConfigSubset *sub)
Add attachments to an email, inline.
bool mutt_send_list_subscribe(struct Mailbox *m, struct Email *e)
Send a mailing-list subscription email.
static void add_references(struct ListHead *head, struct Envelope *env)
Add the email's references to a list.
static void decode_descriptions(struct Body *b)
RFC2047 decode them in case of an error.
void mutt_set_followup_to(struct Envelope *env, struct ConfigSubset *sub)
Set followup-to field.
static void append_signature(FILE *fp, struct ConfigSubset *sub)
Append a signature to an email.
Prepare and send an email.
#define SEND_POSTPONED_FCC
Used by mutt_get_postponed() to signal that the x-mutt-fcc header field was present.
#define SEND_BATCH
Send email in batch mode (without user interaction)
#define SEND_GROUP_CHAT_REPLY
Reply to all recipients preserving To/Cc.
#define SEND_NO_FREE_HEADER
Used by the -E flag.
#define SEND_DRAFT_FILE
Used by the -H flag.
#define SEND_GROUP_REPLY
Reply to all.
#define SEND_LIST_REPLY
Reply to mailing list.
#define SEND_KEY
Mail a PGP public key.
#define SEND_POSTPONED
Recall a postponed email.
#define SEND_TO_SENDER
Compose new email to sender.
#define SEND_RESEND
Reply using the current email as a template.
#define SEND_REPLY
Reply to sender.
#define SEND_REVIEW_TO
Allow the user to edit the To field.
#define SEND_NEWS
Reply to a news article.
#define SEND_FORWARD
Forward email.
uint16_t SendFlags
Flags for mutt_send_message(), e.g. SEND_REPLY.
const char * mutt_fqdn(bool may_hide_host, const struct ConfigSubset *sub)
Get the Fully-Qualified Domain Name.
int mutt_write_multiple_fcc(const char *path, struct Email *e, const char *msgid, bool post, char *fcc, char **finalpath, struct ConfigSubset *sub)
Handle FCC with multiple, comma separated entries.
void mutt_unprepare_envelope(struct Envelope *env)
Undo the encodings of mutt_prepare_envelope()
void mutt_prepare_envelope(struct Envelope *env, bool final, struct ConfigSubset *sub)
Prepare an email header.
struct Body * mutt_make_message_attach(struct Mailbox *m, struct Email *e, bool attach_msg, struct ConfigSubset *sub)
Create a message attachment.
int mutt_write_fcc(const char *path, struct Email *e, const char *msgid, bool post, const char *fcc, char **finalpath, struct ConfigSubset *sub)
Write email to FCC mailbox.
void mutt_update_encoding(struct Body *a, struct ConfigSubset *sub)
Update the encoding type.
int mutt_invoke_sendmail(struct Mailbox *m, struct AddressList *from, struct AddressList *to, struct AddressList *cc, struct AddressList *bcc, const char *msg, bool eightbit, struct ConfigSubset *sub)
Run sendmail.
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 mutt_smtp_send(const struct AddressList *from, const struct AddressList *to, const struct AddressList *cc, const struct AddressList *bcc, const char *msgfile, bool eightbit, struct ConfigSubset *sub)
Send a message using SMTP.
const char * mutt_get_name(const struct Address *a)
Pick the best name to display from an address.
Assorted sorting methods.
char * mailbox
Mailbox and host address.
char * personal
Real name of address.
FILE * fp_root
Used by recvattach for updating.
struct Email * email
Used by recvattach for updating.
struct AttachPtr ** idx
Array of attachments.
short idxlen
Number of attachmentes.
struct Body * body
Attachment.
FILE * fp
Used in the recvattach menu.
struct Body * parts
parts of a multipart or message/rfc822
bool unlink
If true, filename should be unlink()ed before free()ing this structure.
struct Envelope * mime_headers
Memory hole protected headers.
struct ParameterList parameter
Parameters of the content-type.
bool use_disp
Content-Disposition uses filename= ?
unsigned int disposition
content-disposition, ContentDisposition
struct Body * next
next attachment in the list
char * subtype
content-type subtype
unsigned int encoding
content-transfer-encoding, ContentEncoding
unsigned int type
content-type primary type, ContentType
char * filename
When sending a message, this is the file to which this structure refers.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
A set of inherited config items.
struct ConfigSet * cs
Parent ConfigSet.
struct Email * email
Email in the list.
The envelope/body of an email.
struct Envelope * env
Envelope information.
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
struct Body * body
List of MIME parts.
bool old
Email is seen, but unread.
struct ListHead chain
Mixmaster chain.
bool replied
Email has been replied to.
int msgno
Number displayed to the user.
time_t received
Time when the message was placed in the mailbox.
struct ListHead userhdrs
user defined headers
char * list_subscribe
This stores a mailto URL, or nothing.
struct AddressList to
Email's 'To' list.
char * followup_to
List of 'followup-to' fields.
struct AddressList reply_to
Email's 'reply-to'.
char * message_id
Message ID.
char * x_comment_to
List of 'X-comment-to' fields.
struct AddressList x_original_to
Email's 'X-Orig-to'.
char * newsgroups
List of newsgroups.
struct AddressList mail_followup_to
Email's 'mail-followup-to'.
struct AddressList cc
Email's 'Cc' list.
struct ListHead references
message references (in reverse order)
struct ListHead in_reply_to
in-reply-to header content
char * subject
Email's subject.
struct AddressList bcc
Email's 'Bcc' list.
char * list_post
This stores a mailto URL, or nothing.
char * real_subj
Offset of the real subject.
char * list_unsubscribe
This stores a mailto URL, or nothing.
struct AddressList from
Email's 'From' list.
enum MailboxType type
Mailbox type.
void * mdata
Driver specific data.
A local copy of an email.
FILE * fp
pointer to the message data
struct Message::@0 flags
Flags for the Message.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
NNTP-specific Mailbox data -.
Cached regular expression.
regex_t * regex
compiled expression
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.
int cs_subset_str_string_set(const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err)
Set a config item by string.