NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Attach Function API

Prototype for a Attach Function. More...

+ Collaboration diagram for Attach Function API:

Functions

static int op_attach_collapse (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 toggle display of subparts - Implements attach_function_t -
 
static int op_attach_delete (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 delete the current entry - Implements attach_function_t -
 
static int op_attach_edit_type (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 edit attachment content type - Implements attach_function_t -
 
static int op_attach_pipe (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 pipe message/attachment to a shell command - Implements attach_function_t -
 
static int op_attach_print (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 print the current entry - Implements attach_function_t -
 
static int op_attach_save (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 save message/attachment to a mailbox/file - Implements attach_function_t -
 
static int op_attach_undelete (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 undelete the current entry - Implements attach_function_t -
 
static int op_attach_view (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 view attachment using mailcap entry if necessary - Implements attach_function_t -
 
static int op_attach_view_mailcap (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 force viewing of attachment using mailcap - Implements attach_function_t -
 
static int op_attach_view_pager (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 view attachment in pager using copiousoutput mailcap - Implements attach_function_t -
 
static int op_attach_view_text (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 view attachment as text - Implements attach_function_t -
 
static int op_bounce_message (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 remail a message to another user - Implements attach_function_t -
 
static int op_check_traditional (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 check for classic PGP - Implements attach_function_t -
 
static int op_compose_to_sender (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 compose new message to the current message sender - Implements attach_function_t -
 
static int op_exit (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 exit this menu - Implements attach_function_t -
 
static int op_extract_keys (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 extract supported public keys - Implements attach_function_t -
 
static int op_forget_passphrase (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 wipe passphrases from memory - Implements attach_function_t -
 
static int op_forward_message (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 forward a message with comments - Implements attach_function_t -
 
static int op_list_subscribe (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 subscribe to a mailing list - Implements attach_function_t -
 
static int op_list_unsubscribe (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 unsubscribe from a mailing list - Implements attach_function_t -
 
static int op_reply (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 reply to a message - Implements attach_function_t -
 
static int op_resend (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 use the current message as a template for a new one - Implements attach_function_t -
 
static int op_followup (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 followup to newsgroup - Implements attach_function_t -
 
static int op_forward_to_group (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 forward to newsgroup - Implements attach_function_t -
 

Detailed Description

Prototype for a Attach Function.

Parameters
fdataAttach Function context data
eventEvent to process
Return values
enumFunctionRetval
Precondition
fdata is not NULL
event is not NULL

Function Documentation

◆ op_attach_collapse()

static int op_attach_collapse ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

toggle display of subparts - Implements attach_function_t -

Definition at line 249 of file functions.c.

250{
251 struct AttachPrivateData *priv = fdata->priv;
252 struct AttachPtr *cur_att = current_attachment(priv->actx, priv->menu);
253 if (!cur_att->body->parts)
254 {
255 mutt_error(_("There are no subparts to show"));
256 return FR_ERROR;
257 }
258 attach_collapse(priv->actx, priv->menu, fdata->n->sub);
259 mutt_update_recvattach_menu(priv->actx, priv->menu, false);
260 return FR_SUCCESS;
261}
static void attach_collapse(struct AttachCtx *actx, struct Menu *menu, struct ConfigSubset *sub)
Close the tree of the current attachment.
Definition functions.c:149
@ FR_SUCCESS
Valid function - successfully performed.
Definition dispatcher.h:40
@ FR_ERROR
Valid function - error occurred.
Definition dispatcher.h:39
#define mutt_error(...)
Definition logging2.h:94
#define _(a)
Definition message.h:28
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.
Definition recvattach.c:71
struct AttachPrivateData * priv
Attach private data.
Definition functions.h:35
struct NeoMutt * n
NeoMutt application data.
Definition functions.h:34
Private state data for Attachments.
struct Menu * menu
Current Menu.
struct AttachCtx * actx
List of all Attachments.
An email to which things will be attached.
Definition attach.h:36
struct Body * body
Attachment.
Definition attach.h:37
struct Body * parts
parts of a multipart or message/rfc822
Definition body.h:73
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
+ Here is the call graph for this function:

◆ op_attach_delete()

static int op_attach_delete ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

delete the current entry - Implements attach_function_t -

Supports repeat-count: 5<delete-entry> deletes the current entry and the next 4 (only multipart attachments can be deleted; non-multipart entries in the working set are silently skipped). Overruns are silently capped at the end of the list.

Definition at line 313 of file functions.c.

314{
315 struct AttachPrivateData *priv = fdata->priv;
316 if (check_readonly(priv->mailbox))
317 return FR_ERROR;
318
319 if (priv->mailbox->type == MUTT_POP)
320 {
322 mutt_error(_("Can't delete attachment from POP server"));
323 return FR_ERROR;
324 }
325
326 if (priv->mailbox->type == MUTT_NNTP)
327 {
329 mutt_error(_("Can't delete attachment from news server"));
330 return FR_ERROR;
331 }
332
333 if ((WithCrypto != 0) && (priv->actx->email->security & SEC_ENCRYPT))
334 {
335 mutt_message(_("Deletion of attachments from encrypted messages is unsupported"));
336 return FR_ERROR;
337 }
338 if ((WithCrypto != 0) && (priv->actx->email->security & (SEC_SIGN | SEC_PARTSIGN)))
339 {
340 mutt_message(_("Deletion of attachments from signed messages may invalidate the signature"));
341 }
342
343 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
344 if (aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix,
345 event->count) < 0)
346 {
347 ARRAY_FREE(&aa);
348 return FR_ERROR;
349 }
350
351 if (ARRAY_EMPTY(&aa))
352 {
353 ARRAY_FREE(&aa);
354 return FR_NO_ACTION;
355 }
356
357 int changed = 0;
358 int blocked = 0;
359 attach_apply_set_deleted(&aa, true, &changed, &blocked);
360 const int num = ARRAY_SIZE(&aa);
361 ARRAY_FREE(&aa);
362
363 if (blocked > 0)
364 mutt_message(_("Only deletion of multipart attachments is supported"));
365
366 if (changed == 0)
367 return blocked ? FR_ERROR : FR_NO_ACTION;
368
369 if (priv->menu->tag_prefix)
370 {
372 }
373 else
374 {
375 const bool c_resolve = cs_subset_bool(fdata->n->sub, "resolve");
376 const int next = menu_get_index(priv->menu) + num;
377 if (c_resolve && (next < priv->menu->max))
378 {
379 menu_set_index(priv->menu, next);
380 }
381 else
382 {
384 }
385 }
386
387 return FR_SUCCESS;
388}
#define ARRAY_EMPTY(head)
Check if an array is empty.
Definition array.h:74
#define ARRAY_SIZE(head)
The number of elements stored.
Definition array.h:87
#define ARRAY_FREE(head)
Release all memory.
Definition array.h:209
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
Definition array.h:58
static void attach_apply_set_deleted(struct AttachPtrArray *apa, bool deleted, int *num_changed, int *num_blocked)
Apply the deleted flag to a working set of attachments.
Definition functions.c:273
static bool check_readonly(struct Mailbox *m)
Check if the Mailbox is readonly.
Definition functions.c:201
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
@ MUTT_POP
'POP3' Mailbox type
Definition mailbox.h:51
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
Definition mailbox.h:48
@ FR_NO_ACTION
Valid function - no action performed.
Definition dispatcher.h:38
void mutt_flushinp(void)
MacroEvents moved to KeyModuleData UngetKeyEvents moved to KeyModuleData.
Definition get.c:81
#define mutt_message(...)
Definition logging2.h:93
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition menu.c:179
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:155
@ MENU_REDRAW_INDEX
Redraw the index.
Definition lib.h:61
@ MENU_REDRAW_CURRENT
Redraw the current line of the menu.
Definition lib.h:63
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition menu.c:169
@ SEC_PARTSIGN
Not all parts of the email is signed.
Definition lib.h:96
@ SEC_SIGN
Email is signed.
Definition lib.h:93
@ SEC_ENCRYPT
Email is encrypted.
Definition lib.h:92
#define WithCrypto
Definition lib.h:132
int aa_add_selection(struct AttachPtrArray *aa, struct AttachCtx *actx, struct Menu *menu, bool use_tagged, int count)
Build a working set of Attachments for an action.
Definition selection.c:125
struct Email * email
Used by recvattach for updating.
Definition attach.h:66
struct Mailbox * mailbox
Current Mailbox.
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Definition email.h:43
int count
Optional count prefix, e.g. 3 for 3j
Definition get.h:78
enum MailboxType type
Mailbox type.
Definition mailbox.h:104
bool tag_prefix
User has pressed <tag-prefix>
Definition lib.h:92
+ Here is the call graph for this function:

◆ op_attach_edit_type()

static int op_attach_edit_type ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

edit attachment content type - Implements attach_function_t -

Definition at line 393 of file functions.c.

394{
395 struct AttachPrivateData *priv = fdata->priv;
396 recvattach_edit_content_type(priv->actx, priv->menu, priv->actx->email);
398 return FR_SUCCESS;
399}
void recvattach_edit_content_type(struct AttachCtx *actx, struct Menu *menu, struct Email *e)
Edit the content type of an attachment.
Definition recvattach.c:887
+ Here is the call graph for this function:

◆ op_attach_pipe()

static int op_attach_pipe ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

pipe message/attachment to a shell command - Implements attach_function_t -

Definition at line 404 of file functions.c.

405{
406 struct AttachPrivateData *priv = fdata->priv;
407 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
408 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
409 mutt_pipe_attachment_list(&aa, false);
410 ARRAY_FREE(&aa);
411 return FR_SUCCESS;
412}
void mutt_pipe_attachment_list(struct AttachPtrArray *aa, bool filter)
Pipe selected attachments to a command.
Definition recvattach.c:697
+ Here is the call graph for this function:

◆ op_attach_print()

static int op_attach_print ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

print the current entry - Implements attach_function_t -

Definition at line 417 of file functions.c.

418{
419 struct AttachPrivateData *priv = fdata->priv;
420 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
421 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
423 ARRAY_FREE(&aa);
424 return FR_SUCCESS;
425}
void mutt_print_attachment_list(struct AttachPtrArray *aa)
Print selected attachments.
Definition recvattach.c:846
+ Here is the call graph for this function:

◆ op_attach_save()

static int op_attach_save ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

save message/attachment to a mailbox/file - Implements attach_function_t -

Definition at line 430 of file functions.c.

431{
432 struct AttachPrivateData *priv = fdata->priv;
433 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
434 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
435 mutt_save_attachment_list(&aa, priv->actx->email, priv->menu);
436
437 const bool c_resolve = cs_subset_bool(fdata->n->sub, "resolve");
438 const int index = menu_get_index(priv->menu) + 1;
439 if ((ARRAY_SIZE(&aa) == 1) && c_resolve && (index < priv->menu->max))
440 menu_set_index(priv->menu, index);
441 ARRAY_FREE(&aa);
442 return FR_SUCCESS;
443}
void mutt_save_attachment_list(struct AttachPtrArray *aa, struct Email *e, struct Menu *menu)
Save a list of selected attachments.
Definition recvattach.c:423
+ Here is the call graph for this function:

◆ op_attach_undelete()

static int op_attach_undelete ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

undelete the current entry - Implements attach_function_t -

Supports repeat-count: 5<undelete-entry> undeletes the current entry and the next 4. Overruns are silently capped at the end of the list.

Definition at line 451 of file functions.c.

452{
453 struct AttachPrivateData *priv = fdata->priv;
454 if (check_readonly(priv->mailbox))
455 return FR_ERROR;
456
457 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
458 if (aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix,
459 event->count) < 0)
460 {
461 ARRAY_FREE(&aa);
462 return FR_ERROR;
463 }
464
465 if (ARRAY_EMPTY(&aa))
466 {
467 ARRAY_FREE(&aa);
468 return FR_NO_ACTION;
469 }
470
471 attach_apply_set_deleted(&aa, false, NULL, NULL);
472 const int num = ARRAY_SIZE(&aa);
473 ARRAY_FREE(&aa);
474
475 if (priv->menu->tag_prefix)
476 {
478 }
479 else
480 {
481 const bool c_resolve = cs_subset_bool(fdata->n->sub, "resolve");
482 const int next = menu_get_index(priv->menu) + num;
483 if (c_resolve && (next < priv->menu->max))
484 {
485 menu_set_index(priv->menu, next);
486 }
487 else
488 {
490 }
491 }
492
493 return FR_SUCCESS;
494}
+ Here is the call graph for this function:

◆ op_attach_view()

static int op_attach_view ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

view attachment using mailcap entry if necessary - Implements attach_function_t -

This function handles:

  • OP_ATTACH_VIEW
  • OP_DISPLAY_HEADERS

Definition at line 503 of file functions.c.

504{
505 struct AttachPrivateData *priv = fdata->priv;
506 priv->op = mutt_attach_display_loop(priv->sub, priv->menu, event->op,
507 priv->actx->email, priv->actx, true);
509
510 return FR_CONTINUE;
511}
@ FR_CONTINUE
Remain in the Dialog.
Definition dispatcher.h:35
@ MENU_REDRAW_FULL
Redraw everything.
Definition lib.h:64
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.
Definition recvattach.c:917
int op
Op returned from the Pager, e.g. OP_NEXT_ENTRY.
struct ConfigSubset * sub
Config subset.
int op
Function opcode, e.g. OP_HELP.
Definition get.h:77
+ Here is the call graph for this function:

◆ op_attach_view_mailcap()

static int op_attach_view_mailcap ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

force viewing of attachment using mailcap - Implements attach_function_t -

Definition at line 516 of file functions.c.

517{
518 struct AttachPrivateData *priv = fdata->priv;
519 struct AttachPtr *cur_att = current_attachment(priv->actx, priv->menu);
520 mutt_view_attachment(cur_att->fp, cur_att->body, MUTT_VA_MAILCAP,
521 priv->actx->email, priv->actx, priv->menu->win);
523 return FR_SUCCESS;
524}
int mutt_view_attachment(FILE *fp, struct Body *b, enum ViewAttachMode mode, struct Email *e, struct AttachCtx *actx, struct MuttWindow *win)
View an attachment.
@ MUTT_VA_MAILCAP
Force viewing using mailcap entry.
Definition mutt_attach.h:46
FILE * fp
Used in the recvattach menu.
Definition attach.h:38
struct MuttWindow * win
Window holding the Menu.
Definition lib.h:94
+ Here is the call graph for this function:

◆ op_attach_view_pager()

static int op_attach_view_pager ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

view attachment in pager using copiousoutput mailcap - Implements attach_function_t -

Definition at line 529 of file functions.c.

530{
531 struct AttachPrivateData *priv = fdata->priv;
532 struct AttachPtr *cur_att = current_attachment(priv->actx, priv->menu);
533 mutt_view_attachment(cur_att->fp, cur_att->body, MUTT_VA_PAGER,
534 priv->actx->email, priv->actx, priv->menu->win);
536 return FR_SUCCESS;
537}
@ MUTT_VA_PAGER
View attachment in pager using copiousoutput mailcap.
Definition mutt_attach.h:48
+ Here is the call graph for this function:

◆ op_attach_view_text()

static int op_attach_view_text ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

view attachment as text - Implements attach_function_t -

Definition at line 542 of file functions.c.

543{
544 struct AttachPrivateData *priv = fdata->priv;
545 struct AttachPtr *cur_att = current_attachment(priv->actx, priv->menu);
546 mutt_view_attachment(cur_att->fp, cur_att->body, MUTT_VA_AS_TEXT,
547 priv->actx->email, priv->actx, priv->menu->win);
549 return FR_SUCCESS;
550}
@ MUTT_VA_AS_TEXT
Force viewing as text.
Definition mutt_attach.h:47
+ Here is the call graph for this function:

◆ op_bounce_message()

static int op_bounce_message ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

remail a message to another user - Implements attach_function_t -

Definition at line 555 of file functions.c.

556{
557 struct AttachPrivateData *priv = fdata->priv;
558 if (check_attach(priv))
559 return FR_ERROR;
560 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
561 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
562 attach_bounce_message(&aa, priv->mailbox);
563 ARRAY_FREE(&aa);
565 return FR_SUCCESS;
566}
static bool check_attach(struct AttachPrivateData *priv)
Check if in attach-message mode.
Definition functions.c:184
void attach_bounce_message(struct AttachPtrArray *aa, struct Mailbox *m)
Bounce function, from the attachment menu.
Definition recvcmd.c:158
+ Here is the call graph for this function:

◆ op_check_traditional()

static int op_check_traditional ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

check for classic PGP - Implements attach_function_t -

Definition at line 571 of file functions.c.

572{
573 struct AttachPrivateData *priv = fdata->priv;
574 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
575 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
577 {
578 priv->actx->email->security = crypt_query(NULL);
580 }
581 ARRAY_FREE(&aa);
582 return FR_SUCCESS;
583}
static int recvattach_pgp_check_traditional(struct AttachPtrArray *aa)
Is the Attachment inline PGP?
Definition functions.c:231
SecurityFlags crypt_query(struct Body *b)
Check out the type of encryption used.
Definition crypt.c:692
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition lib.h:106
+ Here is the call graph for this function:

◆ op_compose_to_sender()

static int op_compose_to_sender ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

compose new message to the current message sender - Implements attach_function_t -

Definition at line 588 of file functions.c.

589{
590 struct AttachPrivateData *priv = fdata->priv;
591 if (check_attach(priv))
592 return FR_ERROR;
593 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
594 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
596 ARRAY_FREE(&aa);
598 return FR_SUCCESS;
599}
void mutt_attach_mail_sender(struct AttachPtrArray *aa)
Compose an email to the sender in the email attachment.
Definition recvcmd.c:1074
+ Here is the call graph for this function:

◆ op_exit()

static int op_exit ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

exit this menu - Implements attach_function_t -

Definition at line 604 of file functions.c.

605{
606 struct AttachPrivateData *priv = fdata->priv;
607 priv->actx->email->attach_del = false;
608 for (int i = 0; i < priv->actx->idxlen; i++)
609 {
610 if (priv->actx->idx[i]->body && priv->actx->idx[i]->body->deleted)
611 {
612 priv->actx->email->attach_del = true;
613 break;
614 }
615 }
616 if (priv->actx->email->attach_del)
617 priv->actx->email->changed = true;
618
619 mutt_actx_free(&priv->actx);
620 return FR_DONE;
621}
void mutt_actx_free(struct AttachCtx **ptr)
Free an Attachment Context.
Definition attach.c:198
@ FR_DONE
Exit the Dialog.
Definition dispatcher.h:36
struct AttachPtr ** idx
Array of attachments.
Definition attach.h:69
short idxlen
Number of attachmentes.
Definition attach.h:70
bool deleted
Attachment marked for deletion.
Definition body.h:88
bool changed
Email has been edited.
Definition email.h:77
bool attach_del
Has an attachment marked for deletion.
Definition email.h:99
+ Here is the call graph for this function:

◆ op_extract_keys()

static int op_extract_keys ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

extract supported public keys - Implements attach_function_t -

Definition at line 626 of file functions.c.

627{
628 struct AttachPrivateData *priv = fdata->priv;
630 return FR_NO_ACTION;
631
632 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
633 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
635 ARRAY_FREE(&aa);
637
638 return FR_SUCCESS;
639}
static void recvattach_extract_pgp_keys(struct AttachPtrArray *aa)
Extract PGP keys from attachments.
Definition functions.c:217
+ Here is the call graph for this function:

◆ op_forget_passphrase()

static int op_forget_passphrase ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

wipe passphrases from memory - Implements attach_function_t -

Definition at line 644 of file functions.c.

645{
647 return FR_SUCCESS;
648}
void crypt_forget_passphrase(void)
Forget a passphrase and display a message.
Definition crypt.c:89
+ Here is the call graph for this function:

◆ op_forward_message()

static int op_forward_message ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

forward a message with comments - Implements attach_function_t -

Definition at line 653 of file functions.c.

654{
655 struct AttachPrivateData *priv = fdata->priv;
656 if (check_attach(priv))
657 return FR_ERROR;
658 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
659 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
660 mutt_attach_forward(&aa, priv->actx->email, priv->actx, SEND_NONE);
661 ARRAY_FREE(&aa);
663 return FR_SUCCESS;
664}
void mutt_attach_forward(struct AttachPtrArray *aa, struct Email *e, struct AttachCtx *actx, SendFlags flags)
Forward selected attachments.
Definition recvcmd.c:737
@ SEND_NONE
No flags are set.
Definition send.h:45
+ Here is the call graph for this function:

◆ op_list_subscribe()

static int op_list_subscribe ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

subscribe to a mailing list - Implements attach_function_t -

Definition at line 669 of file functions.c.

670{
671 struct AttachPrivateData *priv = fdata->priv;
672 if (check_attach(priv))
673 return FR_ERROR;
674
676}
bool mutt_send_list_subscribe(struct Mailbox *m, struct Email *e)
Send a mailing-list subscription email.
Definition send.c:2956
+ Here is the call graph for this function:

◆ op_list_unsubscribe()

static int op_list_unsubscribe ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

unsubscribe from a mailing list - Implements attach_function_t -

Definition at line 681 of file functions.c.

682{
683 struct AttachPrivateData *priv = fdata->priv;
684 if (check_attach(priv))
685 return FR_ERROR;
686
688}
bool mutt_send_list_unsubscribe(struct Mailbox *m, struct Email *e)
Send a mailing-list unsubscription email.
Definition send.c:2985
+ Here is the call graph for this function:

◆ op_reply()

static int op_reply ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

reply to a message - Implements attach_function_t -

This function handles:

  • OP_GROUP_CHAT_REPLY
  • OP_GROUP_REPLY
  • OP_LIST_REPLY
  • OP_REPLY

Definition at line 699 of file functions.c.

700{
701 struct AttachPrivateData *priv = fdata->priv;
702 if (check_attach(priv))
703 return FR_ERROR;
704
705 const int op = event->op;
706 SendFlags flags = SEND_REPLY;
707 if (op == OP_GROUP_REPLY)
708 flags |= SEND_GROUP_REPLY;
709 else if (op == OP_GROUP_CHAT_REPLY)
710 flags |= SEND_GROUP_CHAT_REPLY;
711 else if (op == OP_LIST_REPLY)
712 flags |= SEND_LIST_REPLY;
713
714 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
715 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
716 mutt_attach_reply(&aa, priv->mailbox, priv->actx->email, priv->actx, flags);
717 ARRAY_FREE(&aa);
719 return FR_SUCCESS;
720}
void mutt_attach_reply(struct AttachPtrArray *aa, struct Mailbox *m, struct Email *e, struct AttachCtx *actx, SendFlags flags)
Attach a reply.
Definition recvcmd.c:885
uint32_t SendFlags
Definition send.h:64
@ SEND_GROUP_CHAT_REPLY
Reply to all recipients preserving To/Cc.
Definition send.h:58
@ SEND_REPLY
Reply to sender.
Definition send.h:46
@ SEND_GROUP_REPLY
Reply to all.
Definition send.h:47
@ SEND_LIST_REPLY
Reply to mailing list.
Definition send.h:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ op_resend()

static int op_resend ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

use the current message as a template for a new one - Implements attach_function_t -

Definition at line 725 of file functions.c.

726{
727 struct AttachPrivateData *priv = fdata->priv;
728 if (check_attach(priv))
729 return FR_ERROR;
730 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
731 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
732 mutt_attach_resend(&aa, priv->mailbox);
733 ARRAY_FREE(&aa);
735 return FR_SUCCESS;
736}
void mutt_attach_resend(struct AttachPtrArray *aa, struct Mailbox *m)
Resend-message, from the attachment menu.
Definition recvcmd.c:255
+ Here is the call graph for this function:

◆ op_followup()

static int op_followup ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

followup to newsgroup - Implements attach_function_t -

Definition at line 743 of file functions.c.

744{
745 struct AttachPrivateData *priv = fdata->priv;
746 if (check_attach(priv))
747 return FR_ERROR;
748
749 struct AttachPtr *cur_att = current_attachment(priv->actx, priv->menu);
750 if (!cur_att->body->email || !cur_att->body->email->env)
751 {
752 mutt_error(_("You may only followup to message/rfc822 parts"));
753 return FR_ERROR;
754 }
755 if (!cur_att->body->email->env->followup_to ||
756 !mutt_istr_equal(cur_att->body->email->env->followup_to, "poster") ||
757 (query_quadoption(_("Reply by mail as poster prefers?"), fdata->n->sub,
758 "followup_to_poster") != MUTT_YES))
759 {
760 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
761 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
762 mutt_attach_reply(&aa, priv->mailbox, priv->actx->email, priv->actx, SEND_NEWS | SEND_REPLY);
763 ARRAY_FREE(&aa);
765 return FR_SUCCESS;
766 }
767
768 return op_reply(fdata, event);
769}
static int op_reply(struct AttachFunctionData *fdata, const struct KeyEvent *event)
reply to a message - Implements attach_function_t -
Definition functions.c:699
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition string.c:677
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition quad.h:39
enum QuadOption query_quadoption(const char *prompt, struct ConfigSubset *sub, const char *name)
Ask the user a quad-question.
Definition question.c:384
@ SEND_NEWS
Reply to a news article.
Definition send.h:59
struct Email * email
header information for message/rfc822
Definition body.h:74
struct Envelope * env
Envelope information.
Definition email.h:68
char * followup_to
List of 'followup-to' fields.
Definition envelope.h:80
+ Here is the call graph for this function:

◆ op_forward_to_group()

static int op_forward_to_group ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

forward to newsgroup - Implements attach_function_t -

Definition at line 774 of file functions.c.

775{
776 struct AttachPrivateData *priv = fdata->priv;
777 if (check_attach(priv))
778 return FR_ERROR;
779 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
780 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
781 mutt_attach_forward(&aa, priv->actx->email, priv->actx, SEND_NEWS);
782 ARRAY_FREE(&aa);
784 return FR_SUCCESS;
785}
+ Here is the call graph for this function: