32#include "docs/makedoc_defs.h"
56 "Function not permitted in attach-message mode");
63 {
"bounce-message", OP_BOUNCE_MESSAGE },
64 {
"check-traditional-pgp", OP_CHECK_TRADITIONAL },
65 {
"collapse-parts", OP_ATTACHMENT_COLLAPSE },
66 {
"compose-to-sender", OP_COMPOSE_TO_SENDER },
67 {
"delete-entry", OP_ATTACHMENT_DELETE },
68 {
"display-toggle-weed", OP_DISPLAY_HEADERS },
69 {
"edit-type", OP_ATTACHMENT_EDIT_TYPE },
71 {
"extract-keys", OP_EXTRACT_KEYS },
72 {
"followup-message", OP_FOLLOWUP },
73 {
"forget-passphrase", OP_FORGET_PASSPHRASE },
74 {
"forward-message", OP_FORWARD_MESSAGE },
75 {
"forward-to-group", OP_FORWARD_TO_GROUP },
76 {
"group-chat-reply", OP_GROUP_CHAT_REPLY },
77 {
"group-reply", OP_GROUP_REPLY },
78 {
"list-reply", OP_LIST_REPLY },
79 {
"list-subscribe", OP_LIST_SUBSCRIBE },
80 {
"list-unsubscribe", OP_LIST_UNSUBSCRIBE },
81 {
"pipe-entry", OP_PIPE },
82 {
"pipe-message", OP_PIPE },
83 {
"print-entry", OP_ATTACHMENT_PRINT },
84 {
"reply", OP_REPLY },
85 {
"resend-message", OP_RESEND },
86 {
"save-entry", OP_ATTACHMENT_SAVE },
87 {
"undelete-entry", OP_ATTACHMENT_UNDELETE },
88 {
"view-attach", OP_ATTACHMENT_VIEW },
89 {
"view-mailcap", OP_ATTACHMENT_VIEW_MAILCAP },
90 {
"view-pager", OP_ATTACHMENT_VIEW_PAGER },
91 {
"view-text", OP_ATTACHMENT_VIEW_TEXT },
99 { OP_ATTACHMENT_COLLAPSE,
"v" },
100 { OP_ATTACHMENT_DELETE,
"d" },
101 { OP_ATTACHMENT_EDIT_TYPE,
"\005" },
104 { OP_ATTACHMENT_PRINT,
"p" },
105 { OP_ATTACHMENT_SAVE,
"s" },
106 { OP_ATTACHMENT_UNDELETE,
"u" },
107 { OP_ATTACHMENT_VIEW,
"<keypadenter>" },
108 { OP_ATTACHMENT_VIEW,
"\n" },
109 { OP_ATTACHMENT_VIEW,
"\r" },
110 { OP_ATTACHMENT_VIEW_MAILCAP,
"m" },
111 { OP_ATTACHMENT_VIEW_TEXT,
"T" },
112 { OP_BOUNCE_MESSAGE,
"b" },
113 { OP_CHECK_TRADITIONAL,
"\033P" },
114 { OP_DISPLAY_HEADERS,
"h" },
115 { OP_EXTRACT_KEYS,
"\013" },
116 { OP_FORGET_PASSPHRASE,
"\006" },
117 { OP_FORWARD_MESSAGE,
"f" },
118 { OP_GROUP_REPLY,
"g" },
119 { OP_LIST_REPLY,
"L" },
121 { OP_RESEND,
"\033e" },
133 int rindex, curlevel;
141 curlevel = cur_att->
level;
143 rindex = actx->
v2r[index] + 1;
146 while ((rindex < actx->idxlen) && (actx->
idx[rindex]->
level > curlevel))
204 for (
int i = 0; i < actx->
idxlen; i++)
233 for (
int i = 0; i < actx->
idxlen; i++)
275 mutt_error(
_(
"Can't delete attachment from POP server"));
282 mutt_error(
_(
"Can't delete attachment from news server"));
288 mutt_message(
_(
"Deletion of attachments from encrypted messages is unsupported"));
293 mutt_message(
_(
"Deletion of attachments from signed messages may invalidate the signature"));
298 for (
int i = 0; i < priv->
menu->
max; i++)
309 mutt_message(
_(
"Only deletion of multipart attachments is supported"));
322 if (c_resolve && (index < priv->menu->max))
333 mutt_message(
_(
"Only deletion of multipart attachments is supported"));
357 cur_att->
body,
false);
383 if (!priv->
menu->
tag_prefix && c_resolve && (index < priv->menu->max))
398 for (
int i = 0; i < priv->
menu->
max; i++)
413 if (c_resolve && (index < priv->menu->max))
602 if (op == OP_GROUP_REPLY)
604 else if (op == OP_GROUP_CHAT_REPLY)
606 else if (op == OP_LIST_REPLY)
715 if (!dlg || !dlg->
wdata)
void mutt_actx_free(struct AttachCtx **ptr)
Free an Attachment Context.
const struct MenuOpSeq AttachmentDefaultBindings[]
Key bindings for the Attachment Menu.
static bool check_attach(struct AttachPrivateData *priv)
Check if in attach-message mode.
static void attach_collapse(struct AttachCtx *actx, struct Menu *menu)
Close the tree of the current attachment.
static int recvattach_pgp_check_traditional(struct AttachCtx *actx, struct Menu *menu)
Is the Attachment inline PGP?
const struct MenuFuncOp OpAttachment[]
Functions for the Attachment Menu.
static const char * Function_not_permitted_in_attach_message_mode
Error message for unavailable functions in attach mode.
static const struct AttachFunction AttachFunctions[]
All the NeoMutt functions that the Attach supports.
static bool check_readonly(struct Mailbox *m)
Check if the Mailbox is readonly.
static void recvattach_extract_pgp_keys(struct AttachCtx *actx, struct Menu *menu)
Extract PGP keys from attachments.
Handling of email attachments.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
@ MUTT_POP
'POP3' Mailbox type
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
void crypt_forget_passphrase(void)
Forget a passphrase and display a message.
SecurityFlags crypt_query(struct Body *b)
Check out the type of encryption used.
bool crypt_pgp_check_traditional(FILE *fp, struct Body *b, bool just_one)
Wrapper for CryptModuleSpecs::pgp_check_traditional()
void crypt_pgp_extract_key_from_attachment(FILE *fp, struct Body *b)
Wrapper for CryptModuleSpecs::pgp_extract_key_from_attachment()
void mutt_flushinp(void)
Empty all the keyboard buffers.
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_DONE
Exit the Dialog.
@ FR_UNKNOWN
Unknown function.
@ FR_ERROR
Valid function - error occurred.
@ FR_CONTINUE
Remain in the Dialog.
@ FR_NO_ACTION
Valid function - no action performed.
Structs that make up an email.
static int op_exit(struct AliasMenuData *mdata, int op)
exit this menu - Implements alias_function_t -
static int op_attachment_print(struct AttachPrivateData *priv, int op)
print the current entry - Implements attach_function_t -
static int op_followup(struct AttachPrivateData *priv, int op)
followup to newsgroup - Implements attach_function_t -
static int op_forward_message(struct AttachPrivateData *priv, int op)
forward a message with comments - Implements attach_function_t -
static int op_attachment_collapse(struct AttachPrivateData *priv, int op)
toggle display of subparts - Implements attach_function_t -
static int op_bounce_message(struct AttachPrivateData *priv, int op)
remail a message to another user - Implements attach_function_t -
static int op_attachment_edit_type(struct AttachPrivateData *priv, int op)
edit attachment content type - Implements attach_function_t -
static int op_extract_keys(struct AttachPrivateData *priv, int op)
extract supported public keys - Implements attach_function_t -
static int op_reply(struct AttachPrivateData *priv, int op)
reply to a message - Implements attach_function_t -
static int op_attachment_view(struct AttachPrivateData *priv, int op)
view attachment using mailcap entry if necessary - Implements attach_function_t -
static int op_forward_to_group(struct AttachPrivateData *priv, int op)
forward to newsgroup - Implements attach_function_t -
static int op_attachment_view_mailcap(struct AttachPrivateData *priv, int op)
force viewing of attachment using mailcap - Implements attach_function_t -
static int op_compose_to_sender(struct AttachPrivateData *priv, int op)
compose new message to the current message sender - Implements attach_function_t -
static int op_attachment_pipe(struct AttachPrivateData *priv, int op)
pipe message/attachment to a shell command - Implements attach_function_t -
static int op_attachment_view_pager(struct AttachPrivateData *priv, int op)
view attachment in pager using copiousoutput mailcap - Implements attach_function_t -
static int op_forget_passphrase(struct AttachPrivateData *priv, int op)
wipe passphrases from memory - Implements attach_function_t -
static int op_attachment_undelete(struct AttachPrivateData *priv, int op)
undelete the current entry - Implements attach_function_t -
static int op_list_subscribe(struct AttachPrivateData *priv, int op)
subscribe to a mailing list - Implements attach_function_t -
static int op_attachment_delete(struct AttachPrivateData *priv, int op)
delete the current entry - Implements attach_function_t -
static int op_attachment_save(struct AttachPrivateData *priv, int op)
save message/attachment to a mailbox/file - Implements attach_function_t -
static int op_attachment_view_text(struct AttachPrivateData *priv, int op)
view attachment as text - Implements attach_function_t -
static int op_list_unsubscribe(struct AttachPrivateData *priv, int op)
unsubscribe from a mailing list - Implements attach_function_t -
static int op_check_traditional(struct AttachPrivateData *priv, int op)
check for classic PGP - Implements attach_function_t -
static int op_resend(struct AttachPrivateData *priv, int op)
use the current message as a template for a new one - Implements attach_function_t -
int attach_function_dispatcher(struct MuttWindow *win, int op)
Perform a Attach function - Implements function_dispatcher_t -.
#define mutt_message(...)
Convenience wrapper for the gui headers.
@ TYPE_MULTIPART
Type: 'multipart/*'.
Convenience wrapper for the library headers.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
int mutt_view_attachment(FILE *fp, struct Body *b, enum ViewAttachMode mode, struct Email *e, struct AttachCtx *actx, struct MuttWindow *win)
View an attachment.
Handling of email attachments.
void mutt_save_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *b, struct Email *e, struct Menu *menu)
Save a list of attachments.
@ MUTT_VA_MAILCAP
Force viewing using mailcap entry.
@ MUTT_VA_PAGER
View attachment in pager using copiousoutput mailcap.
@ MUTT_VA_AS_TEXT
Force viewing as text.
int mutt_attach_display_loop(struct ConfigSubset *sub, struct Menu *menu, int op, struct Email *e, struct AttachCtx *actx, bool recv)
Event loop for the Attachment menu.
void mutt_pipe_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *b, bool filter)
Pipe a list of attachments to a command.
void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *b)
Print a list of Attachments.
API for encryption/signing of emails.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define SEC_PARTSIGN
Not all parts of the email is signed.
#define SEC_ENCRYPT
Email is encrypted.
#define SEC_SIGN
Email is signed.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
enum QuadOption query_quadoption(const char *prompt, struct ConfigSubset *sub, const char *name)
Ask the user a quad-question.
void mutt_update_recvattach_menu(struct AttachCtx *actx, struct Menu *menu, bool init)
Update the Attachment Menu.
struct AttachPtr * current_attachment(struct AttachCtx *actx, struct Menu *menu)
Get the current attachment.
void recvattach_edit_content_type(struct AttachCtx *actx, struct Menu *menu, struct Email *e)
Edit the content type of an attachment.
Routines for managing attachments.
void mutt_attach_resend(FILE *fp, struct Mailbox *m, struct AttachCtx *actx, struct Body *b)
Resend-message, from the attachment menu.
void mutt_attach_mail_sender(struct AttachCtx *actx, struct Body *b)
Compose an email to the sender in the email attachment.
void mutt_attach_forward(FILE *fp, struct Email *e, struct AttachCtx *actx, struct Body *b, SendFlags flags)
Forward an Attachment.
void attach_bounce_message(struct Mailbox *m, FILE *fp, struct AttachCtx *actx, struct Body *b)
Bounce function, from the attachment menu.
void mutt_attach_reply(FILE *fp, struct Mailbox *m, struct Email *e, struct AttachCtx *actx, struct Body *b, SendFlags flags)
Attach a reply.
Send/reply with an attachment.
Convenience wrapper for the send headers.
bool mutt_send_list_unsubscribe(struct Mailbox *m, struct Email *e)
Send a mailing-list unsubscription email.
bool mutt_send_list_subscribe(struct Mailbox *m, struct Email *e)
Send a mailing-list subscription email.
#define SEND_GROUP_CHAT_REPLY
Reply to all recipients preserving To/Cc.
uint32_t SendFlags
Flags for mutt_send_message(), e.g. SEND_REPLY.
#define SEND_GROUP_REPLY
Reply to all.
#define SEND_LIST_REPLY
Reply to mailing list.
#define SEND_NO_FLAGS
No flags are set.
#define SEND_REPLY
Reply to sender.
#define SEND_NEWS
Reply to a news article.
struct Email * email
Used by recvattach for updating.
struct AttachPtr ** idx
Array of attachments.
short idxlen
Number of attachmentes.
short * v2r
Mapping from virtual to real attachment.
attach_function_t function
Function to call.
int op
Op code, e.g. OP_ATTACHMENT_COLLAPSE.
Private state data for Attachments.
int op
Op returned from the Pager, e.g. OP_NEXT_ENTRY.
struct Menu * menu
Current Menu.
struct ConfigSubset * sub
Config subset.
struct AttachCtx * actx
List of all Attachments.
bool attach_msg
Are we in "attach message" mode?
struct Mailbox * mailbox
Current Mailbox.
An email to which things will be attached.
struct Body * body
Attachment.
bool collapsed
Group is collapsed.
int level
Nesting depth of attachment.
FILE * fp
Used in the recvattach menu.
int parent_type
Type of parent attachment, e.g. TYPE_MULTIPART.
struct Body * parts
parts of a multipart or message/rfc822
bool deleted
Attachment marked for deletion.
struct Email * email
header information for message/rfc822
bool tagged
This attachment is tagged.
char * subtype
content-type subtype
unsigned int type
content-type primary type, ContentType
struct Envelope * env
Envelope information.
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
bool changed
Email has been edited.
bool attach_del
Has an attachment marked for deletion.
char * followup_to
List of 'followup-to' fields.
enum MailboxType type
Mailbox type.
bool readonly
Don't allow changes to the mailbox.
void * wdata
Private data.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.