NeoMutt  2025-12-11-276-g10b23b
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
expando_index.c
Go to the documentation of this file.
1
31
37
38#include "config.h"
39#include <stdbool.h>
40#include <stdio.h>
41#include <string.h>
42#include <time.h>
43#include "private.h"
44#include "mutt/lib.h"
45#include "address/lib.h"
46#include "config/lib.h"
47#include "email/lib.h"
48#include "core/lib.h"
49#include "alias/lib.h"
50#include "gui/lib.h"
51#include "expando_index.h"
52#include "attach/lib.h"
53#include "color/lib.h"
54#include "expando/lib.h"
55#include "hooks/lib.h"
56#include "ncrypt/lib.h"
57#include "muttlib.h"
58#include "mx.h"
59#include "subjectrx.h"
60#ifdef USE_NOTMUCH
61#include "notmuch/lib.h"
62#endif
63
64static void mailbox_mailbox_name(const struct ExpandoNode *node, void *data,
65 MuttFormatFlags flags, struct Buffer *buf);
66
81
91
100static const char *make_from_prefix(enum FieldType disp)
101{
102 /* need 2 bytes at the end, one for the space, another for NUL */
103 static char padded[8];
104 static const char *long_prefixes[DISP_MAX] = {
105 [DISP_TO] = "To ", [DISP_CC] = "Cc ", [DISP_BCC] = "Bcc ",
106 [DISP_FROM] = "", [DISP_PLAIN] = "",
107 };
108
109 const struct MbTable *c_from_chars = cs_subset_mbtable(NeoMutt->sub, "from_chars");
110
111 if (!c_from_chars || !c_from_chars->chars || (c_from_chars->len == 0))
112 return long_prefixes[disp];
113
114 const char *pchar = mbtable_get_nth_wchar(c_from_chars, disp);
115 if (mutt_str_len(pchar) == 0)
116 return "";
117
118 snprintf(padded, sizeof(padded), "%s ", pchar);
119 return padded;
120}
121
136static void make_from(struct Envelope *env, char *buf, size_t buflen,
137 bool do_lists, MuttFormatFlags flags)
138{
139 if (!env || !buf)
140 return;
141
142 bool me;
143 enum FieldType disp;
144 struct AddressList *name = NULL;
145
147
148 if (do_lists || me)
149 {
150 if (check_for_mailing_list(&env->to, make_from_prefix(DISP_TO), buf, buflen))
151 return;
152 if (check_for_mailing_list(&env->cc, make_from_prefix(DISP_CC), buf, buflen))
153 return;
154 }
155
156 if (me && !TAILQ_EMPTY(&env->to))
157 {
158 disp = (flags & MUTT_FORMAT_PLAIN) ? DISP_PLAIN : DISP_TO;
159 name = &env->to;
160 }
161 else if (me && !TAILQ_EMPTY(&env->cc))
162 {
163 disp = DISP_CC;
164 name = &env->cc;
165 }
166 else if (me && !TAILQ_EMPTY(&env->bcc))
167 {
168 disp = DISP_BCC;
169 name = &env->bcc;
170 }
171 else if (!TAILQ_EMPTY(&env->from))
172 {
173 disp = DISP_FROM;
174 name = &env->from;
175 }
176 else
177 {
178 *buf = '\0';
179 return;
180 }
181
182 snprintf(buf, buflen, "%s%s", make_from_prefix(disp), mutt_get_name(TAILQ_FIRST(name)));
183}
184
192static void make_from_addr(struct Envelope *env, char *buf, size_t buflen, bool do_lists)
193{
194 if (!env || !buf)
195 return;
196
197 bool me = mutt_addr_is_user(TAILQ_FIRST(&env->from));
198
199 if (do_lists || me)
200 {
201 if (check_for_mailing_list_addr(&env->to, buf, buflen))
202 return;
203 if (check_for_mailing_list_addr(&env->cc, buf, buflen))
204 return;
205 }
206
207 if (me && !TAILQ_EMPTY(&env->to))
208 snprintf(buf, buflen, "%s", buf_string(TAILQ_FIRST(&env->to)->mailbox));
209 else if (me && !TAILQ_EMPTY(&env->cc))
210 snprintf(buf, buflen, "%s", buf_string(TAILQ_FIRST(&env->cc)->mailbox));
211 else if (!TAILQ_EMPTY(&env->from))
212 mutt_str_copy(buf, buf_string(TAILQ_FIRST(&env->from)->mailbox), buflen);
213 else
214 *buf = '\0';
215}
216
222static bool user_in_addr(struct AddressList *al)
223{
224 struct Address *a = NULL;
225 TAILQ_FOREACH(a, al, entries)
226 if (mutt_addr_is_user(a))
227 return true;
228 return false;
229}
230
236static enum ToChars user_is_recipient(struct Email *e)
237{
238 if (!e || !e->env)
240
241 struct Envelope *env = e->env;
242
243 if (!e->recip_valid)
244 {
245 e->recip_valid = true;
246
248 {
250 }
251 else if (user_in_addr(&env->to))
252 {
253 if (TAILQ_NEXT(TAILQ_FIRST(&env->to), entries) || !TAILQ_EMPTY(&env->cc))
254 e->recipient = FLAG_CHAR_TO_TO; /* non-unique recipient */
255 else
256 e->recipient = FLAG_CHAR_TO_UNIQUE; /* unique recipient */
257 }
258 else if (user_in_addr(&env->cc))
259 {
261 }
262 else if (check_for_mailing_list(&env->to, NULL, NULL, 0))
263 {
265 }
266 else if (check_for_mailing_list(&env->cc, NULL, NULL, 0))
267 {
269 }
270 else if (user_in_addr(&env->reply_to))
271 {
273 }
274 else
275 {
277 }
278 }
279
280 return e->recipient;
281}
282
288static bool thread_is_new(struct Email *e)
289{
290 return e->collapsed && (e->num_hidden > 1) && (mutt_thread_contains_unread(e) == 1);
291}
292
298static bool thread_is_old(struct Email *e)
299{
300 return e->collapsed && (e->num_hidden > 1) && (mutt_thread_contains_unread(e) == 2);
301}
302
312static void index_email_date(const struct ExpandoNode *node, const struct Email *e,
313 enum IndexDateChoice which, MuttFormatFlags flags,
314 struct Buffer *buf, const char *format)
315{
316 char *fmt = mutt_str_dup(format);
317 if (!fmt)
318 return;
319
320 struct tm tm = { 0 };
321 switch (which)
322 {
323 case SENT_SENDER:
324 {
325#ifdef HAVE_STRUCT_TM_TM_GMTOFF
326 int offset = (e->zhours * 3600 + e->zminutes * 60) * (e->zoccident ? -1 : 1);
327 const time_t now = e->date_sent + offset;
328 tm = mutt_date_gmtime(now);
329 tm.tm_gmtoff = offset;
330 break;
331#else
333#endif
334 }
335 case SENT_LOCAL:
336 {
338 break;
339 }
340 case RECV_LOCAL:
341 {
343 break;
344 }
345 }
346
347 const bool use_c_locale = (*fmt == '!');
348
349 if (which != RECV_LOCAL)
350 {
351 // The sender's time zone might only be available as a numerical offset, so "%Z" behaves like "%z".
352 for (char *bigz = fmt; (bigz = strstr(bigz, "%Z")); bigz += 2)
353 {
354 bigz[1] = 'z';
355 }
356 }
357
358 char out[128] = { 0 };
359 if (use_c_locale)
360 {
361 strftime_l(out, sizeof(out), fmt + 1, &tm, NeoMutt->time_c_locale);
362 }
363 else
364 {
365 strftime(out, sizeof(out), fmt, &tm);
366 }
367
368 FREE(&fmt);
369
370 if (flags & MUTT_FORMAT_INDEX)
372 buf_strcpy(buf, out);
373}
374
378static long email_attachment_count(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
379{
380 const struct EmailFormatInfo *efi = data;
381 struct Email *e = efi->email;
382 if (!e)
383 return 0;
384
385 struct Mailbox *m = efi->mailbox;
386
387 struct Message *msg = mx_msg_open(m, e);
388 if (!msg)
389 return 0;
390
391 const int num = mutt_count_body_parts(e, msg->fp);
392 mx_msg_close(m, &msg);
393 return num;
394}
395
399static void email_body_characters(const struct ExpandoNode *node, void *data,
400 MuttFormatFlags flags, struct Buffer *buf)
401{
402 const struct EmailFormatInfo *efi = (const struct EmailFormatInfo *) data;
403 const struct Email *e = efi->email;
404 if (!e)
405 return;
406
407 if (flags & MUTT_FORMAT_INDEX)
409
411}
412
416static void email_combined_flags(const struct ExpandoNode *node, void *data,
417 MuttFormatFlags flags, struct Buffer *buf)
418{
419 const struct EmailFormatInfo *efi = data;
420 struct Email *e = efi->email;
421 if (!e)
422 return;
423
424 const int msg_in_pager = efi->msg_in_pager;
425
426 const struct MbTable *c_crypt_chars = cs_subset_mbtable(NeoMutt->sub, "crypt_chars");
427 const struct MbTable *c_flag_chars = cs_subset_mbtable(NeoMutt->sub, "flag_chars");
428 const struct MbTable *c_to_chars = cs_subset_mbtable(NeoMutt->sub, "to_chars");
429 const bool threads = mutt_using_threads();
430
431 const char *first = NULL;
432 if (threads && thread_is_new(e))
433 {
434 first = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_NEW_THREAD);
435 }
436 else if (threads && thread_is_old(e))
437 {
438 first = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_OLD_THREAD);
439 }
440 else if (e->read && (msg_in_pager != e->msgno))
441 {
442 if (e->replied)
443 {
444 first = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_REPLIED);
445 }
446 else
447 {
448 first = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_ZEMPTY);
449 }
450 }
451 else
452 {
453 if (e->old)
454 {
455 first = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_OLD);
456 }
457 else
458 {
459 first = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_NEW);
460 }
461 }
462
463 /* Marked for deletion; deleted attachments; crypto */
464 const char *second = NULL;
465 if (e->deleted)
466 second = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_DELETED);
467 else if (e->attach_del)
468 second = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_DELETED_ATTACH);
469 else if ((WithCrypto != 0) && (e->security & SEC_GOODSIGN))
470 second = mbtable_get_nth_wchar(c_crypt_chars, FLAG_CHAR_CRYPT_GOOD_SIGN);
471 else if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT))
472 second = mbtable_get_nth_wchar(c_crypt_chars, FLAG_CHAR_CRYPT_ENCRYPTED);
473 else if ((WithCrypto != 0) && (e->security & SEC_SIGN))
474 second = mbtable_get_nth_wchar(c_crypt_chars, FLAG_CHAR_CRYPT_SIGNED);
475 else if (((WithCrypto & APPLICATION_PGP) != 0) && (e->security & PGP_KEY))
477 else
478 second = mbtable_get_nth_wchar(c_crypt_chars, FLAG_CHAR_CRYPT_NO_CRYPTO);
479
480 /* Tagged, flagged and recipient flag */
481 const char *third = NULL;
482 if (e->tagged)
483 third = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_TAGGED);
484 else if (e->flagged)
485 third = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_IMPORTANT);
486 else
487 third = mbtable_get_nth_wchar(c_to_chars, user_is_recipient(e));
488
489 if (flags & MUTT_FORMAT_INDEX)
491
492 buf_printf(buf, "%s%s%s", first, second, third);
493}
494
498static void email_crypto_flags(const struct ExpandoNode *node, void *data,
499 MuttFormatFlags flags, struct Buffer *buf)
500{
501 const struct EmailFormatInfo *efi = data;
502 const struct Email *e = efi->email;
503 if (!e)
504 return;
505
506 const struct MbTable *c_crypt_chars = cs_subset_mbtable(NeoMutt->sub, "crypt_chars");
507
508 const char *ch = NULL;
509 if ((WithCrypto != 0) && (e->security & SEC_GOODSIGN))
510 {
512 }
513 else if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT))
514 {
516 }
517 else if ((WithCrypto != 0) && (e->security & SEC_SIGN))
518 {
520 }
521 else if (((WithCrypto & APPLICATION_PGP) != 0) && ((e->security & PGP_KEY) == PGP_KEY))
522 {
524 }
525 else
526 {
528 }
529
530 if (flags & MUTT_FORMAT_INDEX)
532 buf_strcpy(buf, ch);
533}
534
538static void email_date_format(const struct ExpandoNode *node, void *data,
539 MuttFormatFlags flags, struct Buffer *buf)
540{
541 const struct EmailFormatInfo *efi = data;
542 const struct Email *e = efi->email;
543 if (!e)
544 return;
545
546 const char *c_date_format = cs_subset_string(NeoMutt->sub, "date_format");
547 const char *cp = NONULL(c_date_format);
548
549 index_email_date(node, e, SENT_SENDER, flags, buf, cp);
550}
551
555static void email_date_format_local(const struct ExpandoNode *node, void *data,
556 MuttFormatFlags flags, struct Buffer *buf)
557{
558 const struct EmailFormatInfo *efi = data;
559 const struct Email *e = efi->email;
560 if (!e)
561 return;
562
563 const char *c_date_format = cs_subset_string(NeoMutt->sub, "date_format");
564 const char *cp = NONULL(c_date_format);
565
566 index_email_date(node, e, SENT_LOCAL, flags, buf, cp);
567}
568
572static long email_date_format_local_num(const struct ExpandoNode *node,
573 void *data, MuttFormatFlags flags)
574{
575 const struct EmailFormatInfo *efi = data;
576 const struct Email *e = efi->email;
577 if (!e)
578 return 0;
579
580 return e->date_sent;
581}
582
586static long email_date_format_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
587{
588 const struct EmailFormatInfo *efi = data;
589 const struct Email *e = efi->email;
590 if (!e)
591 return 0;
592
593 return e->date_sent;
594}
595
599static void email_date_strf(const struct ExpandoNode *node, void *data,
600 MuttFormatFlags flags, struct Buffer *buf)
601{
602 const struct EmailFormatInfo *efi = data;
603 const struct Email *e = efi->email;
604 if (!e)
605 return;
606
607 index_email_date(node, e, SENT_SENDER, flags, buf, node->text);
608}
609
613static long email_date_strf_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
614{
615 const struct EmailFormatInfo *efi = data;
616 const struct Email *e = efi->email;
617 if (!e)
618 return 0;
619
620 return e->date_sent;
621}
622
626static void email_date_strf_local(const struct ExpandoNode *node, void *data,
627 MuttFormatFlags flags, struct Buffer *buf)
628{
629 const struct EmailFormatInfo *efi = data;
630 const struct Email *e = efi->email;
631 if (!e)
632 return;
633
634 index_email_date(node, e, SENT_LOCAL, flags, buf, node->text);
635}
636
640static long email_date_strf_local_num(const struct ExpandoNode *node,
641 void *data, MuttFormatFlags flags)
642{
643 const struct EmailFormatInfo *efi = data;
644 const struct Email *e = efi->email;
645 if (!e)
646 return 0;
647
648 return e->date_sent;
649}
650
654static void email_flag_chars(const struct ExpandoNode *node, void *data,
655 MuttFormatFlags flags, struct Buffer *buf)
656{
657 const struct EmailFormatInfo *efi = data;
658 const struct Email *e = efi->email;
659 if (!e)
660 return;
661
662 const struct MbTable *c_flag_chars = cs_subset_mbtable(NeoMutt->sub, "flag_chars");
663 const int msg_in_pager = efi->msg_in_pager;
664
665 const char *wch = NULL;
666 if (e->deleted)
667 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_DELETED);
668 else if (e->attach_del)
670 else if (e->tagged)
671 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_TAGGED);
672 else if (e->flagged)
673 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_IMPORTANT);
674 else if (e->replied)
675 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_REPLIED);
676 else if (e->read && (msg_in_pager != e->msgno))
677 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_SEMPTY);
678 else if (e->old)
679 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_OLD);
680 else
681 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_NEW);
682
683 if (flags & MUTT_FORMAT_INDEX)
685
686 buf_strcpy(buf, wch);
687}
688
692static void email_from_list(const struct ExpandoNode *node, void *data,
693 MuttFormatFlags flags, struct Buffer *buf)
694{
695 const struct EmailFormatInfo *efi = data;
696 const struct Email *e = efi->email;
697 if (!e)
698 return;
699
700 char tmp[128] = { 0 };
701
702 make_from(e->env, tmp, sizeof(tmp), true, flags);
703
704 if (flags & MUTT_FORMAT_INDEX)
706 buf_strcpy(buf, tmp);
707}
708
712static void email_index_hook(const struct ExpandoNode *node, void *data,
713 MuttFormatFlags flags, struct Buffer *buf)
714{
715 const struct EmailFormatInfo *efi = data;
716 struct Email *e = efi->email;
717 if (!e)
718 return;
719
720 struct Mailbox *m = efi->mailbox;
721
722 const struct Expando *exp = mutt_idxfmt_hook(node->text, m, e);
723 if (!exp)
724 return;
725
727 buf->dsize, NeoMutt->env, buf);
728}
729
733static long email_lines(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
734{
735 const struct EmailFormatInfo *efi = data;
736 const struct Email *e = efi->email;
737 if (!e)
738 return 0;
739
740 if (flags & MUTT_FORMAT_INDEX)
742
743 return e->lines;
744}
745
749static void email_list_or_save_folder(const struct ExpandoNode *node, void *data,
750 MuttFormatFlags flags, struct Buffer *buf)
751{
752 const struct EmailFormatInfo *efi = data;
753 const struct Email *e = efi->email;
754 if (!e || !e->env)
755 return;
756
757 char tmp[128] = { 0 };
758 char *p = NULL;
759
760 make_from_addr(e->env, tmp, sizeof(tmp), true);
761 const bool c_save_address = cs_subset_bool(NeoMutt->sub, "save_address");
762 if (!c_save_address && (p = strpbrk(tmp, "%@")))
763 {
764 *p = '\0';
765 }
766
767 buf_strcpy(buf, tmp);
768}
769
773static void email_message_flags(const struct ExpandoNode *node, void *data,
774 MuttFormatFlags flags, struct Buffer *buf)
775{
776 const struct EmailFormatInfo *efi = data;
777 struct Email *e = efi->email;
778 if (!e)
779 return;
780
781 const struct MbTable *c_flag_chars = cs_subset_mbtable(NeoMutt->sub, "flag_chars");
782 const struct MbTable *c_to_chars = cs_subset_mbtable(NeoMutt->sub, "to_chars");
783
784 const char *ch = NULL;
785 if (e->tagged)
786 {
787 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_TAGGED);
788 }
789 else if (e->flagged)
790 {
791 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_IMPORTANT);
792 }
793 else
794 {
795 ch = mbtable_get_nth_wchar(c_to_chars, user_is_recipient(e));
796 }
797
798 if (flags & MUTT_FORMAT_INDEX)
800 buf_strcpy(buf, ch);
801}
802
806static long email_number(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
807{
808 const struct EmailFormatInfo *efi = data;
809 const struct Email *e = efi->email;
810 if (!e)
811 return 0;
812
813 if (flags & MUTT_FORMAT_INDEX)
815
816 return e->msgno + 1;
817}
818
822static long email_score(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
823{
824 const struct EmailFormatInfo *efi = data;
825 const struct Email *e = efi->email;
826 if (!e)
827 return 0;
828
829 return e->score;
830}
831
835static void email_size(const struct ExpandoNode *node, void *data,
836 MuttFormatFlags flags, struct Buffer *buf)
837{
838 const struct EmailFormatInfo *efi = data;
839 const struct Email *e = efi->email;
840 if (!e)
841 return;
842
843 if (flags & MUTT_FORMAT_INDEX)
845
847}
848
852static long email_size_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
853{
854 const struct EmailFormatInfo *efi = data;
855 const struct Email *e = efi->email;
856 if (!e || !e->body)
857 return 0;
858
859 return e->body->length;
860}
861
865static void email_status_flags(const struct ExpandoNode *node, void *data,
866 MuttFormatFlags flags, struct Buffer *buf)
867{
868 const struct EmailFormatInfo *efi = data;
869 struct Email *e = efi->email;
870 if (!e)
871 return;
872
873 const bool threads = mutt_using_threads();
874 const struct MbTable *c_flag_chars = cs_subset_mbtable(NeoMutt->sub, "flag_chars");
875 const int msg_in_pager = efi->msg_in_pager;
876
877 const char *ch = NULL;
878 if (e->deleted)
879 {
880 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_DELETED);
881 }
882 else if (e->attach_del)
883 {
885 }
886 else if (threads && thread_is_new(e))
887 {
889 }
890 else if (threads && thread_is_old(e))
891 {
893 }
894 else if (e->read && (msg_in_pager != e->msgno))
895 {
896 if (e->replied)
897 {
898 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_REPLIED);
899 }
900 else
901 {
902 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_ZEMPTY);
903 }
904 }
905 else
906 {
907 if (e->old)
908 {
909 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_OLD);
910 }
911 else
912 {
913 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_NEW);
914 }
915 }
916
917 if (flags & MUTT_FORMAT_INDEX)
919 buf_strcpy(buf, ch);
920}
921
925static void email_strf_recv_local(const struct ExpandoNode *node, void *data,
926 MuttFormatFlags flags, struct Buffer *buf)
927{
928 const struct EmailFormatInfo *efi = data;
929 const struct Email *e = efi->email;
930 if (!e)
931 return;
932
933 index_email_date(node, e, RECV_LOCAL, flags, buf, node->text);
934}
935
939static long email_strf_recv_local_num(const struct ExpandoNode *node,
940 void *data, MuttFormatFlags flags)
941{
942 const struct EmailFormatInfo *efi = data;
943 const struct Email *e = efi->email;
944 if (!e)
945 return 0;
946
947 return e->received;
948}
949
953static void email_tags(const struct ExpandoNode *node, void *data,
954 MuttFormatFlags flags, struct Buffer *buf)
955{
956 const struct EmailFormatInfo *efi = data;
957 struct Email *e = efi->email;
958 if (!e)
959 return;
960
961 if (flags & MUTT_FORMAT_INDEX)
964}
965
969static void email_tags_transformed(const struct ExpandoNode *node, void *data,
970 MuttFormatFlags flags, struct Buffer *buf)
971{
972 const struct EmailFormatInfo *efi = data;
973 struct Email *e = efi->email;
974 if (!e)
975 return;
976
978 ASSERT(md);
979
980 char *tag = mutt_hash_find(md->tag_formats, node->text);
981 if (!tag)
982 return;
983
984 if (flags & MUTT_FORMAT_INDEX)
987}
988
992static long email_thread_count(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
993{
994 const struct EmailFormatInfo *efi = data;
995 struct Email *e = efi->email;
996 struct Mailbox *m = efi->mailbox;
997
999}
1000
1004static void email_thread_hidden_count(const struct ExpandoNode *node, void *data,
1005 MuttFormatFlags flags, struct Buffer *buf)
1006{
1007 const struct EmailFormatInfo *efi = data;
1008 const struct Email *e = efi->email;
1009 if (!e)
1010 return;
1011
1012 const bool threads = mutt_using_threads();
1013 const bool is_index = (flags & MUTT_FORMAT_INDEX) != 0;
1014
1015 if (threads && is_index && e->collapsed && (e->num_hidden > 1))
1016 {
1017 if (flags & MUTT_FORMAT_INDEX)
1019 const int num = e->num_hidden;
1020 buf_printf(buf, "%d", num);
1021 }
1022 else if (is_index && threads)
1023 {
1024 if (flags & MUTT_FORMAT_INDEX)
1026 const char *s = " ";
1027 buf_strcpy(buf, s);
1028 }
1029}
1030
1034static long email_thread_hidden_count_num(const struct ExpandoNode *node,
1035 void *data, MuttFormatFlags flags)
1036{
1037 const struct EmailFormatInfo *efi = data;
1038 const struct Email *e = efi->email;
1039 if (!e)
1040 return 0;
1041
1042 const bool threads = mutt_using_threads();
1043 const bool is_index = (flags & MUTT_FORMAT_INDEX) != 0;
1044
1045 if (threads && is_index && e->collapsed && (e->num_hidden > 1))
1046 {
1047 if (flags & MUTT_FORMAT_INDEX)
1049 return e->num_hidden;
1050 }
1051
1052 return 0;
1053}
1054
1058static long email_thread_number(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
1059{
1060 const struct EmailFormatInfo *efi = data;
1061 struct Email *e = efi->email;
1062 struct Mailbox *m = efi->mailbox;
1063
1065}
1066
1070static void email_thread_tags(const struct ExpandoNode *node, void *data,
1071 MuttFormatFlags flags, struct Buffer *buf)
1072{
1073 const struct EmailFormatInfo *efi = data;
1074 struct Email *e = efi->email;
1075 if (!e)
1076 return;
1077
1078 bool have_tags = true;
1079 struct Buffer *tags = buf_pool_get();
1081 if (!buf_is_empty(tags))
1082 {
1083 if (flags & MUTT_FORMAT_TREE)
1084 {
1085 struct Buffer *parent_tags = buf_pool_get();
1086 if (e->thread->prev && e->thread->prev->message)
1087 {
1088 driver_tags_get_transformed(&e->thread->prev->message->tags, parent_tags);
1089 }
1090 if (!parent_tags && e->thread->parent && e->thread->parent->message)
1091 {
1093 }
1094 if (parent_tags && buf_istr_equal(tags, parent_tags))
1095 have_tags = false;
1096 buf_pool_release(&parent_tags);
1097 }
1098 }
1099 else
1100 {
1101 have_tags = false;
1102 }
1103
1104 if (flags & MUTT_FORMAT_INDEX)
1106
1107 const char *s = have_tags ? buf_string(tags) : "";
1108 buf_strcpy(buf, s);
1109
1110 buf_pool_release(&tags);
1111}
1112
1116static void email_to_chars(const struct ExpandoNode *node, void *data,
1117 MuttFormatFlags flags, struct Buffer *buf)
1118{
1119 const struct EmailFormatInfo *efi = data;
1120 struct Email *e = efi->email;
1121 if (!e)
1122 return;
1123
1124 const struct MbTable *c_to_chars = cs_subset_mbtable(NeoMutt->sub, "to_chars");
1125
1126 int i;
1127 const char *s = (c_to_chars && ((i = user_is_recipient(e))) < c_to_chars->len) ?
1128 c_to_chars->chars[i] :
1129 " ";
1130
1131 buf_strcpy(buf, s);
1132}
1133
1137static void envelope_cc_all(const struct ExpandoNode *node, void *data,
1138 MuttFormatFlags flags, struct Buffer *buf)
1139{
1140 const struct EmailFormatInfo *efi = data;
1141 const struct Email *e = efi->email;
1142 if (!e || !e->env)
1143 return;
1144
1145 mutt_addrlist_write(&e->env->cc, buf, true);
1146}
1147
1151static void envelope_first_name(const struct ExpandoNode *node, void *data,
1152 MuttFormatFlags flags, struct Buffer *buf)
1153{
1154 const struct EmailFormatInfo *efi = data;
1155 const struct Email *e = efi->email;
1156 if (!e || !e->env)
1157 return;
1158
1159 const struct Address *from = TAILQ_FIRST(&e->env->from);
1160 const struct Address *to = TAILQ_FIRST(&e->env->to);
1161 const struct Address *cc = TAILQ_FIRST(&e->env->cc);
1162
1163 char tmp[128] = { 0 };
1164 char *p = NULL;
1165
1166 if (mutt_addr_is_user(from))
1167 {
1168 if (to)
1169 {
1170 const char *s = mutt_get_name(to);
1171 mutt_str_copy(tmp, NONULL(s), sizeof(tmp));
1172 }
1173 else if (cc)
1174 {
1175 const char *s = mutt_get_name(cc);
1176 mutt_str_copy(tmp, NONULL(s), sizeof(tmp));
1177 }
1178 }
1179 else
1180 {
1181 const char *s = mutt_get_name(from);
1182 mutt_str_copy(tmp, NONULL(s), sizeof(tmp));
1183 }
1184 p = strpbrk(tmp, " %@");
1185 if (p)
1186 {
1187 *p = '\0';
1188 }
1189
1190 buf_strcpy(buf, tmp);
1191}
1192
1196static void envelope_from(const struct ExpandoNode *node, void *data,
1197 MuttFormatFlags flags, struct Buffer *buf)
1198{
1199 const struct EmailFormatInfo *efi = data;
1200 const struct Email *e = efi->email;
1201 if (!e || !e->env)
1202 return;
1203
1204 const struct Address *from = TAILQ_FIRST(&e->env->from);
1205
1206 const char *s = NULL;
1207 if (from && from->mailbox)
1208 {
1209 s = mutt_addr_for_display(from);
1210 }
1211
1212 if (flags & MUTT_FORMAT_INDEX)
1214 buf_strcpy(buf, s);
1215}
1216
1220static void envelope_from_full(const struct ExpandoNode *node, void *data,
1221 MuttFormatFlags flags, struct Buffer *buf)
1222{
1223 const struct EmailFormatInfo *efi = data;
1224 struct Email *e = efi->email;
1225 if (!e || !e->env)
1226 return;
1227
1228 mutt_addrlist_write(&e->env->from, buf, true);
1229}
1230
1234static void envelope_initials(const struct ExpandoNode *node, void *data,
1235 MuttFormatFlags flags, struct Buffer *buf)
1236{
1237 const struct EmailFormatInfo *efi = data;
1238 const struct Email *e = efi->email;
1239 if (!e || !e->env)
1240 return;
1241
1242 const struct Address *from = TAILQ_FIRST(&e->env->from);
1243
1244 char tmp[128] = { 0 };
1245
1246 if (mutt_mb_get_initials(mutt_get_name(from), tmp, sizeof(tmp)))
1247 {
1248 if (flags & MUTT_FORMAT_INDEX)
1250
1251 buf_strcpy(buf, tmp);
1252 return;
1253 }
1254
1255 envelope_from(node, data, flags, buf);
1256}
1257
1261static void envelope_list_address(const struct ExpandoNode *node, void *data,
1262 MuttFormatFlags flags, struct Buffer *buf)
1263{
1264 const struct EmailFormatInfo *efi = data;
1265 const struct Email *e = efi->email;
1266 if (!e || !e->env)
1267 return;
1268
1269 if (first_mailing_list(&e->env->to, buf) || first_mailing_list(&e->env->cc, buf))
1270 return;
1271
1272 mailbox_mailbox_name(node, data, flags, buf);
1273}
1274
1278static void envelope_list_empty(const struct ExpandoNode *node, void *data,
1279 MuttFormatFlags flags, struct Buffer *buf)
1280{
1281 const struct EmailFormatInfo *efi = data;
1282 const struct Email *e = efi->email;
1283 if (!e || !e->env)
1284 return;
1285
1286 if (!first_mailing_list(&e->env->to, buf))
1287 first_mailing_list(&e->env->cc, buf);
1288}
1289
1293static void envelope_message_id(const struct ExpandoNode *node, void *data,
1294 MuttFormatFlags flags, struct Buffer *buf)
1295{
1296 const struct EmailFormatInfo *efi = data;
1297 struct Email *e = efi->email;
1298 if (!e || !e->env)
1299 return;
1300
1301 const char *s = e->env->message_id ? e->env->message_id : "<no.id>";
1302 buf_strcpy(buf, s);
1303}
1304
1308static void envelope_name(const struct ExpandoNode *node, void *data,
1309 MuttFormatFlags flags, struct Buffer *buf)
1310{
1311 const struct EmailFormatInfo *efi = data;
1312 const struct Email *e = efi->email;
1313 if (!e || !e->env)
1314 return;
1315
1316 const struct Address *from = TAILQ_FIRST(&e->env->from);
1317
1318 if (flags & MUTT_FORMAT_INDEX)
1320
1321 const char *s = mutt_get_name(from);
1322 buf_strcpy(buf, s);
1323}
1324
1328static void envelope_newsgroup(const struct ExpandoNode *node, void *data,
1329 MuttFormatFlags flags, struct Buffer *buf)
1330{
1331 const struct EmailFormatInfo *efi = data;
1332 const struct Email *e = efi->email;
1333 if (!e || !e->env)
1334 return;
1335
1336 const char *s = e->env->newsgroups;
1337 buf_strcpy(buf, s);
1338}
1339
1343static void envelope_organization(const struct ExpandoNode *node, void *data,
1344 MuttFormatFlags flags, struct Buffer *buf)
1345{
1346 const struct EmailFormatInfo *efi = data;
1347 const struct Email *e = efi->email;
1348 if (!e || !e->env)
1349 return;
1350
1351 const char *s = e->env->organization;
1352 buf_strcpy(buf, s);
1353}
1354
1358static void envelope_reply_to(const struct ExpandoNode *node, void *data,
1359 MuttFormatFlags flags, struct Buffer *buf)
1360{
1361 const struct EmailFormatInfo *efi = data;
1362 const struct Email *e = efi->email;
1363 if (!e || !e->env)
1364 return;
1365
1366 const struct Address *reply_to = TAILQ_FIRST(&e->env->reply_to);
1367
1368 if (reply_to && reply_to->mailbox)
1369 {
1370 if (flags & MUTT_FORMAT_INDEX)
1372 const char *s = mutt_addr_for_display(reply_to);
1373 buf_strcpy(buf, s);
1374 return;
1375 }
1376
1377 envelope_from(node, data, flags, buf);
1378}
1379
1383static void envelope_sender(const struct ExpandoNode *node, void *data,
1384 MuttFormatFlags flags, struct Buffer *buf)
1385{
1386 const struct EmailFormatInfo *efi = data;
1387 struct Email *e = efi->email;
1388 if (!e || !e->env)
1389 return;
1390
1391 char tmp[128] = { 0 };
1392
1393 make_from(e->env, tmp, sizeof(tmp), false, MUTT_FORMAT_NO_FLAGS);
1394
1395 if (flags & MUTT_FORMAT_INDEX)
1397
1398 buf_strcpy(buf, tmp);
1399}
1400
1404static void envelope_sender_plain(const struct ExpandoNode *node, void *data,
1405 MuttFormatFlags flags, struct Buffer *buf)
1406{
1407 const struct EmailFormatInfo *efi = (const struct EmailFormatInfo *) data;
1408 struct Email *e = efi->email;
1409 if (!e || !e->env)
1410 return;
1411
1412 char tmp[128] = { 0 };
1413
1414 if (flags & MUTT_FORMAT_INDEX)
1416
1417 make_from(e->env, tmp, sizeof(tmp), false, MUTT_FORMAT_PLAIN);
1418
1419 buf_strcpy(buf, tmp);
1420}
1421
1425static void envelope_spam(const struct ExpandoNode *node, void *data,
1426 MuttFormatFlags flags, struct Buffer *buf)
1427{
1428 const struct EmailFormatInfo *efi = data;
1429 struct Email *e = efi->email;
1430 if (!e || !e->env)
1431 return;
1432
1433 buf_copy(buf, &e->env->spam);
1434}
1435
1439static void envelope_subject(const struct ExpandoNode *node, void *data,
1440 MuttFormatFlags flags, struct Buffer *buf)
1441{
1442 const struct EmailFormatInfo *efi = data;
1443 const struct Email *e = efi->email;
1444 if (!e || !e->env)
1445 return;
1446
1447 if ((flags & MUTT_FORMAT_TREE) && !e->collapsed && !(flags & MUTT_FORMAT_FORCESUBJ))
1448 return;
1449
1450 if (flags & MUTT_FORMAT_INDEX)
1452
1454
1455 if (e->env->disp_subj)
1456 buf_strcpy(buf, e->env->disp_subj);
1457 else
1458 buf_strcpy(buf, e->env->subject);
1459}
1460
1464static void envelope_thread_tree(const struct ExpandoNode *node, void *data,
1465 MuttFormatFlags flags, struct Buffer *buf)
1466{
1467 const struct EmailFormatInfo *efi = data;
1468 const struct Email *e = efi->email;
1469 if (!e || !e->env)
1470 return;
1471
1472 if (!(flags & MUTT_FORMAT_TREE) || e->collapsed)
1473 return;
1474
1476 node_expando_set_has_tree(node, true);
1477 buf_strcpy(buf, e->tree);
1478}
1479
1483static void envelope_thread_x_label(const struct ExpandoNode *node, void *data,
1484 MuttFormatFlags flags, struct Buffer *buf)
1485{
1486 const struct EmailFormatInfo *efi = data;
1487 const struct Email *e = efi->email;
1488 if (!e || !e->env)
1489 return;
1490
1491 bool label = true;
1492 if (e->env->x_label)
1493 {
1494 struct Email *e_tmp = NULL;
1495 if (flags & MUTT_FORMAT_TREE && (e->thread->prev && e->thread->prev->message &&
1496 e->thread->prev->message->env->x_label))
1497 {
1498 e_tmp = e->thread->prev->message;
1499 }
1500 else if (flags & MUTT_FORMAT_TREE && (e->thread->parent && e->thread->parent->message &&
1502 {
1503 e_tmp = e->thread->parent->message;
1504 }
1505
1506 if (e_tmp && mutt_istr_equal(e->env->x_label, e_tmp->env->x_label))
1507 {
1508 label = false;
1509 }
1510 }
1511 else
1512 {
1513 label = false;
1514 }
1515
1516 if (flags & MUTT_FORMAT_INDEX)
1518
1519 if (label)
1520 {
1521 const char *s = e->env->x_label;
1522 buf_strcpy(buf, s);
1523 }
1524}
1525
1529static void envelope_to(const struct ExpandoNode *node, void *data,
1530 MuttFormatFlags flags, struct Buffer *buf)
1531{
1532 const struct EmailFormatInfo *efi = data;
1533 const struct Email *e = efi->email;
1534 if (!e || !e->env)
1535 return;
1536
1537 const struct Address *to = TAILQ_FIRST(&e->env->to);
1538 const struct Address *cc = TAILQ_FIRST(&e->env->cc);
1539
1540 char tmp[128] = { 0 };
1541
1542 if (!check_for_mailing_list(&e->env->to, "To ", tmp, sizeof(tmp)) &&
1543 !check_for_mailing_list(&e->env->cc, "Cc ", tmp, sizeof(tmp)))
1544 {
1545 if (to)
1546 snprintf(tmp, sizeof(tmp), "To %s", mutt_get_name(to));
1547 else if (cc)
1548 snprintf(tmp, sizeof(tmp), "Cc %s", mutt_get_name(cc));
1549 else
1550 {
1551 tmp[0] = '\0';
1552 }
1553 }
1554
1555 buf_strcpy(buf, tmp);
1556}
1557
1561static void envelope_to_all(const struct ExpandoNode *node, void *data,
1562 MuttFormatFlags flags, struct Buffer *buf)
1563{
1564 const struct EmailFormatInfo *efi = data;
1565 const struct Email *e = efi->email;
1566 if (!e || !e->env)
1567 return;
1568
1569 mutt_addrlist_write(&e->env->to, buf, true);
1570}
1571
1575static void envelope_username(const struct ExpandoNode *node, void *data,
1576 MuttFormatFlags flags, struct Buffer *buf)
1577{
1578 const struct EmailFormatInfo *efi = data;
1579 const struct Email *e = efi->email;
1580 if (!e || !e->env)
1581 return;
1582
1583 const struct Address *from = TAILQ_FIRST(&e->env->from);
1584 if (!from || !from->mailbox)
1585 return;
1586
1587 char tmp[128] = { 0 };
1588 char *p = NULL;
1589
1590 mutt_str_copy(tmp, mutt_addr_for_display(from), sizeof(tmp));
1591 p = strpbrk(tmp, "%@");
1592 if (p)
1593 {
1594 *p = '\0';
1595 }
1596
1597 buf_strcpy(buf, tmp);
1598}
1599
1603static void envelope_x_comment_to(const struct ExpandoNode *node, void *data,
1604 MuttFormatFlags flags, struct Buffer *buf)
1605{
1606 const struct EmailFormatInfo *efi = data;
1607 const struct Email *e = efi->email;
1608 if (!e || !e->env)
1609 return;
1610
1611 const char *s = e->env->x_comment_to;
1612 buf_strcpy(buf, s);
1613}
1614
1618static void envelope_x_label(const struct ExpandoNode *node, void *data,
1619 MuttFormatFlags flags, struct Buffer *buf)
1620{
1621 const struct EmailFormatInfo *efi = data;
1622 const struct Email *e = efi->email;
1623 if (!e || !e->env)
1624 return;
1625
1626 if (flags & MUTT_FORMAT_INDEX)
1628
1629 const char *s = e->env->x_label;
1630 buf_strcpy(buf, s);
1631}
1632
1636static void mailbox_mailbox_name(const struct ExpandoNode *node, void *data,
1637 MuttFormatFlags flags, struct Buffer *buf)
1638{
1639 const struct EmailFormatInfo *efi = data;
1640 struct Mailbox *m = efi->mailbox;
1641 if (!m)
1642 {
1643 buf_addstr(buf, "(null)");
1644 return;
1645 }
1646
1647 char *p = NULL;
1648
1649#ifdef USE_NOTMUCH
1650 struct Email *e = efi->email;
1651 if (m->type == MUTT_NOTMUCH)
1652 {
1654 }
1655#endif
1656 if (!p)
1657 {
1658 p = strrchr(mailbox_path(m), '/');
1659 if (p)
1660 {
1661 p++;
1662 }
1663 }
1664 buf_addstr(buf, p ? p : mailbox_path(m));
1665}
1666
1670static long mailbox_message_count(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
1671{
1672 const struct EmailFormatInfo *efi = data;
1673 const struct Mailbox *m = efi->mailbox;
1674
1675 if (m)
1676 return m->msg_count;
1677
1678 return 0;
1679}
1680
1684static void mailbox_percentage(const struct ExpandoNode *node, void *data,
1685 MuttFormatFlags flags, struct Buffer *buf)
1686{
1687 const struct EmailFormatInfo *efi = data;
1688
1689 const char *s = efi->pager_progress;
1690 buf_strcpy(buf, s);
1691}
1692
1699 // clang-format off
1711 { ED_EMAIL, ED_EMA_LINES, NULL, email_lines },
1715 { ED_EMAIL, ED_EMA_SCORE, NULL, email_score },
1719 { ED_EMAIL, ED_EMA_TAGS, email_tags, NULL },
1744 { ED_ENVELOPE, ED_ENV_TO, envelope_to, NULL },
1752 { -1, -1, NULL, NULL },
1753 // clang-format on
1754};
size_t mutt_addrlist_write(const struct AddressList *al, struct Buffer *buf, bool display)
Write an Address to a buffer.
Definition address.c:1206
const char * mutt_addr_for_display(const struct Address *a)
Convert an Address for display purposes.
Definition address.c:1012
Email Address Handling.
Email Aliases.
bool mutt_addr_is_user(const struct Address *addr)
Does the address belong to the user.
Definition alias.c:600
int mutt_count_body_parts(struct Email *e, FILE *fp)
Count the MIME Body parts.
Definition commands.c:222
GUI display the mailboxes in a side panel.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition buffer.c:161
bool buf_istr_equal(const struct Buffer *a, const struct Buffer *b)
Return if two buffers are equal, case insensitive.
Definition buffer.c:695
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition buffer.c:291
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition buffer.c:226
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
size_t buf_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
Definition buffer.c:601
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
Color and attribute parsing.
@ MT_COLOR_INDEX_AUTHOR
Index: author field.
Definition color.h:87
@ MT_COLOR_INDEX_SIZE
Index: size field.
Definition color.h:93
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
Definition color.h:96
@ MT_COLOR_INDEX_SUBJECT
Index: subject field.
Definition color.h:94
@ MT_COLOR_INDEX_DATE
Index: date field.
Definition color.h:89
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
Definition color.h:95
@ MT_COLOR_TREE
Index: tree-drawing characters.
Definition color.h:82
@ MT_COLOR_INDEX_LABEL
Index: label field.
Definition color.h:91
@ MT_COLOR_INDEX_NUMBER
Index: index number.
Definition color.h:92
@ MT_COLOR_INDEX_FLAGS
Index: flags field.
Definition color.h:90
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
Definition color.h:88
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition helpers.c:291
struct MbTable * cs_subset_mbtable(const struct ConfigSubset *sub, const char *name)
Get a Multibyte table config item by name.
Definition helpers.c:119
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
@ ED_MBX_MESSAGE_COUNT
Mailbox.msg_count.
Definition mailbox.h:158
@ ED_MBX_PERCENTAGE
EmailFormatInfo.pager_progress.
Definition mailbox.h:159
@ ED_MBX_MAILBOX_NAME
Mailbox, mailbox_path()
Definition mailbox.h:157
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition mailbox.h:213
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition mailbox.h:50
@ ED_ENVELOPE
Envelope ED_ENV_ ExpandoDataEnvelope.
Definition domain.h:42
@ ED_EMAIL
Email ED_EMA_ ExpandoDataEmail.
Definition domain.h:41
@ ED_MAILBOX
Mailbox ED_MBX_ ExpandoDataMailbox.
Definition domain.h:47
size_t email_get_size(const struct Email *e)
Compute the size of an email.
Definition email.c:121
Structs that make up an email.
const char * mutt_get_name(const struct Address *a)
Pick the best name to display from an address.
Definition sort.c:138
@ ED_EMA_DATE_STRF_LOCAL
Email.date_sent.
Definition email.h:143
@ ED_EMA_ATTACHMENT_COUNT
Email, mutt_count_body_parts()
Definition email.h:136
@ ED_EMA_DATE_FORMAT_LOCAL
Email.date_sent.
Definition email.h:141
@ ED_EMA_TAGS_TRANSFORMED
Email.tags, driver_tags_get_transformed()
Definition email.h:156
@ ED_EMA_THREAD_HIDDEN_COUNT
Email.collapsed, Email.num_hidden, ...
Definition email.h:158
@ ED_EMA_DATE_FORMAT
Email.date_sent.
Definition email.h:140
@ ED_EMA_THREAD_TAGS
Email.tags.
Definition email.h:160
@ ED_EMA_TAGS
Email.tags.
Definition email.h:155
@ ED_EMA_SIZE
Body.length.
Definition email.h:152
@ ED_EMA_FLAG_CHARS
Email.deleted, Email.attach_del, ...
Definition email.h:144
@ ED_EMA_THREAD_NUMBER
Email, mutt_messages_in_thread()
Definition email.h:159
@ ED_EMA_TO_CHARS
Email, User_is_recipient()
Definition email.h:161
@ ED_EMA_BODY_CHARACTERS
Body.length.
Definition email.h:137
@ ED_EMA_COMBINED_FLAGS
Email.read, Email.old, thread_is_new(), ...
Definition email.h:138
@ ED_EMA_THREAD_COUNT
Email, mutt_messages_in_thread()
Definition email.h:157
@ ED_EMA_STATUS_FLAGS
Email.deleted, Email.attach_del, ...
Definition email.h:153
@ ED_EMA_NUMBER
Email.msgno.
Definition email.h:150
@ ED_EMA_DATE_STRF
Email.date_sent, Email.zhours, Email.zminutes, Email.zoccident.
Definition email.h:142
@ ED_EMA_FROM_LIST
Envelope.to, Envelope.cc.
Definition email.h:145
@ ED_EMA_SCORE
Email.score.
Definition email.h:151
@ ED_EMA_CRYPTO_FLAGS
Email.security, SecurityFlags.
Definition email.h:139
@ ED_EMA_STRF_RECV_LOCAL
Email.received.
Definition email.h:154
@ ED_EMA_LIST_OR_SAVE_FOLDER
Envelope.to, Envelope.cc, check_for_mailing_list()
Definition email.h:148
@ ED_EMA_INDEX_HOOK
Mailbox, Email, mutt_idxfmt_hook()
Definition email.h:146
@ ED_EMA_LINES
Email.lines.
Definition email.h:147
@ ED_EMA_MESSAGE_FLAGS
Email.tagged, Email.flagged.
Definition email.h:149
@ ED_ENV_SUBJECT
Envelope.subject, Envelope.disp_subj.
Definition envelope.h:116
@ ED_ENV_NEWSGROUP
Envelope.newsgroups.
Definition envelope.h:109
@ ED_ENV_INITIALS
Envelope.from (first)
Definition envelope.h:104
@ ED_ENV_FROM_FULL
Envelope.from (all)
Definition envelope.h:103
@ ED_ENV_X_COMMENT_TO
Envelope.x_comment_to.
Definition envelope.h:123
@ ED_ENV_FROM
Envelope.from (first)
Definition envelope.h:102
@ ED_ENV_LIST_ADDRESS
Envelope.to, Envelope.cc.
Definition envelope.h:105
@ ED_ENV_SPAM
Envelope.spam.
Definition envelope.h:115
@ ED_ENV_SENDER
Envelope, make_from()
Definition envelope.h:113
@ ED_ENV_TO_ALL
Envelope.to (all)
Definition envelope.h:120
@ ED_ENV_X_LABEL
Envelope.x_label.
Definition envelope.h:124
@ ED_ENV_NAME
Envelope.from (first)
Definition envelope.h:108
@ ED_ENV_CC_ALL
Envelope.cc.
Definition envelope.h:100
@ ED_ENV_ORGANIZATION
Envelope.organization.
Definition envelope.h:110
@ ED_ENV_REPLY_TO
Envelope.reply_to.
Definition envelope.h:112
@ ED_ENV_LIST_EMPTY
Envelope.to, Envelope.cc.
Definition envelope.h:106
@ ED_ENV_THREAD_X_LABEL
Envelope.x_label.
Definition envelope.h:118
@ ED_ENV_MESSAGE_ID
Envelope.message_id.
Definition envelope.h:107
@ ED_ENV_SENDER_PLAIN
Envelope, make_from()
Definition envelope.h:114
@ ED_ENV_USERNAME
Envelope.from.
Definition envelope.h:121
@ ED_ENV_THREAD_TREE
Email.tree.
Definition envelope.h:117
@ ED_ENV_TO
Envelope.to, Envelope.cc (first)
Definition envelope.h:119
@ ED_ENV_FIRST_NAME
Envelope.from, Envelope.to, Envelope.cc.
Definition envelope.h:101
int expando_filter(const struct Expando *exp, const struct ExpandoRenderCallback *erc, void *data, MuttFormatFlags flags, int max_cols, char **env_list, struct Buffer *buf)
Render an Expando and run the result through a filter.
Definition filter.c:138
Parse Expando string.
static const char * make_from_prefix(enum FieldType disp)
Create a prefix for an author field.
static void make_from_addr(struct Envelope *env, char *buf, size_t buflen, bool do_lists)
Create a 'from' address for a reply email.
const struct ExpandoRenderCallback IndexRenderCallbacks[]
Callbacks for Index Expandos.
static void index_email_date(const struct ExpandoNode *node, const struct Email *e, enum IndexDateChoice which, MuttFormatFlags flags, struct Buffer *buf, const char *format)
Index: Sent/Received Local/Sender date and time.
FieldType
Header types.
@ DISP_PLAIN
Empty string.
@ DISP_TO
To: string.
@ DISP_CC
Cc: string.
@ DISP_BCC
Bcc: string.
@ DISP_MAX
@ DISP_FROM
From: string.
static bool thread_is_old(struct Email *e)
Does the email thread contain any unread emails?
static enum ToChars user_is_recipient(struct Email *e)
Is the user a recipient of the message.
IndexDateChoice
Which email date to display in the Index.
@ SENT_LOCAL
Date sent in the local timezone.
@ RECV_LOCAL
Date received in the local timezone.
@ SENT_SENDER
Date sent in the sender's timezone.
static void make_from(struct Envelope *env, char *buf, size_t buflen, bool do_lists, MuttFormatFlags flags)
Generate a From: field (with optional prefix)
static bool thread_is_new(struct Email *e)
Does the email thread contain any new emails?
static bool user_in_addr(struct AddressList *al)
Do any of the addresses refer to the user?
String processing routines to generate the mail index.
ToChars
Index into the $to_chars config variable.
@ FLAG_CHAR_TO_ORIGINATOR
Character denoting that the user is originator.
@ FLAG_CHAR_TO_UNIQUE
Character denoting that the user is unique recipient.
@ FLAG_CHAR_TO_NOT_IN_THE_LIST
Character denoting that the user is not in list.
@ FLAG_CHAR_TO_TO
Character denoting that the user is in the TO list.
@ FLAG_CHAR_TO_CC
Character denoting that the user is in the CC list.
@ FLAG_CHAR_TO_REPLY_TO
Character denoting that the user is in the Reply-To list.
@ FLAG_CHAR_TO_SUBSCRIBED_LIST
Character denoting that the message is sent to a subscribed mailing list.
@ FLAG_CHAR_CRYPT_CONTAINS_KEY
Character denoting a message contains a PGP key.
@ FLAG_CHAR_CRYPT_SIGNED
Character denoting a message is signed.
@ FLAG_CHAR_CRYPT_NO_CRYPTO
Character denoting a message has no cryptography information.
@ FLAG_CHAR_CRYPT_GOOD_SIGN
Character denoting a message signed with a verified key.
@ FLAG_CHAR_CRYPT_ENCRYPTED
Character denoting a message is PGP-encrypted.
@ FLAG_CHAR_OLD
Character denoting an email that has been read.
@ FLAG_CHAR_REPLIED
Character denoting an email that has been replied to.
@ FLAG_CHAR_OLD_THREAD
Character denoting a thread of emails that has been read.
@ FLAG_CHAR_ZEMPTY
Character denoting a read email, $index_format Z expando.
@ FLAG_CHAR_TAGGED
Character denoting a tagged email.
@ FLAG_CHAR_NEW
Character denoting an unread email.
@ FLAG_CHAR_DELETED
Character denoting a deleted email.
@ FLAG_CHAR_NEW_THREAD
Character denoting a thread containing at least one new email.
@ FLAG_CHAR_DELETED_ATTACH
Character denoting a deleted attachment.
@ FLAG_CHAR_SEMPTY
Character denoting a read email, $index_format S expando.
@ FLAG_CHAR_IMPORTANT
Character denoting a important (flagged) email.
static long email_date_strf_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Sender's date and time - Implements get_number_t -.
static long email_lines(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Number of lines - Implements get_number_t -.
static long mailbox_message_count(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Total number of message - Implements get_number_t -.
static long email_attachment_count(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Number of MIME attachments - Implements get_number_t -.
static long email_size_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Number of bytes - Implements get_number_t -.
static long email_date_strf_local_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Local date and time - Implements get_number_t -.
static long email_strf_recv_local_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Local received date and time - Implements get_number_t -.
static long email_number(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Index number - Implements get_number_t -.
static long email_thread_hidden_count_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Number of hidden messages - Implements get_number_t -.
static long email_date_format_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Senders Date and time - Implements get_number_t -.
static long email_score(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Message score - Implements get_number_t -.
static long email_date_format_local_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Local Date and time - Implements get_number_t -.
static long email_thread_count(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Number of messages thread - Implements get_number_t -.
static long email_thread_number(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
Index: Thread index number - Implements get_number_t -.
static void email_tags_transformed(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Individual tag - Implements get_string_t -.
static void email_crypto_flags(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Message crypto flags - Implements get_string_t -.
static void envelope_to(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: To field - Implements get_string_t -.
static void email_date_format(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Sent date and time - Implements get_string_t -.
static void email_flag_chars(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Status flag - Implements get_string_t -.
static void envelope_x_comment_to(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: X-Comment-To - Implements get_string_t -.
static void envelope_reply_to(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Reply-to address - Implements get_string_t -.
static void email_thread_tags(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Tags - Implements get_string_t -.
static void envelope_sender(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Author name - Implements get_string_t -.
static void envelope_x_label(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: X-Label - Implements get_string_t -.
static void envelope_message_id(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Message-id - Implements get_string_t -.
static void envelope_from(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Author Address - Implements get_string_t -.
static void envelope_to_all(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: To recipients - Implements get_string_t -.
static void email_message_flags(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Message tag flags - Implements get_string_t -.
static void mailbox_mailbox_name(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Mailbox Name - Implements get_string_t -.
static void email_date_strf_local(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Sent local date and time - Implements get_string_t -.
static void envelope_sender_plain(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Plain author name - Implements get_string_t -.
static void envelope_first_name(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: First name - Implements get_string_t -.
static void email_tags(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Message tags - Implements get_string_t -.
static void mailbox_percentage(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Progress indicator - Implements get_string_t -.
static void envelope_name(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Author's real name - Implements get_string_t -.
static void envelope_thread_tree(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Thread tree - Implements get_string_t -.
static void envelope_list_address(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Mailing List - Implements get_string_t -.
static void envelope_initials(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Initials of author - Implements get_string_t -.
static void email_from_list(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: List address - Implements get_string_t -.
static void envelope_thread_x_label(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: X-Label (if different) - Implements get_string_t -.
static void envelope_newsgroup(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Newsgroup name - Implements get_string_t -.
static void email_thread_hidden_count(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Number of hidden messages - Implements get_string_t -.
static void email_date_strf(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Sent date and time - Implements get_string_t -.
static void email_date_format_local(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Sent local date and time - Implements get_string_t -.
static void envelope_from_full(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Sender - Implements get_string_t -.
static void email_strf_recv_local(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Received local date and time - Implements get_string_t -.
static void envelope_spam(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Spam attributes - Implements get_string_t -.
static void email_index_hook(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: index-format-hook - Implements get_string_t -.
static void email_combined_flags(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Status flags - Implements get_string_t -.
static void email_size(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Number of bytes - Implements get_string_t -.
static void email_body_characters(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Number of raw bytes - Implements get_string_t -.
static void envelope_username(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: User name - Implements get_string_t -.
static void envelope_list_empty(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Mailing list - Implements get_string_t -.
static void email_status_flags(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Message status flags - Implements get_string_t -.
static void envelope_subject(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Subject - Implements get_string_t -.
static void email_to_chars(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: $to_chars flag - Implements get_string_t -.
static void email_list_or_save_folder(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: List Name or Save folder - Implements get_string_t -.
static void envelope_organization(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Organization - Implements get_string_t -.
static void envelope_cc_all(const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf)
Index: Cc recipients - Implements get_string_t -.
Convenience wrapper for the gui headers.
int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, enum MessageInThread mit)
Count the messages in a thread.
Definition thread.c:1655
#define mutt_using_threads()
Definition thread.h:113
@ MIT_NUM_MESSAGES
How many messages are in the thread.
Definition thread.h:88
@ MIT_POSITION
Our position in the thread.
Definition thread.h:89
#define mutt_thread_contains_unread(e)
Definition thread.h:108
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:364
const struct Expando * mutt_idxfmt_hook(const char *name, struct Mailbox *m, struct Email *e)
Get index-format-hook format string.
Definition exec.c:434
Hook Commands.
Private Index Functions.
bool check_for_mailing_list(struct AddressList *al, const char *pfx, char *buf, int buflen)
Search list of addresses for a mailing list.
Definition maillist.c:85
bool check_for_mailing_list_addr(struct AddressList *al, char *buf, int buflen)
Check an address list for a mailing list.
Definition maillist.c:109
bool first_mailing_list(struct AddressList *al, struct Buffer *buf)
Get the first mailing list in the list of addresses.
Definition maillist.c:130
const char * mbtable_get_nth_wchar(const struct MbTable *table, int index)
Extract one char from a multi-byte table.
Definition mbtable.c:340
bool mutt_mb_get_initials(const char *name, char *buf, size_t buflen)
Turn a name into initials.
Definition mbyte.c:83
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
@ MODULE_ID_EMAIL
ModuleEmail, Email code
Definition module_api.h:64
struct tm mutt_date_localtime(time_t t)
Converts calendar time to a broken-down time structure expressed in user timezone.
Definition date.c:907
struct tm mutt_date_gmtime(time_t t)
Converts calendar time to a broken-down time structure expressed in UTC timezone.
Definition date.c:928
Convenience wrapper for the library headers.
#define FALLTHROUGH
Definition lib.h:117
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition string.c:674
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition string.c:257
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition string.c:500
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition string.c:583
int mutt_str_pretty_size(struct Buffer *buf, size_t num)
Display an abbreviated size, like 3.4K.
Definition muttlib.c:934
Some miscellaneous functions.
int mx_msg_close(struct Mailbox *m, struct Message **ptr)
Close a message.
Definition mx.c:1182
struct Message * mx_msg_open(struct Mailbox *m, struct Email *e)
Return a stream pointer for a message.
Definition mx.c:1136
API for mailboxes.
API for encryption/signing of emails.
#define SEC_GOODSIGN
Email has a valid signature.
Definition lib.h:88
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition lib.h:98
#define SEC_ENCRYPT
Email is encrypted.
Definition lib.h:86
#define PGP_KEY
Email contains a PGP key.
Definition lib.h:107
#define WithCrypto
Definition lib.h:124
#define SEC_SIGN
Email is signed.
Definition lib.h:87
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:582
void node_expando_set_color(const struct ExpandoNode *node, int cid)
Set the colour for an Expando.
void node_expando_set_has_tree(const struct ExpandoNode *node, bool has_tree)
Set the has_tree flag for an Expando.
Notmuch virtual mailbox type.
char * nm_email_get_folder_rel_db(struct Mailbox *m, struct Email *e)
Get the folder for a Email from the same level as the notmuch database.
Definition notmuch.c:1502
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:91
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:111
#define TAILQ_FOREACH(var, head, field)
Definition queue.h:782
#define TAILQ_FIRST(head)
Definition queue.h:780
#define TAILQ_NEXT(elm, field)
Definition queue.h:889
#define TAILQ_EMPTY(head)
Definition queue.h:778
#define MUTT_FORMAT_FORCESUBJ
Print the subject even if unchanged.
Definition render.h:34
#define MUTT_FORMAT_NO_FLAGS
No flags are set.
Definition render.h:33
#define MUTT_FORMAT_INDEX
This is a main index entry.
Definition render.h:38
#define MUTT_FORMAT_TREE
Draw the thread tree.
Definition render.h:35
#define MUTT_FORMAT_PLAIN
Do not prepend DISP_TO, DISP_CC ...
Definition render.h:39
uint8_t MuttFormatFlags
Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition render.h:32
#define ASSERT(COND)
Definition signal2.h:59
#define NONULL(x)
Definition string2.h:44
An email address.
Definition address.h:35
struct Buffer * mailbox
Mailbox and host address.
Definition address.h:37
LOFF_T length
length (in bytes) of attachment
Definition body.h:53
String manipulation buffer.
Definition buffer.h:36
size_t dsize
Length of data.
Definition buffer.h:39
char * data
Pointer to data.
Definition buffer.h:37
Data passed to index_format_str()
Definition private.h:37
struct Email * email
Current Email.
Definition private.h:40
struct Mailbox * mailbox
Current Mailbox.
Definition private.h:38
int msg_in_pager
Index of Email displayed in the Pager.
Definition private.h:39
const char * pager_progress
String representing Pager position through Email.
Definition private.h:41
Email private Module data.
Definition module_data.h:32
struct HashTable * tag_formats
Hash Table: "inbox" -> "GI" - Tag format strings.
Definition module_data.h:43
The envelope/body of an email.
Definition email.h:39
bool read
Email is read.
Definition email.h:50
unsigned int zminutes
Minutes away from UTC.
Definition email.h:57
bool recip_valid
Is_recipient is valid.
Definition email.h:104
struct Envelope * env
Envelope information.
Definition email.h:68
bool collapsed
Is this message part of a collapsed thread?
Definition email.h:120
int lines
How many lines in the body of this message?
Definition email.h:62
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Definition email.h:43
struct Body * body
List of MIME parts.
Definition email.h:69
char * tree
Character string to print thread tree.
Definition email.h:125
bool old
Email is seen, but unread.
Definition email.h:49
size_t num_hidden
Number of hidden messages in this view (only valid when collapsed is set)
Definition email.h:123
bool zoccident
True, if west of UTC, False if east.
Definition email.h:58
bool attach_del
Has an attachment marked for deletion.
Definition email.h:99
bool flagged
Marked important?
Definition email.h:47
unsigned int zhours
Hours away from UTC.
Definition email.h:56
time_t date_sent
Time when the message was sent (UTC)
Definition email.h:60
bool replied
Email has been replied to.
Definition email.h:51
struct TagList tags
For drivers that support server tagging.
Definition email.h:72
int score
Message score.
Definition email.h:113
int msgno
Number displayed to the user.
Definition email.h:111
bool deleted
Email is deleted.
Definition email.h:78
short recipient
User_is_recipient()'s return value, cached.
Definition email.h:116
bool tagged
Email is tagged.
Definition email.h:107
time_t received
Time when the message was placed in the mailbox.
Definition email.h:61
struct MuttThread * thread
Thread of Emails.
Definition email.h:119
The header of an Email.
Definition envelope.h:57
char *const subject
Email's subject.
Definition envelope.h:70
struct AddressList to
Email's 'To' list.
Definition envelope.h:60
struct AddressList reply_to
Email's 'reply-to'.
Definition envelope.h:64
char * message_id
Message ID.
Definition envelope.h:73
char * x_comment_to
List of 'X-comment-to' fields.
Definition envelope.h:81
char * newsgroups
List of newsgroups.
Definition envelope.h:78
struct AddressList cc
Email's 'Cc' list.
Definition envelope.h:61
struct Buffer spam
Spam header.
Definition envelope.h:82
struct AddressList bcc
Email's 'Bcc' list.
Definition envelope.h:62
char * organization
Organisation header.
Definition envelope.h:77
char * x_label
X-Label.
Definition envelope.h:76
char * disp_subj
Display subject (modified copy of subject)
Definition envelope.h:72
struct AddressList from
Email's 'From' list.
Definition envelope.h:59
Basic Expando Node.
Definition node.h:67
const char * text
Node-specific text.
Definition node.h:73
Parsed Expando trees.
Definition expando.h:41
struct ExpandoNode * node
Parsed tree.
Definition expando.h:43
A mailbox.
Definition mailbox.h:78
int msg_count
Total number of messages.
Definition mailbox.h:87
enum MailboxType type
Mailbox type.
Definition mailbox.h:101
Multibyte character table.
Definition mbtable.h:36
int len
Number of characters.
Definition mbtable.h:38
char ** chars
The array of multibyte character strings.
Definition mbtable.h:39
A local copy of an email.
Definition message.h:34
FILE * fp
pointer to the message data
Definition message.h:35
struct Message::@264267271004327071125374067057142037276212342100 flags
Flags for the Message.
struct MuttThread * parent
Parent of this Thread.
Definition thread.h:44
struct MuttThread * prev
Previous sibling Thread.
Definition thread.h:47
struct Email * message
Email this Thread refers to.
Definition thread.h:49
Container for Accounts, Notifications.
Definition neomutt.h:41
char ** env
Private copy of the environment variables.
Definition neomutt.h:58
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
locale_t time_c_locale
Current locale but LC_TIME=C.
Definition neomutt.h:51
bool subjectrx_apply_mods(struct Envelope *env)
Apply regex modifications to the subject.
Definition subjectrx.c:148
Parse Subject-regex Commands.
void driver_tags_get_transformed(struct TagList *tl, struct Buffer *tags)
Get transformed tags separated by space.
Definition tags.c:153
void driver_tags_get_transformed_for(struct TagList *tl, const char *name, struct Buffer *tags)
Get transformed tags for a tag name separated by space.
Definition tags.c:188