NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
DOXYGEN
postpone.c
Go to the documentation of this file.
1 
30 #include "config.h"
31 #include <stdbool.h>
32 #include <stdio.h>
33 #include <string.h>
34 #include <sys/stat.h>
35 #include <time.h>
36 #include <unistd.h>
37 #include "mutt/lib.h"
38 #include "config/lib.h"
39 #include "email/lib.h"
40 #include "core/lib.h"
41 #include "gui/lib.h"
42 #include "mutt.h"
43 #include "ncrypt/lib.h"
44 #include "pattern/lib.h"
45 #include "send/lib.h"
46 #include "context.h"
47 #include "format_flags.h"
48 #include "handler.h"
49 #include "hdrline.h"
50 #include "keymap.h"
51 #include "mutt_globals.h"
52 #include "mutt_logging.h"
53 #include "mutt_menu.h"
54 #include "mutt_thread.h"
55 #include "muttlib.h"
56 #include "mx.h"
57 #include "opcodes.h"
58 #include "options.h"
59 #include "protos.h"
60 #include "rfc3676.h"
61 #include "sort.h"
62 #include "state.h"
63 #ifdef USE_IMAP
64 #include "imap/lib.h"
65 #endif
66 
68 static const struct Mapping PostponeHelp[] = {
69  // clang-format off
70  { N_("Exit"), OP_EXIT },
71  { N_("Del"), OP_DELETE },
72  { N_("Undel"), OP_UNDELETE },
73  { N_("Help"), OP_HELP },
74  { NULL, 0 },
75  // clang-format on
76 };
77 
78 static short PostCount = 0;
79 static bool UpdateNumPostponed = false;
80 
89 int mutt_num_postponed(struct Mailbox *m, bool force)
90 {
91  struct stat st;
92 
93  static time_t LastModify = 0;
94  static char *OldPostponed = NULL;
95 
97  {
98  UpdateNumPostponed = false;
99  force = true;
100  }
101 
102  if (!mutt_str_equal(C_Postponed, OldPostponed))
103  {
104  FREE(&OldPostponed);
105  OldPostponed = mutt_str_dup(C_Postponed);
106  LastModify = 0;
107  force = true;
108  }
109 
110  if (!C_Postponed)
111  return 0;
112 
113  // We currently are in the `$postponed` mailbox so just pick the current status
114  if (m && mutt_str_equal(C_Postponed, m->realpath))
115  {
116  PostCount = m->msg_count - m->msg_deleted;
117  return PostCount;
118  }
119 
120 #ifdef USE_IMAP
121  /* LastModify is useless for IMAP */
122  if (imap_path_probe(C_Postponed, NULL) == MUTT_IMAP)
123  {
124  if (force)
125  {
126  short newpc;
127 
128  newpc = imap_path_status(C_Postponed, false);
129  if (newpc >= 0)
130  {
131  PostCount = newpc;
132  mutt_debug(LL_DEBUG3, "%d postponed IMAP messages found\n", PostCount);
133  }
134  else
135  mutt_debug(LL_DEBUG3, "using old IMAP postponed count\n");
136  }
137  return PostCount;
138  }
139 #endif
140 
141  if (stat(C_Postponed, &st) == -1)
142  {
143  PostCount = 0;
144  LastModify = 0;
145  return 0;
146  }
147 
148  if (S_ISDIR(st.st_mode))
149  {
150  /* if we have a maildir mailbox, we need to stat the "new" dir */
151  struct Buffer *buf = mutt_buffer_pool_get();
152 
153  mutt_buffer_printf(buf, "%s/new", C_Postponed);
154  if ((access(mutt_buffer_string(buf), F_OK) == 0) &&
155  (stat(mutt_buffer_string(buf), &st) == -1))
156  {
157  PostCount = 0;
158  LastModify = 0;
160  return 0;
161  }
163  }
164 
165  if (LastModify < st.st_mtime)
166  {
167 #ifdef USE_NNTP
168  int optnews = OptNews;
169 #endif
170  LastModify = st.st_mtime;
171 
172  if (access(C_Postponed, R_OK | F_OK) != 0)
173  return PostCount = 0;
174 #ifdef USE_NNTP
175  if (optnews)
176  OptNews = false;
177 #endif
178  struct Mailbox *m_post = mx_path_resolve(C_Postponed);
179  struct Context *ctx = mx_mbox_open(m_post, MUTT_NOSORT | MUTT_QUIET);
180  if (ctx)
181  {
182  PostCount = ctx->mailbox->msg_count;
183  }
184  else
185  {
186  mailbox_free(&m_post);
187  PostCount = 0;
188  }
189  mx_fastclose_mailbox(m_post);
190  ctx_free(&ctx);
191 #ifdef USE_NNTP
192  if (optnews)
193  OptNews = true;
194 #endif
195  }
196 
197  return PostCount;
198 }
199 
204 {
205  UpdateNumPostponed = true;
206 }
207 
211 static void post_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
212 {
213  struct Context *ctx = menu->mdata;
214 
215  mutt_make_string(buf, buflen, menu->win_index->state.cols,
217  ctx->mailbox->emails[line], MUTT_FORMAT_ARROWCURSOR, NULL);
218 }
219 
225 static struct Email *dlg_select_postponed_email(struct Context *ctx)
226 {
227  int r = -1;
228  bool done = false;
229 
230  struct Menu *menu = mutt_menu_new(MENU_POSTPONE);
232  dlg->help_data = PostponeHelp;
233  dlg->help_menu = MENU_POSTPONE;
234 
235  menu->make_entry = post_make_entry;
236  menu->max = ctx->mailbox->msg_count;
237  menu->title = _("Postponed Messages");
238  menu->mdata = ctx;
239  menu->custom_search = true;
241 
242  /* The postponed mailbox is setup to have sorting disabled, but the global
243  * `$sort` variable may indicate something different. Sorting has to be
244  * disabled while the postpone menu is being displayed. */
245  const short orig_sort = C_Sort;
246  C_Sort = SORT_ORDER;
247 
248  while (!done)
249  {
250  const int op = mutt_menu_loop(menu);
251  switch (op)
252  {
253  case OP_DELETE:
254  case OP_UNDELETE:
255  /* should deleted draft messages be saved in the trash folder? */
256  mutt_set_flag(ctx->mailbox, ctx->mailbox->emails[menu->current],
257  MUTT_DELETE, (op == OP_DELETE));
259  if (C_Resolve && (menu->current < menu->max - 1))
260  {
261  menu->oldcurrent = menu->current;
262  menu->current++;
263  if (menu->current >= menu->top + menu->pagelen)
264  {
265  menu->top = menu->current;
266  menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
267  }
268  else
269  menu->redraw |= REDRAW_MOTION_RESYNC;
270  }
271  else
272  menu->redraw |= REDRAW_CURRENT;
273  break;
274 
275  // All search operations must exist to show the menu
276  case OP_SEARCH_REVERSE:
277  case OP_SEARCH_NEXT:
278  case OP_SEARCH_OPPOSITE:
279  case OP_SEARCH:
280  menu->current = mutt_search_command(ctx, ctx->mailbox, menu->current, op);
281  if (menu->current == -1)
282  menu->current = menu->oldcurrent;
283  else
284  menu->redraw = REDRAW_MOTION;
285  break;
286 
287  case OP_GENERIC_SELECT_ENTRY:
288  r = menu->current;
289  done = true;
290  break;
291 
292  case OP_EXIT:
293  done = true;
294  break;
295  }
296  }
297 
298  C_Sort = orig_sort;
299  mutt_menu_pop_current(menu);
300  mutt_menu_free(&menu);
302 
303  return (r > -1) ? ctx->mailbox->emails[r] : NULL;
304 }
305 
310 static void hardclose(struct Context **pctx)
311 {
312  /* messages might have been marked for deletion.
313  * try once more on reopen before giving up. */
314  enum MxStatus rc = mx_mbox_close(pctx);
315  if (rc != MX_STATUS_ERROR && rc != MX_STATUS_OK)
316  rc = mx_mbox_close(pctx);
317  if (rc != MX_STATUS_OK)
318  mx_fastclose_mailbox((*pctx)->mailbox);
319 }
320 
331 int mutt_get_postponed(struct Context *ctx, struct Email *hdr,
332  struct Email **cur, struct Buffer *fcc)
333 {
334  if (!C_Postponed)
335  return -1;
336 
337  struct Email *e = NULL;
338  int rc = SEND_POSTPONED;
339  const char *p = NULL;
340  struct Context *ctx_post = NULL;
341 
342  struct Mailbox *m = mx_path_resolve(C_Postponed);
343  if (ctx && (ctx->mailbox == m))
344  ctx_post = ctx;
345  else
346  ctx_post = mx_mbox_open(m, MUTT_NOSORT);
347 
348  if (!ctx_post)
349  {
350  PostCount = 0;
351  mutt_error(_("No postponed messages"));
352  mailbox_free(&m);
353  return -1;
354  }
355 
356  /* TODO:
357  * mx_mbox_open() for IMAP leaves IMAP_REOPEN_ALLOW set. For the
358  * index this is papered-over because it calls mx_check_mailbox()
359  * every event loop(which resets that flag).
360  *
361  * For a stable-branch fix, I'm doing the same here, to prevent
362  * context changes from occuring behind the scenes and causing
363  * segvs, but probably the flag needs to be reset after downloading
364  * headers in imap_open_mailbox().
365  */
366  mx_mbox_check(ctx_post->mailbox);
367 
368  if (ctx_post->mailbox->msg_count == 0)
369  {
370  PostCount = 0;
371  if (ctx_post == ctx)
372  ctx_post = NULL;
373  else
374  mx_fastclose_mailbox(ctx_post->mailbox);
375  mutt_error(_("No postponed messages"));
376  return -1;
377  }
378 
379  if (ctx_post->mailbox->msg_count == 1)
380  {
381  /* only one message, so just use that one. */
382  e = ctx_post->mailbox->emails[0];
383  }
384  else if (!(e = dlg_select_postponed_email(ctx_post)))
385  {
386  if (ctx_post == ctx)
387  {
388  ctx_post = NULL;
389  }
390  else
391  {
392  hardclose(&ctx_post);
393  }
394  return -1;
395  }
396 
397  if (mutt_prepare_template(NULL, ctx_post->mailbox, hdr, e, false) < 0)
398  {
399  if (ctx_post != ctx)
400  {
401  mx_fastclose_mailbox(ctx_post->mailbox);
402  FREE(&ctx_post);
403  }
404  return -1;
405  }
406 
407  /* finished with this message, so delete it. */
408  mutt_set_flag(ctx_post->mailbox, e, MUTT_DELETE, true);
409  mutt_set_flag(ctx_post->mailbox, e, MUTT_PURGE, true);
410 
411  /* update the count for the status display */
412  PostCount = ctx_post->mailbox->msg_count - ctx_post->mailbox->msg_deleted;
413 
414  /* avoid the "purge deleted messages" prompt */
415  int opt_delete = C_Delete;
416  C_Delete = MUTT_YES;
417  if (ctx_post == ctx)
418  {
419  ctx_post = NULL;
420  }
421  else
422  {
423  hardclose(&ctx_post);
424  }
425  C_Delete = opt_delete;
426 
427  struct ListNode *np = NULL, *tmp = NULL;
428  STAILQ_FOREACH_SAFE(np, &hdr->env->userhdrs, entries, tmp)
429  {
430  size_t plen = mutt_istr_startswith(np->data, "X-Mutt-References:");
431  if (plen)
432  {
433  /* if a mailbox is currently open, look to see if the original message
434  * the user attempted to reply to is in this mailbox */
435  p = mutt_str_skip_email_wsp(np->data + plen);
436  if (!ctx->mailbox->id_hash)
438  *cur = mutt_hash_find(ctx->mailbox->id_hash, p);
439 
440  if (*cur)
441  rc |= SEND_REPLY;
442  }
443  else if ((plen = mutt_istr_startswith(np->data, "X-Mutt-Fcc:")))
444  {
445  p = mutt_str_skip_email_wsp(np->data + plen);
446  mutt_buffer_strcpy(fcc, p);
448 
449  /* note that x-mutt-fcc was present. we do this because we want to add a
450  * default fcc if the header was missing, but preserve the request of the
451  * user to not make a copy if the header field is present, but empty.
452  * see http://dev.mutt.org/trac/ticket/3653 */
453  rc |= SEND_POSTPONED_FCC;
454  }
455  else if (((WithCrypto & APPLICATION_PGP) != 0) &&
456  /* this is generated by old neomutt versions */
457  (mutt_str_startswith(np->data, "Pgp:") ||
458  /* this is the new way */
459  mutt_str_startswith(np->data, "X-Mutt-PGP:")))
460  {
461  hdr->security = mutt_parse_crypt_hdr(strchr(np->data, ':') + 1, true, APPLICATION_PGP);
462  hdr->security |= APPLICATION_PGP;
463  }
464  else if (((WithCrypto & APPLICATION_SMIME) != 0) &&
465  mutt_str_startswith(np->data, "X-Mutt-SMIME:"))
466  {
467  hdr->security = mutt_parse_crypt_hdr(strchr(np->data, ':') + 1, true, APPLICATION_SMIME);
468  hdr->security |= APPLICATION_SMIME;
469  }
470 #ifdef MIXMASTER
471  else if (mutt_str_startswith(np->data, "X-Mutt-Mix:"))
472  {
473  mutt_list_free(&hdr->chain);
474 
475  char *t = strtok(np->data + 11, " \t\n");
476  while (t)
477  {
479  t = strtok(NULL, " \t\n");
480  }
481  }
482 #endif
483  else
484  {
485  // skip header removal
486  continue;
487  }
488 
489  // remove the header
490  STAILQ_REMOVE(&hdr->env->userhdrs, np, ListNode, entries);
491  FREE(&np->data);
492  FREE(&np);
493  }
494 
497 
498  return rc;
499 }
500 
508 SecurityFlags mutt_parse_crypt_hdr(const char *p, bool set_empty_signas, SecurityFlags crypt_app)
509 {
510  char smime_cryptalg[1024] = { 0 };
511  char sign_as[1024] = { 0 };
512  char *q = NULL;
513  SecurityFlags flags = SEC_NO_FLAGS;
514 
515  if (!WithCrypto)
516  return SEC_NO_FLAGS;
517 
519  for (; p[0] != '\0'; p++)
520  {
521  switch (p[0])
522  {
523  case 'c':
524  case 'C':
525  q = smime_cryptalg;
526 
527  if (p[1] == '<')
528  {
529  for (p += 2; (p[0] != '\0') && (p[0] != '>') &&
530  (q < (smime_cryptalg + sizeof(smime_cryptalg) - 1));
531  *q++ = *p++)
532  {
533  }
534 
535  if (p[0] != '>')
536  {
537  mutt_error(_("Illegal S/MIME header"));
538  return SEC_NO_FLAGS;
539  }
540  }
541 
542  *q = '\0';
543  break;
544 
545  case 'e':
546  case 'E':
547  flags |= SEC_ENCRYPT;
548  break;
549 
550  case 'i':
551  case 'I':
552  flags |= SEC_INLINE;
553  break;
554 
555  /* This used to be the micalg parameter.
556  *
557  * It's no longer needed, so we just skip the parameter in order
558  * to be able to recall old messages. */
559  case 'm':
560  case 'M':
561  if (p[1] != '<')
562  break;
563 
564  for (p += 2; (p[0] != '\0') && (p[0] != '>'); p++)
565  ; // do nothing
566 
567  if (p[0] != '>')
568  {
569  mutt_error(_("Illegal crypto header"));
570  return SEC_NO_FLAGS;
571  }
572  break;
573 
574  case 'o':
575  case 'O':
576  flags |= SEC_OPPENCRYPT;
577  break;
578 
579  case 'a':
580  case 'A':
581 #ifdef USE_AUTOCRYPT
582  flags |= SEC_AUTOCRYPT;
583 #endif
584  break;
585 
586  case 'z':
587  case 'Z':
588 #ifdef USE_AUTOCRYPT
589  flags |= SEC_AUTOCRYPT_OVERRIDE;
590 #endif
591  break;
592 
593  case 's':
594  case 'S':
595  flags |= SEC_SIGN;
596  q = sign_as;
597 
598  if (p[1] == '<')
599  {
600  for (p += 2;
601  (p[0] != '\0') && (*p != '>') && (q < (sign_as + sizeof(sign_as) - 1));
602  *q++ = *p++)
603  {
604  }
605 
606  if (p[0] != '>')
607  {
608  mutt_error(_("Illegal crypto header"));
609  return SEC_NO_FLAGS;
610  }
611  }
612 
613  q[0] = '\0';
614  break;
615 
616  default:
617  mutt_error(_("Illegal crypto header"));
618  return SEC_NO_FLAGS;
619  }
620  }
621 
622  /* the cryptalg field must not be empty */
623  if (((WithCrypto & APPLICATION_SMIME) != 0) && *smime_cryptalg)
624  {
625  struct Buffer errmsg = mutt_buffer_make(0);
626  int rc = cs_subset_str_string_set(NeoMutt->sub, "smime_encrypt_with",
627  smime_cryptalg, &errmsg);
628 
629  if ((CSR_RESULT(rc) != CSR_SUCCESS) && !mutt_buffer_is_empty(&errmsg))
630  mutt_error("%s", mutt_buffer_string(&errmsg));
631 
632  mutt_buffer_dealloc(&errmsg);
633  }
634 
635  /* Set {Smime,Pgp}SignAs, if desired. */
636 
637  if (((WithCrypto & APPLICATION_PGP) != 0) && (crypt_app == APPLICATION_PGP) &&
638  (flags & SEC_SIGN) && (set_empty_signas || *sign_as))
639  {
640  mutt_str_replace(&C_PgpSignAs, sign_as);
641  }
642 
643  if (((WithCrypto & APPLICATION_SMIME) != 0) && (crypt_app == APPLICATION_SMIME) &&
644  (flags & SEC_SIGN) && (set_empty_signas || *sign_as))
645  {
646  mutt_str_replace(&C_SmimeSignAs, sign_as);
647  }
648 
649  return flags;
650 }
651 
664 int mutt_prepare_template(FILE *fp, struct Mailbox *m, struct Email *e_new,
665  struct Email *e, bool resend)
666 {
667  struct Message *msg = NULL;
668  struct Body *b = NULL;
669  FILE *fp_body = NULL;
670  int rc = -1;
671  struct State s = { 0 };
672  SecurityFlags sec_type;
673  struct Envelope *protected_headers = NULL;
674 
675  if (!fp && !(msg = mx_msg_open(m, e->msgno)))
676  return -1;
677 
678  if (!fp)
679  fp = msg->fp;
680 
681  fp_body = fp;
682 
683  /* parse the message header and MIME structure */
684 
685  fseeko(fp, e->offset, SEEK_SET);
686  e_new->offset = e->offset;
687  /* enable header weeding for resent messages */
688  e_new->env = mutt_rfc822_read_header(fp, e_new, true, resend);
689  e_new->body->length = e->body->length;
690  mutt_parse_part(fp, e_new->body);
691 
692  /* If resending a message, don't keep message_id or mail_followup_to.
693  * Otherwise, we are resuming a postponed message, and want to keep those
694  * headers if they exist. */
695  if (resend)
696  {
697  FREE(&e_new->env->message_id);
698  FREE(&e_new->env->mail_followup_to);
699  }
700 
701  /* decrypt pgp/mime encoded messages */
702 
703  if (((WithCrypto & APPLICATION_PGP) != 0) &&
704  (sec_type = mutt_is_multipart_encrypted(e_new->body)))
705  {
706  e_new->security |= sec_type;
707  if (!crypt_valid_passphrase(sec_type))
708  goto bail;
709 
710  mutt_message(_("Decrypting message..."));
711  if ((crypt_pgp_decrypt_mime(fp, &fp_body, e_new->body, &b) == -1) || !b)
712  {
713  goto bail;
714  }
715 
716  mutt_body_free(&e_new->body);
717  e_new->body = b;
718 
719  if (b->mime_headers)
720  {
721  protected_headers = b->mime_headers;
722  b->mime_headers = NULL;
723  }
724 
726  }
727 
728  /* remove a potential multipart/signed layer - useful when
729  * resending messages */
730  if ((WithCrypto != 0) && mutt_is_multipart_signed(e_new->body))
731  {
732  e_new->security |= SEC_SIGN;
733  if (((WithCrypto & APPLICATION_PGP) != 0) &&
734  mutt_istr_equal(mutt_param_get(&e_new->body->parameter, "protocol"),
735  "application/pgp-signature"))
736  {
737  e_new->security |= APPLICATION_PGP;
738  }
739  else if (WithCrypto & APPLICATION_SMIME)
740  e_new->security |= APPLICATION_SMIME;
741 
742  /* destroy the signature */
743  mutt_body_free(&e_new->body->parts->next);
744  e_new->body = mutt_remove_multipart(e_new->body);
745 
746  if (e_new->body->mime_headers)
747  {
748  mutt_env_free(&protected_headers);
749  protected_headers = e_new->body->mime_headers;
750  e_new->body->mime_headers = NULL;
751  }
752  }
753 
754  /* We don't need no primary multipart.
755  * Note: We _do_ preserve messages!
756  *
757  * XXX - we don't handle multipart/alternative in any
758  * smart way when sending messages. However, one may
759  * consider this a feature. */
760  if (e_new->body->type == TYPE_MULTIPART)
761  e_new->body = mutt_remove_multipart(e_new->body);
762 
763  s.fp_in = fp_body;
764 
765  struct Buffer *file = mutt_buffer_pool_get();
766 
767  /* create temporary files for all attachments */
768  for (b = e_new->body; b; b = b->next)
769  {
770  /* what follows is roughly a receive-mode variant of
771  * mutt_get_tmp_attachment () from muttlib.c */
772 
773  mutt_buffer_reset(file);
774  if (b->filename)
775  {
776  mutt_buffer_strcpy(file, b->filename);
778  }
779  else
780  {
781  /* avoid Content-Disposition: header with temporary filename */
782  b->use_disp = false;
783  }
784 
785  /* set up state flags */
786 
787  s.flags = 0;
788 
789  if (b->type == TYPE_TEXT)
790  {
791  if (mutt_istr_equal("yes",
792  mutt_param_get(&b->parameter, "x-mutt-noconv")))
793  {
794  b->noconv = true;
795  }
796  else
797  {
798  s.flags |= MUTT_CHARCONV;
799  b->noconv = false;
800  }
801 
802  mutt_param_delete(&b->parameter, "x-mutt-noconv");
803  }
804 
805  mutt_adv_mktemp(file);
806  s.fp_out = mutt_file_fopen(mutt_buffer_string(file), "w");
807  if (!s.fp_out)
808  goto bail;
809 
810  if (((WithCrypto & APPLICATION_PGP) != 0) &&
811  ((sec_type = mutt_is_application_pgp(b)) & (SEC_ENCRYPT | SEC_SIGN)))
812  {
813  if (sec_type & SEC_ENCRYPT)
814  {
816  goto bail;
817  mutt_message(_("Decrypting message..."));
818  }
819 
820  if (mutt_body_handler(b, &s) < 0)
821  {
822  mutt_error(_("Decryption failed"));
823  goto bail;
824  }
825 
826  if ((b == e_new->body) && !protected_headers)
827  {
828  protected_headers = b->mime_headers;
829  b->mime_headers = NULL;
830  }
831 
832  e_new->security |= sec_type;
833  b->type = TYPE_TEXT;
834  mutt_str_replace(&b->subtype, "plain");
835  mutt_param_delete(&b->parameter, "x-action");
836  }
837  else if (((WithCrypto & APPLICATION_SMIME) != 0) &&
838  ((sec_type = mutt_is_application_smime(b)) & (SEC_ENCRYPT | SEC_SIGN)))
839  {
840  if (sec_type & SEC_ENCRYPT)
841  {
843  goto bail;
844  crypt_smime_getkeys(e_new->env);
845  mutt_message(_("Decrypting message..."));
846  }
847 
848  if (mutt_body_handler(b, &s) < 0)
849  {
850  mutt_error(_("Decryption failed"));
851  goto bail;
852  }
853 
854  e_new->security |= sec_type;
855  b->type = TYPE_TEXT;
856  mutt_str_replace(&b->subtype, "plain");
857  }
858  else
859  mutt_decode_attachment(b, &s);
860 
861  if (mutt_file_fclose(&s.fp_out) != 0)
862  goto bail;
863 
865  b->unlink = true;
866 
868 
869  mutt_body_free(&b->parts);
870  if (b->email)
871  b->email->body = NULL; /* avoid dangling pointer */
872  }
873 
874  if (C_CryptProtectedHeadersRead && protected_headers && protected_headers->subject &&
875  !mutt_str_equal(e_new->env->subject, protected_headers->subject))
876  {
877  mutt_str_replace(&e_new->env->subject, protected_headers->subject);
878  }
879  mutt_env_free(&protected_headers);
880 
881  /* Fix encryption flags. */
882 
883  /* No inline if multipart. */
884  if ((WithCrypto != 0) && (e_new->security & SEC_INLINE) && e_new->body->next)
885  e_new->security &= ~SEC_INLINE;
886 
887  /* Do we even support multiple mechanisms? */
889 
890  /* Theoretically, both could be set. Take the one the user wants to set by default. */
891  if ((e_new->security & APPLICATION_PGP) && (e_new->security & APPLICATION_SMIME))
892  {
893  if (C_SmimeIsDefault)
894  e_new->security &= ~APPLICATION_PGP;
895  else
896  e_new->security &= ~APPLICATION_SMIME;
897  }
898 
900 
901  rc = 0;
902 
903 bail:
904 
905  /* that's it. */
907  if (fp_body != fp)
908  mutt_file_fclose(&fp_body);
909  if (msg)
910  mx_msg_close(m, &msg);
911 
912  if (rc == -1)
913  {
914  mutt_env_free(&e_new->env);
915  mutt_body_free(&e_new->body);
916  }
917 
918  return rc;
919 }
MENU_POSTPONE
@ MENU_POSTPONE
Select a postponed email.
Definition: keymap.h:82
Menu::oldcurrent
int oldcurrent
For driver use only.
Definition: mutt_menu.h:76
ctx_free
void ctx_free(struct Context **ptr)
Free a Context.
Definition: context.c:50
Envelope
The header of an Email.
Definition: envelope.h:54
mutt_search_command
int mutt_search_command(struct Context *ctx, struct Mailbox *m, int cur, int op)
Perform a search.
Definition: pattern.c:493
rfc3676.h
Email::msgno
int msgno
Number displayed to the user.
Definition: email.h:87
Envelope::subject
char * subject
Email's subject.
Definition: envelope.h:66
WT_DLG_POSTPONE
@ WT_DLG_POSTPONE
Postpone Dialog, dlg_select_postponed_email()
Definition: mutt_window.h:86
mx_mbox_check
enum MxStatus mx_mbox_check(struct Mailbox *m)
Check for new mail - Wrapper for MxOps::mbox_check()
Definition: mx.c:1137
Body::noconv
bool noconv
Don't do character set conversion.
Definition: body.h:73
dialog_create_simple_index
struct MuttWindow * dialog_create_simple_index(struct Menu *menu, enum WindowType type)
Create a simple index Dialog.
Definition: dialog.c:165
SEND_REPLY
#define SEND_REPLY
Reply to sender.
Definition: send.h:41
State::fp_in
FILE * fp_in
File to read from.
Definition: state.h:46
MxStatus
MxStatus
Return values from mx_mbox_check(), mx_mbox_sync(), and mx_mbox_close()
Definition: mx.h:71
crypt_smime_getkeys
void crypt_smime_getkeys(struct Envelope *env)
Wrapper for CryptModuleSpecs::smime_getkeys()
Definition: cryptglue.c:458
dlg_select_postponed_email
static struct Email * dlg_select_postponed_email(struct Context *ctx)
Create a Menu to select a postponed message.
Definition: postpone.c:225
mutt_stamp_attachment
void mutt_stamp_attachment(struct Body *a)
Timestamp an Attachment.
Definition: sendlib.c:893
_
#define _(a)
Definition: message.h:28
NONULL
#define NONULL(x)
Definition: string2.h:37
Mailbox
A mailbox.
Definition: mailbox.h:81
Envelope::message_id
char * message_id
Message ID.
Definition: envelope.h:69
mutt_make_string
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.
Definition: hdrline.c:1427
APPLICATION_SMIME
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: lib.h:98
Mailbox::emails
struct Email ** emails
Array of Emails.
Definition: mailbox.h:99
ListNode
A List node for strings.
Definition: list.h:34
Buffer
String manipulation buffer.
Definition: buffer.h:33
LL_DEBUG3
@ LL_DEBUG3
Log at debug level 3.
Definition: logging.h:42
STAILQ_REMOVE
#define STAILQ_REMOVE(head, elm, type, field)
Definition: queue.h:399
Mailbox::msg_deleted
int msg_deleted
Number of deleted messages.
Definition: mailbox.h:96
SEC_OPPENCRYPT
#define SEC_OPPENCRYPT
Opportunistic encrypt mode.
Definition: lib.h:93
mutt_file_fclose
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
Definition: file.c:153
mutt_buffer_pretty_mailbox
void mutt_buffer_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
Definition: muttlib.c:599
SEC_AUTOCRYPT_OVERRIDE
#define SEC_AUTOCRYPT_OVERRIDE
(Autocrypt) Indicates manual set/unset of encryption
Definition: lib.h:95
C_PgpSignAs
char * C_PgpSignAs
Config: Use this alternative key for signing messages.
Definition: config.c:65
Body::next
struct Body * next
next attachment in the list
Definition: body.h:53
mutt_buffer_is_empty
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition: buffer.c:252
mutt_buffer_dealloc
void mutt_buffer_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:294
format_flags.h
Body
The body of an email.
Definition: body.h:34
SEC_ENCRYPT
#define SEC_ENCRYPT
Email is encrypted.
Definition: lib.h:85
MUTT_FORMAT_ARROWCURSOR
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
CSR_SUCCESS
#define CSR_SUCCESS
Action completed successfully.
Definition: set.h:35
mutt_remove_multipart
struct Body * mutt_remove_multipart(struct Body *b)
Extract the multipart body if it exists.
Definition: multipart.c:126
SEC_SIGN
#define SEC_SIGN
Email is signed.
Definition: lib.h:86
CSR_RESULT
#define CSR_RESULT(x)
Definition: set.h:52
handler.h
MuttWindow
A division of the screen.
Definition: mutt_window.h:115
mutt_parse_crypt_hdr
SecurityFlags mutt_parse_crypt_hdr(const char *p, bool set_empty_signas, SecurityFlags crypt_app)
Parse a crypto header string.
Definition: postpone.c:508
mutt_parse_part
void mutt_parse_part(FILE *fp, struct Body *b)
Parse a MIME part.
Definition: parse.c:1659
Email::offset
LOFF_T offset
Where in the stream does this message begin?
Definition: email.h:84
crypt_pgp_decrypt_mime
int crypt_pgp_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
Wrapper for CryptModuleSpecs::decrypt_mime()
Definition: cryptglue.c:209
MUTT_YES
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition: quad.h:40
Context
The "current" mailbox.
Definition: context.h:38
mutt_str_dup
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:370
mutt_globals.h
mutt_file_fopen
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
Definition: file.c:589
FREE
#define FREE(x)
Definition: memory.h:40
options.h
mutt_menu_new
struct Menu * mutt_menu_new(enum MenuType type)
Create a new Menu.
Definition: menu.c:956
MuttWindow::help_menu
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
Definition: mutt_window.h:134
SecurityFlags
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:83
REDRAW_MOTION_RESYNC
#define REDRAW_MOTION_RESYNC
Redraw any changing the menu selection.
Definition: mutt_menu.h:42
Menu::make_entry
void(* make_entry)(struct Menu *menu, char *buf, size_t buflen, int line)
Format a item for a menu.
Definition: mutt_menu.h:88
mutt_buffer_reset
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition: buffer.c:79
mutt_buffer_pool_release
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
Definition: pool.c:112
mailbox_free
void mailbox_free(struct Mailbox **ptr)
Free a Mailbox.
Definition: mailbox.c:71
mutt_get_postponed
int mutt_get_postponed(struct Context *ctx, struct Email *hdr, struct Email **cur, struct Buffer *fcc)
Recall a postponed message.
Definition: postpone.c:331
mutt_body_free
void mutt_body_free(struct Body **ptr)
Free a Body.
Definition: body.c:57
Body::subtype
char * subtype
content-type subtype
Definition: body.h:37
mx_path_resolve
struct Mailbox * mx_path_resolve(const char *path)
Get a Mailbox for a path.
Definition: mx.c:1681
mutt_list_insert_tail
struct ListNode * mutt_list_insert_tail(struct ListHead *h, char *s)
Append a string to the end of a List.
Definition: list.c:64
State::fp_out
FILE * fp_out
File to write to.
Definition: state.h:47
Context::msg_in_pager
int msg_in_pager
Message currently shown in the pager.
Definition: context.h:44
C_CryptProtectedHeadersRead
bool C_CryptProtectedHeadersRead
Config: Display protected headers (Memory Hole) in the pager.
Definition: config.c:56
mutt_istr_equal
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition: string.c:883
mutt_hash_find
void * mutt_hash_find(const struct HashTable *table, const char *strkey)
Find the HashElem data in a Hash Table element using a key.
Definition: hash.c:354
mutt_str_equal
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:871
Mapping
Mapping between user-readable string and a constant.
Definition: mapping.h:31
lib.h
C_SmimeSignAs
char * C_SmimeSignAs
Config: Use this alternative key for signing messages.
Definition: config.c:68
protos.h
MUTT_PURGE
@ MUTT_PURGE
Messages to be purged (bypass trash)
Definition: mutt.h:100
mutt_menu_push_current
void mutt_menu_push_current(struct Menu *menu)
Add a new Menu to the stack.
Definition: menu.c:1015
mutt_env_free
void mutt_env_free(struct Envelope **ptr)
Free an Envelope.
Definition: envelope.c:96
mutt_buffer_pool_get
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:101
mutt_is_application_pgp
SecurityFlags mutt_is_application_pgp(struct Body *m)
Does the message use PGP?
Definition: crypt.c:554
SEND_POSTPONED
#define SEND_POSTPONED
Recall a postponed email.
Definition: send.h:45
SEND_POSTPONED_FCC
#define SEND_POSTPONED_FCC
Used by mutt_get_postponed() to signal that the x-mutt-fcc header field was present.
Definition: send.h:49
keymap.h
MUTT_CHARCONV
#define MUTT_CHARCONV
Do character set conversions.
Definition: state.h:36
lib.h
muttlib.h
mutt_is_multipart_encrypted
SecurityFlags mutt_is_multipart_encrypted(struct Body *b)
Does the message have encrypted parts?
Definition: crypt.c:449
mx_mbox_close
enum MxStatus mx_mbox_close(struct Context **ptr)
Save changes and close mailbox.
Definition: mx.c:632
Body::length
LOFF_T length
length (in bytes) of attachment
Definition: body.h:45
APPLICATION_PGP
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:97
mutt_rfc3676_space_unstuff
void mutt_rfc3676_space_unstuff(struct Email *e)
Remove RFC3676 space stuffing.
Definition: rfc3676.c:492
mutt_menu.h
C_CryptOpportunisticEncrypt
bool C_CryptOpportunisticEncrypt
Config: Enable encryption when the recipient's key is available.
Definition: config.c:54
lib.h
cs_subset_str_string_set
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.
Definition: subset.c:395
Mailbox::msg_count
int msg_count
Total number of messages.
Definition: mailbox.h:91
mutt_clear_error
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:113
mutt_str_skip_email_wsp
char * mutt_str_skip_email_wsp(const char *s)
Skip over whitespace as defined by RFC5322.
Definition: string.c:743
C_IndexFormat
WHERE char * C_IndexFormat
Config: printf-like format string for the index menu (emails)
Definition: mutt_globals.h:92
post_make_entry
static void post_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
Format a menu item for the email list - Implements Menu::make_entry()
Definition: postpone.c:211
UpdateNumPostponed
static bool UpdateNumPostponed
Definition: postpone.c:79
Menu::pagelen
int pagelen
Number of entries per screen.
Definition: mutt_menu.h:60
MUTT_IMAP
@ MUTT_IMAP
'IMAP' Mailbox type
Definition: mailbox.h:53
MUTT_NOSORT
#define MUTT_NOSORT
Do not sort the mailbox after opening it.
Definition: mx.h:52
Body::parts
struct Body * parts
parts of a multipart or message/rfc822
Definition: body.h:54
Context::mailbox
struct Mailbox * mailbox
Definition: context.h:50
Email::env
struct Envelope * env
Envelope information.
Definition: email.h:90
mutt_update_num_postponed
void mutt_update_num_postponed(void)
Force the update of the number of postponed messages.
Definition: postpone.c:203
mutt_debug
#define mutt_debug(LEVEL,...)
Definition: logging.h:81
Menu::title
const char * title
Title of this menu.
Definition: mutt_menu.h:54
Mailbox::realpath
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
Definition: mailbox.h:84
REDRAW_INDEX
#define REDRAW_INDEX
Redraw the index.
Definition: mutt_menu.h:40
Message::fp
FILE * fp
pointer to the message data
Definition: mx.h:96
MX_STATUS_ERROR
@ MX_STATUS_ERROR
An error occurred.
Definition: mx.h:73
MUTT_QUIET
#define MUTT_QUIET
Do not print any messages.
Definition: mx.h:55
mutt_prepare_template
int mutt_prepare_template(FILE *fp, struct Mailbox *m, struct Email *e_new, struct Email *e, bool resend)
Prepare a message template.
Definition: postpone.c:664
mutt_buffer_string
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:77
STAILQ_FOREACH_SAFE
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
Definition: queue.h:359
Email::chain
struct ListHead chain
Mixmaster chain.
Definition: email.h:102
hardclose
static void hardclose(struct Context **pctx)
try hard to close a mailbox
Definition: postpone.c:310
Email::security
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Definition: email.h:39
SORT_ORDER
@ SORT_ORDER
Sort by the order the messages appear in the mailbox.
Definition: sort2.h:50
MuttWindow::help_data
const struct Mapping * help_data
Data for the Help Bar.
Definition: mutt_window.h:135
Menu::custom_search
bool custom_search
The menu implements its own non-Menusearch()-compatible search, trickle OP_SEARCH*.
Definition: mutt_menu.h:79
Menu::top
int top
Entry that is the top of the current page.
Definition: mutt_menu.h:75
mutt_str_replace
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:446
lib.h
lib.h
mutt_adv_mktemp
void mutt_adv_mktemp(struct Buffer *buf)
Create a temporary file.
Definition: muttlib.c:90
WithCrypto
#define WithCrypto
Definition: lib.h:123
mutt_logging.h
mutt_param_delete
void mutt_param_delete(struct ParameterList *pl, const char *attribute)
Delete a matching Parameter.
Definition: parameter.c:142
mutt_menu_loop
int mutt_menu_loop(struct Menu *menu)
Menu event loop.
Definition: menu.c:1309
MuttWindow::state
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:120
mutt_param_get
char * mutt_param_get(const struct ParameterList *pl, const char *s)
Find a matching Parameter.
Definition: parameter.c:84
lib.h
lib.h
mutt_menu_pop_current
void mutt_menu_pop_current(struct Menu *menu)
Remove a Menu from the stack.
Definition: menu.c:1027
PostCount
static short PostCount
Definition: postpone.c:78
lib.h
imap_path_status
int imap_path_status(const char *path, bool queue)
Refresh the number of total and new messages.
Definition: imap.c:1222
Envelope::userhdrs
struct ListHead userhdrs
user defined headers
Definition: envelope.h:83
State
Keep track when processing files.
Definition: state.h:44
Body::d_filename
char * d_filename
filename to be used for the content-disposition header.
Definition: body.h:47
mutt_thread.h
MUTT_DELETE
@ MUTT_DELETE
Messages to be deleted.
Definition: mutt.h:98
C_Sort
WHERE short C_Sort
Config: Sort method for the index.
Definition: sort.h:60
Menu::mdata
void * mdata
Extra data for the current menu.
Definition: mutt_menu.h:55
sort.h
mutt_make_id_hash
struct HashTable * mutt_make_id_hash(struct Mailbox *m)
Create a Hash Table for message-ids.
Definition: mutt_thread.c:1518
Menu::max
int max
Number of entries in the menu.
Definition: mutt_menu.h:57
TYPE_TEXT
@ TYPE_TEXT
Type: 'text/*'.
Definition: mime.h:38
NeoMutt
Container for Accounts, Notifications.
Definition: neomutt.h:36
mutt.h
Context::menu
struct Menu * menu
Needed for pattern compilation.
Definition: context.h:46
SEC_INLINE
#define SEC_INLINE
Email has an inline signature.
Definition: lib.h:92
crypt_opportunistic_encrypt
void crypt_opportunistic_encrypt(struct Email *e)
Can all recipients be determined.
Definition: crypt.c:1024
mutt_istr_startswith
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
Definition: string.c:172
C_Delete
WHERE unsigned char C_Delete
Config: Really delete messages, when the mailbox is closed.
Definition: mutt_globals.h:125
Body::type
unsigned int type
content-type primary type, ContentType
Definition: body.h:65
C_Postponed
WHERE char * C_Postponed
Config: Folder to store postponed messages.
Definition: mutt_globals.h:101
mutt_num_postponed
int mutt_num_postponed(struct Mailbox *m, bool force)
Return the number of postponed messages.
Definition: postpone.c:89
mx_mbox_open
struct Context * mx_mbox_open(struct Mailbox *m, OpenMailboxFlags flags)
Open a mailbox and parse it.
Definition: mx.c:309
Menu::redraw
MuttRedrawFlags redraw
When to redraw the screen.
Definition: mutt_menu.h:58
PostponeHelp
static const struct Mapping PostponeHelp[]
Help Bar for the Postponed email selection dialog.
Definition: postpone.c:68
mutt_body_handler
int mutt_body_handler(struct Body *b, struct State *s)
Handler for the Body of an email.
Definition: handler.c:1595
imap_path_probe
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe()
Definition: imap.c:2372
REDRAW_CURRENT
#define REDRAW_CURRENT
Redraw the current line of the menu.
Definition: mutt_menu.h:43
ListNode::data
char * data
String.
Definition: list.h:36
context.h
C_SmimeIsDefault
bool C_SmimeIsDefault
Config: Use SMIME rather than PGP by default.
Definition: config.c:59
mutt_rfc822_read_header
struct Envelope * mutt_rfc822_read_header(FILE *fp, struct Email *e, bool user_hdrs, bool weed)
parses an RFC822 header
Definition: parse.c:1112
NeoMutt::sub
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
Body::use_disp
bool use_disp
Content-Disposition uses filename= ?
Definition: body.h:68
plen
static size_t plen
Length of cached packet.
Definition: pgppacket.c:39
C_Resolve
WHERE bool C_Resolve
Config: Move to the next email whenever a command modifies an email.
Definition: mutt_globals.h:155
Body::email
struct Email * email
header information for message/rfc822
Definition: body.h:55
WindowState::cols
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:57
Body::unlink
bool unlink
If true, filename should be unlink()ed before free()ing this structure.
Definition: body.h:69
dialog_destroy_simple_index
void dialog_destroy_simple_index(struct MuttWindow **ptr)
Destroy a simple index Dialog.
Definition: dialog.c:209
Menu::current
int current
Current entry.
Definition: mutt_menu.h:56
mx_fastclose_mailbox
void mx_fastclose_mailbox(struct Mailbox *m)
free up memory associated with the Mailbox
Definition: mx.c:451
mx.h
opcodes.h
Body::parameter
struct ParameterList parameter
parameters of the content-type
Definition: body.h:39
mutt_decode_attachment
void mutt_decode_attachment(struct Body *b, struct State *s)
Decode an email's attachment.
Definition: handler.c:1845
mx_msg_close
int mx_msg_close(struct Mailbox *m, struct Message **msg)
Close a message.
Definition: mx.c:1204
state.h
State::flags
StateFlags flags
Flags, e.g. MUTT_DISPLAY.
Definition: state.h:49
TYPE_MULTIPART
@ TYPE_MULTIPART
Type: 'multipart/*'.
Definition: mime.h:37
Email
The envelope/body of an email.
Definition: email.h:37
lib.h
mutt_str_startswith
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
Definition: string.c:160
REDRAW_MOTION
#define REDRAW_MOTION
Redraw after moving the menu list.
Definition: mutt_menu.h:41
mutt_message
#define mutt_message(...)
Definition: logging.h:83
mutt_set_flag
#define mutt_set_flag(m, e, flag, bf)
Definition: protos.h:67
Envelope::mail_followup_to
struct AddressList mail_followup_to
Email's 'mail-followup-to'.
Definition: envelope.h:63
mutt_buffer_printf
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:160
Menu::win_index
struct MuttWindow * win_index
Definition: mutt_menu.h:63
mutt_buffer_make
struct Buffer mutt_buffer_make(size_t size)
Make a new buffer on the stack.
Definition: buffer.c:61
mutt_list_free
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
Definition: list.c:122
crypt_valid_passphrase
bool crypt_valid_passphrase(SecurityFlags flags)
Check that we have a usable passphrase, ask if not.
Definition: crypt.c:135
Menu
GUI selectable list of items.
Definition: mutt_menu.h:52
SEC_NO_FLAGS
#define SEC_NO_FLAGS
No flags are set.
Definition: lib.h:84
mutt_is_multipart_signed
SecurityFlags mutt_is_multipart_signed(struct Body *b)
Is a message signed?
Definition: crypt.c:409
N_
#define N_(a)
Definition: message.h:32
mutt_buffer_strcpy
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:312
Mailbox::id_hash
struct HashTable * id_hash
Hash Table by msg id.
Definition: mailbox.h:127
REDRAW_STATUS
#define REDRAW_STATUS
Redraw the status bar.
Definition: mutt_menu.h:44
hdrline.h
mutt_is_application_smime
SecurityFlags mutt_is_application_smime(struct Body *m)
Does the message use S/MIME?
Definition: crypt.c:612
SEC_AUTOCRYPT
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
Definition: lib.h:94
Message
A local copy of an email.
Definition: mx.h:94
Body::mime_headers
struct Envelope * mime_headers
Memory hole protected headers.
Definition: body.h:63
Body::filename
char * filename
when sending a message, this is the file to which this structure refers
Definition: body.h:46
MX_STATUS_OK
@ MX_STATUS_OK
No changes.
Definition: mx.h:74
Email::body
struct Body * body
List of MIME parts.
Definition: email.h:91
OptNews
WHERE bool OptNews
(pseudo) used to change reader mode
Definition: options.h:45
mutt_menu_free
void mutt_menu_free(struct Menu **ptr)
Destroy a menu.
Definition: menu.c:972
mx_msg_open
struct Message * mx_msg_open(struct Mailbox *m, int msgno)
return a stream pointer for a message
Definition: mx.c:1158
mutt_error
#define mutt_error(...)
Definition: logging.h:84