Go to the documentation of this file.
94 #define MAX_ADDR_ROWS 5
97 #define MAX_USER_HDR_ROWS 5
102 struct Menu *menu,
const char *p);
133 #define CHECK_COUNT \
134 if (actx->idxlen == 0) \
136 mutt_error(_(There_are_no_attachments)); \
140 #define CUR_ATTACH actx->idx[actx->v2r[menu->current]]
213 N_(
"X-Comment-To: "),
221 {
N_(
"Send"), OP_COMPOSE_SEND_MESSAGE },
222 {
N_(
"Abort"), OP_EXIT },
224 {
N_(
"To"), OP_COMPOSE_EDIT_TO },
226 {
N_(
"CC"), OP_COMPOSE_EDIT_CC },
228 {
N_(
"Subj"), OP_COMPOSE_EDIT_SUBJECT },
229 {
N_(
"Attach file"), OP_COMPOSE_ATTACH_FILE },
230 {
N_(
"Descrip"), OP_COMPOSE_EDIT_DESCRIPTION },
231 {
N_(
"Help"), OP_HELP },
240 {
N_(
"Send"), OP_COMPOSE_SEND_MESSAGE },
241 {
N_(
"Abort"), OP_EXIT },
242 {
N_(
"Newsgroups"), OP_COMPOSE_EDIT_NEWSGROUPS },
243 {
N_(
"Subj"), OP_COMPOSE_EDIT_SUBJECT },
244 {
N_(
"Attach file"), OP_COMPOSE_ATTACH_FILE },
245 {
N_(
"Descrip"), OP_COMPOSE_EDIT_DESCRIPTION },
246 {
N_(
"Help"), OP_HELP },
304 static bool done =
false;
358 const char *prompt =
_(
"Autocrypt: (e)ncrypt, (c)lear, (a)utomatic?");
364 const char *letters =
_(
"eca");
380 const bool c_crypt_opportunistic_encrypt =
382 if (c_crypt_opportunistic_encrypt)
443 static int calc_address(
struct AddressList *al,
struct ListHead *slist,
444 short cols,
short *srows)
451 int width_left = cols;
462 if (addr_len >= width_left)
464 if (width_left == cols)
472 if (addr_len < width_left)
473 width_left -= addr_len;
555 const bool c_compose_show_user_headers =
557 if (c_compose_show_user_headers)
616 const bool c_crypt_opportunistic_encrypt =
639 const char *c_smime_encrypt_with =
684 const bool c_crypt_opportunistic_encrypt =
686 if (c_crypt_opportunistic_encrypt)
743 if (t && (t[0] ==
'0') && (t[1] ==
'\0'))
769 struct Buffer *pretty = NULL, *msg = NULL;
771 for (
int i = 0; i < actx->
idxlen; i++)
785 mutt_error(
_(
"Attachment #%d no longer exists: %s"), i + 1,
831 struct MuttWindow *win,
int row,
size_t max_lines)
862 more_len = snprintf(more,
sizeof(more),
863 ngettext(
"(+%d more)",
"(+%d more)", count), count);
866 int reserve = ((count > 0) && (lines_used == max_lines)) ? more_len : 0;
868 np->
data, addr_len, width_left, reserve, lines_used);
869 if (addr_len >= (width_left - reserve))
872 if (lines_used == max_lines)
896 if (addr_len < width_left)
901 width_left -= addr_len;
921 for (
int i = lines_used; i < max_lines; i++)
938 const char *overflow_text =
"...";
1023 const bool c_compose_show_user_headers =
1025 if (c_compose_show_user_headers)
1042 char buf[8192] = { 0 };
1043 char old_list[8192] = { 0 };
1076 int rindex = actx->
v2r[x];
1078 if ((rindex == 0) && (actx->
idxlen == 1))
1080 mutt_error(
_(
"You may not delete the only attachment"));
1081 idx[rindex]->body->tagged =
false;
1085 for (
int y = 0; y < actx->
idxlen; y++)
1089 idx[y]->body->next =
idx[rindex]->body->next;
1094 idx[rindex]->body->next = NULL;
1110 idx[rindex]->body->parts = NULL;
1114 for (; rindex < actx->
idxlen - 1; rindex++)
1115 idx[rindex] =
idx[rindex + 1];
1132 for (; m; m = m->
next)
1228 NONULL(c_compose_format));
1255 for (
struct Body *part = msg; part; part = part->
next)
1257 if (part->next ==
idx[first]->body)
1259 idx[first]->body->next =
idx[first + 1]->body->next;
1260 idx[first + 1]->body->next =
idx[first]->body;
1261 part->next =
idx[first + 1]->body;
1268 idx[first] =
idx[first + 1];
1269 idx[first + 1] = saved;
1272 int i =
idx[first]->num;
1273 idx[first]->num =
idx[first + 1]->num;
1274 idx[first + 1]->num = i;
1291 struct Body *b = NULL;
1295 for (
unsigned short i = 0; i < actx->
idxlen; i++)
1334 char op,
const char *src,
const char *prec,
1335 const char *if_str,
const char *else_str,
1338 char fmt[128], tmp[128];
1340 struct Menu *menu = (
struct Menu *) data;
1346 snprintf(fmt,
sizeof(fmt),
"%%%sd", prec);
1347 snprintf(buf, buflen, fmt, menu->
max);
1351 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
1356 snprintf(fmt,
sizeof(fmt),
"%%%ss", prec);
1358 snprintf(buf, buflen, fmt, tmp);
1370 snprintf(buf, buflen,
"%%%s%c", prec, op);
1392 struct Menu *menu,
const char *src)
1421 if (c_status_on_top)
1480 bool fcc_set =
false;
1522 const bool c_status_on_top =
cs_subset_bool(sub,
"status_on_top");
1523 if (c_status_on_top)
1574 bool redraw_env =
false;
1592 case OP_COMPOSE_EDIT_FROM:
1601 case OP_COMPOSE_EDIT_TO:
1616 case OP_COMPOSE_EDIT_BCC:
1631 case OP_COMPOSE_EDIT_CC:
1647 case OP_COMPOSE_EDIT_NEWSGROUPS:
1659 case OP_COMPOSE_EDIT_FOLLOWUP_TO:
1671 case OP_COMPOSE_EDIT_X_COMMENT_TO:
1674 if (!(news && c_x_comment_to))
1687 case OP_COMPOSE_EDIT_SUBJECT:
1701 case OP_COMPOSE_EDIT_REPLY_TO:
1709 case OP_COMPOSE_EDIT_FCC:
1712 false, NULL, NULL, NULL) == 0)
1725 case OP_COMPOSE_EDIT_MESSAGE:
1728 if (!c_edit_headers)
1743 case OP_COMPOSE_EDIT_HEADERS:
1746 const char *tag = NULL;
1775 case OP_COMPOSE_ATTACH_KEY:
1794 case OP_COMPOSE_MOVE_UP:
1802 mutt_error(
_(
"The fundamental part can't be moved"));
1810 case OP_COMPOSE_MOVE_DOWN:
1818 mutt_error(
_(
"The fundamental part can't be moved"));
1826 case OP_COMPOSE_GROUP_ALTS:
1831 _(
"Grouping 'alternatives' requires at least 2 tagged messages"));
1840 struct Body *alts = NULL;
1843 for (
int i = 0; bptr;)
1851 #define ALTS_TAG "Alternatives for \"%s\""
1873 group->
parts = bptr;
1879 for (
int j = i; j < actx->
idxlen - 1; j++)
1881 actx->
idx[j] = actx->
idx[j + 1];
1882 actx->
idx[j + 1] = NULL;
1907 case OP_COMPOSE_GROUP_LINGUAL:
1912 _(
"Grouping 'multilingual' requires at least 2 tagged messages"));
1917 int tagged_with_lang_num = 0;
1919 if (b->tagged && b->language && *b->language)
1920 tagged_with_lang_num++;
1922 if (menu->
tagged != tagged_with_lang_num)
1925 _(
"Not all parts have 'Content-Language' set, continue?"),
MUTT_YES) !=
MUTT_YES)
1937 struct Body *alts = NULL;
1940 for (
int i = 0; bptr;)
1948 #define LINGUAL_TAG "Multilingual part for \"%s\""
1970 group->
parts = bptr;
1976 for (
int j = i; j < actx->
idxlen - 1; j++)
1978 actx->
idx[j] = actx->
idx[j + 1];
1979 actx->
idx[j + 1] = NULL;
2004 case OP_COMPOSE_ATTACH_FILE:
2006 char *prompt =
_(
"Attach file");
2008 char **files = NULL;
2015 for (
int i = 0; i < numfiles; i++)
2023 bool added_attachment =
false;
2027 "Attaching selected files...", numfiles));
2029 for (
int i = 0; i < numfiles; i++)
2031 char *att = files[i];
2037 added_attachment =
true;
2054 if (added_attachment)
2059 case OP_COMPOSE_ATTACH_MESSAGE:
2061 case OP_COMPOSE_ATTACH_NEWS_MESSAGE:
2065 char *prompt =
_(
"Open mailbox to attach message from");
2069 if (
Context && (op == OP_COMPOSE_ATTACH_NEWS_MESSAGE))
2076 prompt =
_(
"Open newsgroup to attach message from");
2172 bool added_attachment =
false;
2185 added_attachment =
true;
2207 if (added_attachment)
2225 case OP_COMPOSE_TOGGLE_RECODE:
2230 mutt_error(
_(
"Recoding only affects text attachments"));
2235 mutt_message(
_(
"The current attachment won't be converted"));
2237 mutt_message(
_(
"The current attachment will be converted"));
2243 case OP_COMPOSE_EDIT_DESCRIPTION:
2259 case OP_COMPOSE_UPDATE_ENCODING:
2262 bool encoding_updated =
false;
2265 struct Body *top = NULL;
2266 for (top = e->
body; top; top = top->
next)
2270 encoding_updated =
true;
2279 encoding_updated =
true;
2282 if (encoding_updated)
2287 case OP_COMPOSE_TOGGLE_DISPOSITION:
2307 case OP_COMPOSE_EDIT_LANGUAGE:
2325 case OP_COMPOSE_EDIT_ENCODING:
2328 if ((
mutt_get_field(
"Content-Transfer-Encoding: ", buf,
sizeof(buf),
2348 case OP_COMPOSE_SEND_MESSAGE:
2377 case OP_COMPOSE_EDIT_FILE:
2389 case OP_COMPOSE_TOGGLE_UNLINK:
2397 case OP_COMPOSE_GET_ATTACHMENT:
2414 case OP_COMPOSE_RENAME_ATTACHMENT:
2435 case OP_COMPOSE_RENAME_FILE:
2440 NULL, NULL, NULL) == 0) &&
2444 if (stat(
CUR_ATTACH->body->filename, &st) == -1)
2464 case OP_COMPOSE_NEW_MIME:
2468 NULL, NULL, NULL) != 0) ||
2476 char type[256] = { 0 };
2484 char *p = strchr(type,
'/');
2487 mutt_error(
_(
"Content-Type is of the form base/sub"));
2511 mutt_error(
_(
"What we have here is a failure to make an attachment"));
2531 case OP_COMPOSE_EDIT_MIME:
2541 case OP_VIEW_ATTACH:
2542 case OP_DISPLAY_HEADERS:
2566 if (op == OP_FILTER)
2579 for (
int i = 0; i < actx->
idxlen; i++)
2585 for (
int i = 0; i < actx->
idxlen; i++)
2604 case OP_COMPOSE_POSTPONE_MESSAGE:
2615 case OP_COMPOSE_ISPELL:
2630 case OP_COMPOSE_WRITE_MESSAGE:
2657 case OP_COMPOSE_PGP_MENU:
2692 case OP_FORGET_PASSPHRASE:
2696 case OP_COMPOSE_SMIME_MENU:
2733 case OP_COMPOSE_MIX:
2741 #ifdef USE_AUTOCRYPT
2742 case OP_COMPOSE_AUTOCRYPT_MENU:
2779 #ifdef USE_AUTOCRYPT
void ctx_free(struct Context **ptr)
Free a Context.
static const char * There_are_no_attachments
char * subject
Email's subject.
static const struct Mapping ComposeNewsHelp[]
Help Bar for the News Compose dialog.
@ MT_COLOR_COMPOSE_HEADER
Header labels, e.g. From:
struct MuttWindow * win_attach
List of Attachments.
void mutt_generate_boundary(struct ParameterList *pl)
Create a unique boundary id for a MIME part.
struct AddressList bcc
Email's 'Bcc' list.
#define STAILQ_INIT(head)
@ WT_CUSTOM
Window with a custom drawing function.
@ ENC_QUOTED_PRINTABLE
Quoted-printable text.
void dialog_pop(void)
Hide a Window from the user.
struct Body * crypt_pgp_make_key_attachment(void)
Wrapper for CryptModuleSpecs::pgp_make_key_attachment()
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
static void snd_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
Format a menu item for the attachment list - Implements Menu::make_entry()
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
#define MUTT_READONLY
Open in read-only mode.
int autocrypt_rec_override
static void update_crypt_info(struct ComposeRedrawData *rd)
Update the crypto info.
QuadOption
Possible values for a quad-option.
Data passed to a notification function.
struct ListNode * header_find(const struct ListHead *hdrlist, const char *header)
Find a header, matching on its field, in a list of headers.
#define STAILQ_FOREACH_FROM(var, head, field)
char * followup_to
List of 'followup-to' fields.
struct MuttWindow * win_abar
Attachments label.
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
static int delete_attachment(struct AttachCtx *actx, int x)
Delete an attachment.
int attach_tag(struct Menu *menu, int sel, int act)
Tag an attachment - Implements Menu::tag()
static void redraw_mix_line(struct ListHead *chain, struct ComposeRedrawData *rd, int row)
Redraw the Mixmaster chain.
struct AttachCtx * mutt_actx_new(void)
Create a new Attachment Context.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
void mutt_stamp_attachment(struct Body *a)
Timestamp an Attachment.
int mutt_window_printf(const char *fmt,...)
Write a formatted string to a Window.
static void compose_custom_redraw(struct Menu *menu)
Redraw the compose menu - Implements Menu::custom_redraw()
short vcount
The number of virtual attachments.
void mutt_actx_entries_free(struct AttachCtx *actx)
Free entries in an Attachment Context.
@ ENC_UUENCODED
UUEncoded text.
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
int mutt_window_mvprintw(struct MuttWindow *win, int col, int row, const char *fmt,...)
Move the cursor and write a formatted string to a Window.
#define MUTT_SEND2_HOOK
send2-hook: when changing fields in the compose menu
struct Email ** emails
Array of Emails.
struct Content * content
Detailed info about the content of the attachment.
void mutt_window_clear(struct MuttWindow *win)
Clear a Window.
int mutt_system(const char *cmd)
Run an external command.
void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct)
Make fully qualified url from newsgroup name.
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
@ MT_COLOR_STATUS
Status bar (takes a pattern)
int mutt_env_to_intl(struct Envelope *env, const char **tag, char **err)
Convert an Envelope's Address fields to Punycode format.
String manipulation buffer.
@ LL_DEBUG3
Log at debug level 3.
int mutt_addrlist_to_intl(struct AddressList *al, char **err)
Convert an Address list to Punycode.
@ HDR_FCC
"Fcc:" (save folder) field
struct ConnAccount account
Account details: username, password, etc.
static int draw_envelope_addr(int field, struct AddressList *al, struct MuttWindow *win, int row, size_t max_lines)
Write addresses to the compose window.
struct Mailbox * ctx_mailbox(struct Context *ctx)
wrapper to get the mailbox in a Context, or NULL
void mutt_update_encoding(struct Body *a, struct ConfigSubset *sub)
Update the encoding type.
static void mutt_gen_compose_attach_list(struct AttachCtx *actx, struct Body *m, int parent_type, int level)
Generate the attachment list for the compose screen.
#define SEC_OPPENCRYPT
Opportunistic encrypt mode.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
void mutt_buffer_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
#define SEC_AUTOCRYPT_OVERRIDE
(Autocrypt) Indicates manual set/unset of encryption
SecurityFlags crypt_smime_send_menu(struct Email *e)
Wrapper for CryptModuleSpecs::send_menu()
struct Body * next
next attachment in the list
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
static int MaxHeaderWidth
struct MuttWindow * index_pager_init(void)
Allocate the Windows for the Index/Pager.
void mutt_buffer_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
@ NT_HEADER_CHANGE
An existing header has been changed.
#define SEC_ENCRYPT
Email is encrypted.
void dialog_push(struct MuttWindow *dlg)
Display a Window to the user.
int mutt_check_encoding(const char *c)
Check the encoding type.
FILE * fp
Used in the recvattach menu.
struct Body * mutt_remove_multipart(struct Body *b)
Extract the multipart body if it exists.
#define SEC_SIGN
Email is signed.
#define MAX_ADDR_ROWS
Maximum number of rows to use for the To:, Cc:, Bcc: fields.
size_t mutt_addrlist_write(const struct AddressList *al, char *buf, size_t buflen, bool display)
Write an Address to a buffer.
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
#define MUTT_SEL_NO_FLAGS
No flags are set.
@ MUTT_POP
'POP3' Mailbox type
struct Notify * notify
Notifications handler.
bool message_is_tagged(struct Context *ctx, struct Email *e)
Is a message in the index tagged (and within limit)
An email to which things will be attached.
A division of the screen.
int mutt_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question.
#define MAX_USER_HDR_ROWS
Maximum number of rows to use for the Headers: field.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
SortType
Methods for sorting.
bool crypt_has_module_backend(SecurityFlags type)
Is there a crypto backend for a given type?
struct Body * mutt_make_multipart(struct Body *b)
Create a multipart email.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
void mutt_expand_aliases(struct AddressList *al)
Expand aliases in a List of Addresses.
@ HDR_REPLYTO
"Reply-To:" field
char * mutt_str_dup(const char *str)
Copy a string, safely.
@ MT_COLOR_BOLD
Bold text.
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
@ LL_DEBUG1
Log at debug level 1.
static void draw_floating(struct MuttWindow *win, int col, int row, const char *text)
Draw a floating label.
int mutt_strwidth(const char *s)
Measure a string's width in screen cells.
char * x_comment_to
List of 'X-comment-to' fields.
enum ContentType mutt_check_mime_type(const char *s)
Check a MIME type string.
struct MuttWindow * win_envelope
Envelope: From, To, etc.
int mix_check_message(struct Email *e)
Safety-check the message before passing it to mixmaster.
static void draw_envelope(struct ComposeRedrawData *rd)
Write the email headers to the compose window.
long hibin
8-bit characters
#define STAILQ_FIRST(head)
unsigned int disposition
content-disposition, ContentDisposition
void mutt_draw_statusline(int cols, const char *buf, size_t buflen)
Draw a highlighted status bar.
#define TAILQ_INSERT_TAIL(head, elm, field)
@ AUTOCRYPT_REC_YES
Autocrypt should be used.
unsigned int encoding
content-transfer-encoding, ContentEncoding
size_t dsize
Length of data.
@ DISP_ATTACH
Content is attached.
long lobin
Unprintable 7-bit chars (eg., control chars)
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
@ HDR_ATTACH_TITLE
The "-- Attachments" line.
@ MUTT_ABORT
User aborted the question (with Ctrl-G)
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
struct ListNode * header_set(struct ListHead *hdrlist, const char *header)
Set a header value in a list.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
#define STAILQ_EMPTY(head)
@ HDR_CRYPTINFO
"Sign as:" field (encryption/signing info)
bool tagged
This attachment is tagged.
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
WHERE struct Context * Context
void mutt_body_free(struct Body **ptr)
Free a Body.
char * subtype
content-type subtype
struct Mailbox * mx_path_resolve(const char *path)
Get a Mailbox for a path.
@ WT_DLG_COMPOSE
Compose Dialog, mutt_compose_menu()
#define STAILQ_FOREACH(var, head, field)
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.
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.
@ MT_COLOR_NORMAL
Plain text.
static int check_attachments(struct AttachCtx *actx, struct ConfigSubset *sub)
Check if any attachments have changed or been deleted.
static void calc_header_width_padding(int idx, const char *header, bool calc_max)
Calculate the width needed for the compose labels.
const char * attach_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 string for the attachment menu - Implements format_t.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Mapping between user-readable string and a constant.
static void autocrypt_compose_menu(struct Email *e, const struct ConfigSubset *sub)
Autocrypt compose settings.
static void draw_header_content(struct MuttWindow *win, int row, enum HeaderField field, const char *content)
Draw content on a separate line aligned to header prompt.
#define MUTT_ALIAS
Do alias "completion" by calling up the alias-menu.
struct AddressList reply_to
Email's 'reply-to'.
#define MUTT_FILE
Do file completion.
#define TAILQ_REMOVE(head, elm, field)
static int calc_envelope(struct ComposeRedrawData *rd)
Calculate how many rows the envelope will need.
void mutt_str_pretty_size(char *buf, size_t buflen, size_t num)
Display an abbreviated size, like 3.4K.
struct AddressList cc
Email's 'Cc' list.
enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt)
Ask the user a quad-question.
@ HDR_XCOMMENTTO
"X-Comment-To:" field
struct Body * mutt_body_new(void)
Create a new Body.
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
const char * mutt_path_basename(const char *f)
Find the last component for a pathname.
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
@ HDR_AUTOCRYPT
"Autocrypt:" and "Recommendation:" fields
@ MT_COLOR_COMPOSE_SECURITY_NONE
Mail will not be encrypted or signed.
enum MailboxType nntp_path_probe(const char *path, const struct stat *st)
Is this an NNTP Mailbox? - Implements MxOps::path_probe()
@ NT_HEADER
A header has changed, NotifyHeader EventHeader.
void mutt_edit_file(const char *editor, const char *file)
Let the user edit a file.
@ HDR_SUBJECT
"Subject:" field
enum MailboxType type
Mailbox type.
void mutt_paddstr(int n, const char *s)
Display a string on screen, padded if necessary.
bool mutt_edit_content_type(struct Email *e, struct Body *b, FILE *fp)
Edit the content type of an attachment.
@ MT_COLOR_COMPOSE_SECURITY_SIGN
Mail will be signed.
size_t mutt_buffer_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
struct Body * mutt_make_file_attach(const char *path, struct ConfigSubset *sub)
Create a file attachment.
void mutt_pipe_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *top, bool filter)
Pipe a list of attachments to a command.
SecurityFlags mutt_is_multipart_encrypted(struct Body *b)
Does the message have encrypted parts?
int level
Nesting depth of attachment.
enum MxStatus mx_mbox_close(struct Context **ptr)
Save changes and close mailbox.
bool notify_observer_remove(struct Notify *notify, observer_t callback, void *global_data)
Remove an observer from an object.
WHERE bool OptAttachMsg
(pseudo) used by attach-message
@ MENU_COMPOSE
Compose an email.
const char * OpStrings[][2]
#define APPLICATION_PGP
Use PGP to encrypt/sign.
void mutt_rfc3676_space_unstuff(struct Email *e)
Remove RFC3676 space stuffing.
enum AutocryptRec autocrypt_rec
static void compose_attach_swap(struct Body *msg, struct AttachPtr **idx, short first)
Swap two adjacent entries in the attachment list.
@ HDR_MIX
"Mix:" field (Mixmaster chain)
static int calc_security(struct Email *e, short *rows, const struct ConfigSubset *sub)
Calculate how many rows the security info will need.
int msg_count
Total number of messages.
int mutt_compose_attachment(struct Body *a)
Create an attachment.
struct Body * mutt_make_message_attach(struct Mailbox *m, struct Email *e, bool attach_msg, struct ConfigSubset *sub)
Create a message attachment.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
static void compose_status_line(char *buf, size_t buflen, size_t col, int cols, struct Menu *menu, const char *p)
Compose the string for the status bar.
void mutt_env_to_local(struct Envelope *env)
Convert an Envelope's Address fields to local format.
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
struct MuttWindow * mutt_window_find(struct MuttWindow *root, enum WindowType type)
Find a Window of a given type.
#define MUTT_SEL_MULTI
Multi-selection is enabled.
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
char * description
content-description
void * global_data
Data from notify_observer_add()
int mutt_addrlist_parse2(struct AddressList *al, const char *s)
Parse a list of email addresses.
struct MuttWindow * win_cbar
Compose bar.
static int draw_envelope_user_hdrs(const struct ComposeRedrawData *rd, int row)
Write user-defined headers to the compose window.
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
@ MUTT_IMAP
'IMAP' Mailbox type
@ HDR_FOLLOWUPTO
"Followup-To:" field
struct AddressList to
Email's 'To' list.
struct Body * parts
parts of a multipart or message/rfc822
struct Body * body
Attachment.
static const char * compose_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)
Create the status bar string for compose mode - Implements format_t.
static void update_idx(struct Menu *menu, struct AttachCtx *actx, struct AttachPtr *ap)
Add a new attchment to the message.
struct Envelope * env
Envelope information.
long ascii
Number of ascii chars.
static int compose_config_observer(struct NotifyCallback *nc)
Listen for config changes affecting the Compose menu - Implements observer_t.
#define mutt_debug(LEVEL,...)
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
@ MUTT_NO
User answered 'No', or assume 'No'.
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
@ NT_HEADER_REMOVE
A header is about to be removed.
void mutt_update_tree(struct AttachCtx *actx)
Refresh the list of attachments.
void mutt_buffer_expand_path(struct Buffer *buf)
Create the canonical path.
struct NntpAccountData * nntp_select_server(struct Mailbox *m, const char *server, bool leave_lock)
Open a connection to an NNTP server.
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.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
struct MuttWindow * parent
Parent Window.
struct ListHead chain
Mixmaster chain.
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
enum MailboxType pop_path_probe(const char *path, const struct stat *st)
Is this a POP Mailbox? - Implements MxOps::path_probe()
enum QuadOption cs_subset_quad(const struct ConfigSubset *sub, const char *name)
Get a quad-value config item by name.
const struct Mapping * help_data
Data for the Help Bar.
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
void * event_data
Data from notify_send()
HeaderField
Ordered list of headers for the compose screen.
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
static void draw_header(struct MuttWindow *win, int row, enum HeaderField field)
Draw an aligned label.
@ NT_HEADER_ADD
A new header has been added.
struct WindowState state
Current state of the Window.
char * newsgroups
List of newsgroups.
int mutt_edit_attachment(struct Body *a)
Edit an attachment.
static const struct Mapping ComposeHelp[]
Help Bar for the Compose dialog.
@ WT_INDEX
An Index Window containing a selection list.
Keep track when the compose screen needs redrawing.
void crypt_forget_passphrase(void)
Forget a passphrase and display a message.
short req_rows
Number of rows required.
#define STAILQ_HEAD_INITIALIZER(head)
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
bool readonly
Don't allow changes to the mailbox.
@ MT_COLOR_COMPOSE_SECURITY_ENCRYPT
Mail will be encrypted.
struct ListHead userhdrs
user defined headers
struct AddressList from
Email's 'From' list.
@ HDR_NEWSGROUPS
"Newsgroups:" field
static void init_header_padding(void)
Calculate how much padding the compose table will need.
static unsigned long cum_attachs_size(struct Menu *menu)
Cumulative Attachments Size.
long crlf
\r and \n characters
time_t stamp
Time stamp of last encoding update.
struct AttachPtr * aptr
Menu information, used in recvattach.c.
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.
static int calc_address(struct AddressList *al, struct ListHead *slist, short cols, short *srows)
Calculate how many rows an AddressList will need.
@ ENC_BASE64
Base-64 encoded text.
@ WT_INDEX_BAR
Index Bar containing status info about the Index.
WHERE char * ShortHostname
Short version of the hostname.
struct ConfigSubset * sub
Inherited config items.
const struct ConfigSubset * sub
Config Subset.
static bool edit_address_list(int field, struct AddressList *al)
Let the user edit the address list.
const char * name
Name of config item that changed.
#define MUTT_COMPOSE_NOFREEHEADER
Container for Accounts, Notifications.
@ DISP_INLINE
Content is inline.
#define SEC_INLINE
Email has an inline signature.
void crypt_opportunistic_encrypt(struct Email *e)
Can all recipients be determined.
struct Email * email
Used by recvattach for updating.
static const char * AutocryptRecUiFlags[]
Info about an attachment.
unsigned int type
content-type primary type, ContentType
@ ENC_OTHER
Encoding unknown.
void header_free(struct ListHead *hdrlist, struct ListNode *target)
Free and remove a header from a header list.
struct Context * mx_mbox_open(struct Mailbox *m, OpenMailboxFlags flags)
Open a mailbox and parse it.
@ TYPE_OTHER
Unknown Content-Type.
int mutt_file_rename(const char *oldfile, const char *newfile)
Rename a file.
int mutt_attach_display_loop(struct Menu *menu, int op, struct Email *e, struct AttachCtx *actx, bool recv)
Event loop for the Attachment menu.
void mutt_curses_set_color(enum ColorId color)
Set the current colour for text.
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe()
char * tree
Tree characters to display.
void mutt_actx_free(struct AttachCtx **ptr)
Free an Attachment Context.
short * v2r
Mapping from virtual to real attachment.
int mutt_compose_menu(struct Email *e, struct Buffer *fcc, struct Email *e_cur, uint8_t flags, struct ConfigSubset *sub)
Allow the user to edit the message envelope.
static int compose_header_observer(struct NotifyCallback *nc)
Listen for header changes - Implements observer_t.
static void mutt_update_compose_menu(struct AttachCtx *actx, struct Menu *menu, bool init)
Redraw the compose window.
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
#define MUTT_CLEAR
Clear input if printable character is pressed.
void mutt_refresh(void)
Force a refresh of the screen.
struct AttachPtr ** idx
Array of attachments.
static const char *const Prompts[]
@ HDR_CRYPT
"Security:" field (encryption/signing info)
int mutt_get_tmp_attachment(struct Body *a)
Get a temporary copy of an attachment.
bool mutt_is_text_part(struct Body *b)
Is this part of an email in plain text?
int mutt_window_mvaddstr(struct MuttWindow *win, int col, int row, const char *str)
Move the cursor and write a fixed string to a Window.
#define STAILQ_NEXT(elm, field)
WHERE bool OptNewsSend
(pseudo) used to change behavior when posting
int mutt_addrlist_to_local(struct AddressList *al)
Convert an Address list from Punycode.
int mutt_get_field(const char *field, char *buf, size_t buflen, CompletionFlags complete, bool multiple, char ***files, int *numfiles)
Ask the user for a string.
struct Email * email
header information for message/rfc822
void mutt_rfc3676_space_stuff(struct Email *e)
Perform RFC3676 space stuffing on an Email.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
bool unlink
If true, filename should be unlink()ed before free()ing this structure.
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
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.
int parent_type
Type of parent attachment, e.g. TYPE_MULTIPART.
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
void mx_fastclose_mailbox(struct Mailbox *m)
free up memory associated with the Mailbox
#define TAILQ_INSERT_HEAD(head, elm, field)
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
size_t mutt_addrlist_write_list(const struct AddressList *al, struct ListHead *list)
Write Addresses to a List.
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
struct ParameterList parameter
parameters of the content-type
enum AutocryptRec mutt_autocrypt_ui_recommendation(struct Mailbox *m, struct Email *e, char **keylist)
Get the recommended action for an Email.
A set of inherited config items.
int mutt_window_addstr(const char *str)
Write a string to a Window.
struct MuttWindowList children
Children Windows.
enum QuadOption mutt_yesorno(const char *msg, enum QuadOption def)
Ask the user a Yes/No question.
char * data
Pointer to data.
@ TYPE_MULTIPART
Type: 'multipart/*'.
The envelope/body of an email.
void mutt_attach_init(struct AttachCtx *actx)
Create a new Attachment context.
@ MT_COLOR_COMPOSE_SECURITY_BOTH
Mail will be encrypted and signed.
void mutt_save_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *top, struct Email *e, struct Menu *menu)
Save a list of attachments.
void mutt_actx_add_attach(struct AttachCtx *actx, struct AttachPtr *attach)
Add an Attachment to an Attachment Context.
#define mutt_message(...)
void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *top)
Print a list of Attachments.
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
const char * mutt_make_version(void)
Generate the NeoMutt version string.
static int redraw_crypt_lines(struct ComposeRedrawData *rd, int row)
Update the encryption info in the compose window.
AutocryptRec
Recommendation.
static int HeaderPadding[HDR_ATTACH_TITLE]
#define mutt_warning(...)
struct Buffer mutt_buffer_make(size_t size)
Make a new buffer on the stack.
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
bool unowned
Don't unlink on detach.
void dlg_select_mixmaster_chain(struct MuttWindow *win, struct ListHead *chainhead, int cols)
Create a Mixmaster chain.
@ HDR_CUSTOM_HEADERS
"Headers:" field
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
void index_pager_shutdown(struct MuttWindow *dlg)
Clear up any non-Window parts.
short idxlen
Number of attachmentes.
struct Content * mutt_get_content_info(const char *fname, struct Body *b, struct ConfigSubset *sub)
Analyze file to determine MIME encoding to use.
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
SecurityFlags crypt_pgp_send_menu(struct Email *e)
Wrapper for CryptModuleSpecs::send_menu()
static int calc_user_hdrs(const struct ListHead *hdrs)
Calculate how many rows are needed for user-defined headers.
char * filename
when sending a message, this is the file to which this structure refers
struct Body * body
List of MIME parts.
int mutt_index_menu(struct MuttWindow *dlg)
Display a list of emails.
WHERE bool OptNews
(pseudo) used to change reader mode
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
#define MUTT_COMP_NO_FLAGS
No flags are set.