NeoMutt  2025-01-09-117-gace867
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
expando_index.c
Go to the documentation of this file.
1
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 "expando_index.h"
51#include "attach/lib.h"
52#include "color/lib.h"
53#include "expando/lib.h"
54#include "ncrypt/lib.h"
55#include "hook.h"
56#include "maillist.h"
57#include "mutt_thread.h"
58#include "muttlib.h"
59#include "mx.h"
60#include "subjectrx.h"
61#ifdef USE_NOTMUCH
62#include "notmuch/lib.h"
63#endif
64
65static void mailbox_mailbox_name(const struct ExpandoNode *node, void *data,
66 MuttFormatFlags flags, struct Buffer *buf);
67
74{
81};
82
87{
91};
92
101static const char *make_from_prefix(enum FieldType disp)
102{
103 /* need 2 bytes at the end, one for the space, another for NUL */
104 static char padded[8];
105 static const char *long_prefixes[DISP_MAX] = {
106 [DISP_TO] = "To ", [DISP_CC] = "Cc ", [DISP_BCC] = "Bcc ",
107 [DISP_FROM] = "", [DISP_PLAIN] = "",
108 };
109
110 const struct MbTable *c_from_chars = cs_subset_mbtable(NeoMutt->sub, "from_chars");
111
112 if (!c_from_chars || !c_from_chars->chars || (c_from_chars->len == 0))
113 return long_prefixes[disp];
114
115 const char *pchar = mbtable_get_nth_wchar(c_from_chars, disp);
116 if (mutt_str_len(pchar) == 0)
117 return "";
118
119 snprintf(padded, sizeof(padded), "%s ", pchar);
120 return padded;
121}
122
137static void make_from(struct Envelope *env, char *buf, size_t buflen,
138 bool do_lists, MuttFormatFlags flags)
139{
140 if (!env || !buf)
141 return;
142
143 bool me;
144 enum FieldType disp;
145 struct AddressList *name = NULL;
146
148
149 if (do_lists || me)
150 {
151 if (check_for_mailing_list(&env->to, make_from_prefix(DISP_TO), buf, buflen))
152 return;
153 if (check_for_mailing_list(&env->cc, make_from_prefix(DISP_CC), buf, buflen))
154 return;
155 }
156
157 if (me && !TAILQ_EMPTY(&env->to))
158 {
159 disp = (flags & MUTT_FORMAT_PLAIN) ? DISP_PLAIN : DISP_TO;
160 name = &env->to;
161 }
162 else if (me && !TAILQ_EMPTY(&env->cc))
163 {
164 disp = DISP_CC;
165 name = &env->cc;
166 }
167 else if (me && !TAILQ_EMPTY(&env->bcc))
168 {
169 disp = DISP_BCC;
170 name = &env->bcc;
171 }
172 else if (!TAILQ_EMPTY(&env->from))
173 {
174 disp = DISP_FROM;
175 name = &env->from;
176 }
177 else
178 {
179 *buf = '\0';
180 return;
181 }
182
183 snprintf(buf, buflen, "%s%s", make_from_prefix(disp), mutt_get_name(TAILQ_FIRST(name)));
184}
185
193static void make_from_addr(struct Envelope *env, char *buf, size_t buflen, bool do_lists)
194{
195 if (!env || !buf)
196 return;
197
198 bool me = mutt_addr_is_user(TAILQ_FIRST(&env->from));
199
200 if (do_lists || me)
201 {
202 if (check_for_mailing_list_addr(&env->to, buf, buflen))
203 return;
204 if (check_for_mailing_list_addr(&env->cc, buf, buflen))
205 return;
206 }
207
208 if (me && !TAILQ_EMPTY(&env->to))
209 snprintf(buf, buflen, "%s", buf_string(TAILQ_FIRST(&env->to)->mailbox));
210 else if (me && !TAILQ_EMPTY(&env->cc))
211 snprintf(buf, buflen, "%s", buf_string(TAILQ_FIRST(&env->cc)->mailbox));
212 else if (!TAILQ_EMPTY(&env->from))
213 mutt_str_copy(buf, buf_string(TAILQ_FIRST(&env->from)->mailbox), buflen);
214 else
215 *buf = '\0';
216}
217
223static bool user_in_addr(struct AddressList *al)
224{
225 struct Address *a = NULL;
226 TAILQ_FOREACH(a, al, entries)
227 if (mutt_addr_is_user(a))
228 return true;
229 return false;
230}
231
237static enum ToChars user_is_recipient(struct Email *e)
238{
239 if (!e || !e->env)
241
242 struct Envelope *env = e->env;
243
244 if (!e->recip_valid)
245 {
246 e->recip_valid = true;
247
249 {
251 }
252 else if (user_in_addr(&env->to))
253 {
254 if (TAILQ_NEXT(TAILQ_FIRST(&env->to), entries) || !TAILQ_EMPTY(&env->cc))
255 e->recipient = FLAG_CHAR_TO_TO; /* non-unique recipient */
256 else
257 e->recipient = FLAG_CHAR_TO_UNIQUE; /* unique recipient */
258 }
259 else if (user_in_addr(&env->cc))
260 {
262 }
263 else if (check_for_mailing_list(&env->to, NULL, NULL, 0))
264 {
266 }
267 else if (check_for_mailing_list(&env->cc, NULL, NULL, 0))
268 {
270 }
271 else if (user_in_addr(&env->reply_to))
272 {
274 }
275 else
276 {
278 }
279 }
280
281 return e->recipient;
282}
283
289static bool thread_is_new(struct Email *e)
290{
291 return e->collapsed && (e->num_hidden > 1) && (mutt_thread_contains_unread(e) == 1);
292}
293
299static bool thread_is_old(struct Email *e)
300{
301 return e->collapsed && (e->num_hidden > 1) && (mutt_thread_contains_unread(e) == 2);
302}
303
313static void index_email_date(const struct ExpandoNode *node, const struct Email *e,
314 enum IndexDateChoice which, MuttFormatFlags flags,
315 struct Buffer *buf, const char *format)
316{
317 char *fmt = mutt_str_dup(format);
318 if (!fmt)
319 return;
320
321 struct tm tm = { 0 };
322 switch (which)
323 {
324 case SENT_SENDER:
325 {
326#ifdef HAVE_STRUCT_TM_TM_GMTOFF
327 int offset = (e->zhours * 3600 + e->zminutes * 60) * (e->zoccident ? -1 : 1);
328 const time_t now = e->date_sent + offset;
329 tm = mutt_date_gmtime(now);
330 tm.tm_gmtoff = offset;
331 break;
332#else
334#endif
335 }
336 case SENT_LOCAL:
337 {
339 break;
340 }
341 case RECV_LOCAL:
342 {
344 break;
345 }
346 }
347
348 const bool use_c_locale = (*fmt == '!');
349
350 if (which != RECV_LOCAL)
351 {
352 // The sender's time zone might only be available as a numerical offset, so "%Z" behaves like "%z".
353 for (char *bigz = fmt; (bigz = strstr(bigz, "%Z")); bigz += 2)
354 {
355 bigz[1] = 'z';
356 }
357 }
358
359 char out[128] = { 0 };
360 if (use_c_locale)
361 {
362 strftime_l(out, sizeof(out), fmt + 1, &tm, NeoMutt->time_c_locale);
363 }
364 else
365 {
366 strftime(out, sizeof(out), fmt, &tm);
367 }
368
369 FREE(&fmt);
370
371 if (flags & MUTT_FORMAT_INDEX)
373 buf_strcpy(buf, out);
374}
375
379static long email_attachment_count(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
380{
381 const struct EmailFormatInfo *efi = data;
382 struct Email *e = efi->email;
383 if (!e)
384 return 0;
385
386 struct Mailbox *m = efi->mailbox;
387
388 struct Message *msg = mx_msg_open(m, e);
389 if (!msg)
390 return 0;
391
392 const int num = mutt_count_body_parts(e, msg->fp);
393 mx_msg_close(m, &msg);
394 return num;
395}
396
400static void email_body_characters(const struct ExpandoNode *node, void *data,
401 MuttFormatFlags flags, struct Buffer *buf)
402{
403 const struct EmailFormatInfo *efi = (const struct EmailFormatInfo *) data;
404 const struct Email *e = efi->email;
405 if (!e)
406 return;
407
408 if (flags & MUTT_FORMAT_INDEX)
410
412}
413
417static void email_combined_flags(const struct ExpandoNode *node, void *data,
418 MuttFormatFlags flags, struct Buffer *buf)
419{
420 const struct EmailFormatInfo *efi = data;
421 struct Email *e = efi->email;
422 if (!e)
423 return;
424
425 const int msg_in_pager = efi->msg_in_pager;
426
427 const struct MbTable *c_crypt_chars = cs_subset_mbtable(NeoMutt->sub, "crypt_chars");
428 const struct MbTable *c_flag_chars = cs_subset_mbtable(NeoMutt->sub, "flag_chars");
429 const struct MbTable *c_to_chars = cs_subset_mbtable(NeoMutt->sub, "to_chars");
430 const bool threads = mutt_using_threads();
431
432 const char *first = NULL;
433 if (threads && thread_is_new(e))
434 {
435 first = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_NEW_THREAD);
436 }
437 else if (threads && thread_is_old(e))
438 {
439 first = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_OLD_THREAD);
440 }
441 else if (e->read && (msg_in_pager != e->msgno))
442 {
443 if (e->replied)
444 {
445 first = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_REPLIED);
446 }
447 else
448 {
449 first = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_ZEMPTY);
450 }
451 }
452 else
453 {
454 if (e->old)
455 {
456 first = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_OLD);
457 }
458 else
459 {
460 first = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_NEW);
461 }
462 }
463
464 /* Marked for deletion; deleted attachments; crypto */
465 const char *second = NULL;
466 if (e->deleted)
467 second = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_DELETED);
468 else if (e->attach_del)
469 second = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_DELETED_ATTACH);
470 else if ((WithCrypto != 0) && (e->security & SEC_GOODSIGN))
471 second = mbtable_get_nth_wchar(c_crypt_chars, FLAG_CHAR_CRYPT_GOOD_SIGN);
472 else if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT))
473 second = mbtable_get_nth_wchar(c_crypt_chars, FLAG_CHAR_CRYPT_ENCRYPTED);
474 else if ((WithCrypto != 0) && (e->security & SEC_SIGN))
475 second = mbtable_get_nth_wchar(c_crypt_chars, FLAG_CHAR_CRYPT_SIGNED);
476 else if (((WithCrypto & APPLICATION_PGP) != 0) && (e->security & PGP_KEY))
478 else
479 second = mbtable_get_nth_wchar(c_crypt_chars, FLAG_CHAR_CRYPT_NO_CRYPTO);
480
481 /* Tagged, flagged and recipient flag */
482 const char *third = NULL;
483 if (e->tagged)
484 third = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_TAGGED);
485 else if (e->flagged)
486 third = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_IMPORTANT);
487 else
488 third = mbtable_get_nth_wchar(c_to_chars, user_is_recipient(e));
489
490 if (flags & MUTT_FORMAT_INDEX)
492
493 buf_printf(buf, "%s%s%s", first, second, third);
494}
495
499static void email_crypto_flags(const struct ExpandoNode *node, void *data,
500 MuttFormatFlags flags, struct Buffer *buf)
501{
502 const struct EmailFormatInfo *efi = data;
503 const struct Email *e = efi->email;
504 if (!e)
505 return;
506
507 const struct MbTable *c_crypt_chars = cs_subset_mbtable(NeoMutt->sub, "crypt_chars");
508
509 const char *ch = NULL;
510 if ((WithCrypto != 0) && (e->security & SEC_GOODSIGN))
511 {
513 }
514 else if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT))
515 {
517 }
518 else if ((WithCrypto != 0) && (e->security & SEC_SIGN))
519 {
521 }
522 else if (((WithCrypto & APPLICATION_PGP) != 0) && ((e->security & PGP_KEY) == PGP_KEY))
523 {
525 }
526 else
527 {
529 }
530
531 if (flags & MUTT_FORMAT_INDEX)
533 buf_strcpy(buf, ch);
534}
535
539static void email_date_format(const struct ExpandoNode *node, void *data,
540 MuttFormatFlags flags, struct Buffer *buf)
541{
542 const struct EmailFormatInfo *efi = data;
543 const struct Email *e = efi->email;
544 if (!e)
545 return;
546
547 const char *c_date_format = cs_subset_string(NeoMutt->sub, "date_format");
548 const char *cp = NONULL(c_date_format);
549
550 index_email_date(node, e, SENT_SENDER, flags, buf, cp);
551}
552
556static void email_date_format_local(const struct ExpandoNode *node, void *data,
557 MuttFormatFlags flags, struct Buffer *buf)
558{
559 const struct EmailFormatInfo *efi = data;
560 const struct Email *e = efi->email;
561 if (!e)
562 return;
563
564 const char *c_date_format = cs_subset_string(NeoMutt->sub, "date_format");
565 const char *cp = NONULL(c_date_format);
566
567 index_email_date(node, e, SENT_LOCAL, flags, buf, cp);
568}
569
573static long email_date_format_local_num(const struct ExpandoNode *node,
574 void *data, MuttFormatFlags flags)
575{
576 const struct EmailFormatInfo *efi = data;
577 const struct Email *e = efi->email;
578 if (!e)
579 return 0;
580
581 return e->date_sent;
582}
583
587static long email_date_format_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
588{
589 const struct EmailFormatInfo *efi = data;
590 const struct Email *e = efi->email;
591 if (!e)
592 return 0;
593
594 return e->date_sent;
595}
596
600static void email_date_strf(const struct ExpandoNode *node, void *data,
601 MuttFormatFlags flags, struct Buffer *buf)
602{
603 const struct EmailFormatInfo *efi = data;
604 const struct Email *e = efi->email;
605 if (!e)
606 return;
607
608 index_email_date(node, e, SENT_SENDER, flags, buf, node->text);
609}
610
614static long email_date_strf_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
615{
616 const struct EmailFormatInfo *efi = data;
617 const struct Email *e = efi->email;
618 if (!e)
619 return 0;
620
621 return e->date_sent;
622}
623
627static void email_date_strf_local(const struct ExpandoNode *node, void *data,
628 MuttFormatFlags flags, struct Buffer *buf)
629{
630 const struct EmailFormatInfo *efi = data;
631 const struct Email *e = efi->email;
632 if (!e)
633 return;
634
635 index_email_date(node, e, SENT_LOCAL, flags, buf, node->text);
636}
637
641static long email_date_strf_local_num(const struct ExpandoNode *node,
642 void *data, MuttFormatFlags flags)
643{
644 const struct EmailFormatInfo *efi = data;
645 const struct Email *e = efi->email;
646 if (!e)
647 return 0;
648
649 return e->date_sent;
650}
651
655static void email_flag_chars(const struct ExpandoNode *node, void *data,
656 MuttFormatFlags flags, struct Buffer *buf)
657{
658 const struct EmailFormatInfo *efi = data;
659 const struct Email *e = efi->email;
660 if (!e)
661 return;
662
663 const struct MbTable *c_flag_chars = cs_subset_mbtable(NeoMutt->sub, "flag_chars");
664 const int msg_in_pager = efi->msg_in_pager;
665
666 const char *wch = NULL;
667 if (e->deleted)
668 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_DELETED);
669 else if (e->attach_del)
671 else if (e->tagged)
672 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_TAGGED);
673 else if (e->flagged)
674 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_IMPORTANT);
675 else if (e->replied)
676 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_REPLIED);
677 else if (e->read && (msg_in_pager != e->msgno))
678 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_SEMPTY);
679 else if (e->old)
680 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_OLD);
681 else
682 wch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_NEW);
683
684 if (flags & MUTT_FORMAT_INDEX)
686
687 buf_strcpy(buf, wch);
688}
689
693static void email_from_list(const struct ExpandoNode *node, void *data,
694 MuttFormatFlags flags, struct Buffer *buf)
695{
696 const struct EmailFormatInfo *efi = data;
697 const struct Email *e = efi->email;
698 if (!e)
699 return;
700
701 char tmp[128] = { 0 };
702
703 make_from(e->env, tmp, sizeof(tmp), true, flags);
704
705 if (flags & MUTT_FORMAT_INDEX)
707 buf_strcpy(buf, tmp);
708}
709
713static void email_index_hook(const struct ExpandoNode *node, void *data,
714 MuttFormatFlags flags, struct Buffer *buf)
715{
716 const struct EmailFormatInfo *efi = data;
717 struct Email *e = efi->email;
718 if (!e)
719 return;
720
721 struct Mailbox *m = efi->mailbox;
722
723 const struct Expando *exp = mutt_idxfmt_hook(node->text, m, e);
724 if (!exp)
725 return;
726
728 buf->dsize, NeoMutt->env, buf);
729}
730
734static long email_lines(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
735{
736 const struct EmailFormatInfo *efi = data;
737 const struct Email *e = efi->email;
738 if (!e)
739 return 0;
740
741 if (flags & MUTT_FORMAT_INDEX)
743
744 return e->lines;
745}
746
750static void email_list_or_save_folder(const struct ExpandoNode *node, void *data,
751 MuttFormatFlags flags, struct Buffer *buf)
752{
753 const struct EmailFormatInfo *efi = data;
754 const struct Email *e = efi->email;
755 if (!e || !e->env)
756 return;
757
758 char tmp[128] = { 0 };
759 char *p = NULL;
760
761 make_from_addr(e->env, tmp, sizeof(tmp), true);
762 const bool c_save_address = cs_subset_bool(NeoMutt->sub, "save_address");
763 if (!c_save_address && (p = strpbrk(tmp, "%@")))
764 {
765 *p = '\0';
766 }
767
768 buf_strcpy(buf, tmp);
769}
770
774static void email_message_flags(const struct ExpandoNode *node, void *data,
775 MuttFormatFlags flags, struct Buffer *buf)
776{
777 const struct EmailFormatInfo *efi = data;
778 struct Email *e = efi->email;
779 if (!e)
780 return;
781
782 const struct MbTable *c_flag_chars = cs_subset_mbtable(NeoMutt->sub, "flag_chars");
783 const struct MbTable *c_to_chars = cs_subset_mbtable(NeoMutt->sub, "to_chars");
784
785 const char *ch = NULL;
786 if (e->tagged)
787 {
788 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_TAGGED);
789 }
790 else if (e->flagged)
791 {
792 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_IMPORTANT);
793 }
794 else
795 {
796 ch = mbtable_get_nth_wchar(c_to_chars, user_is_recipient(e));
797 }
798
799 if (flags & MUTT_FORMAT_INDEX)
801 buf_strcpy(buf, ch);
802}
803
807static long email_number(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
808{
809 const struct EmailFormatInfo *efi = data;
810 const struct Email *e = efi->email;
811 if (!e)
812 return 0;
813
814 if (flags & MUTT_FORMAT_INDEX)
816
817 return e->msgno + 1;
818}
819
823static long email_score(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
824{
825 const struct EmailFormatInfo *efi = data;
826 const struct Email *e = efi->email;
827 if (!e)
828 return 0;
829
830 return e->score;
831}
832
836static void email_size(const struct ExpandoNode *node, void *data,
837 MuttFormatFlags flags, struct Buffer *buf)
838{
839 const struct EmailFormatInfo *efi = data;
840 const struct Email *e = efi->email;
841 if (!e)
842 return;
843
844 if (flags & MUTT_FORMAT_INDEX)
846
848}
849
853static long email_size_num(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
854{
855 const struct EmailFormatInfo *efi = data;
856 const struct Email *e = efi->email;
857 if (!e || !e->body)
858 return 0;
859
860 return e->body->length;
861}
862
866static void email_status_flags(const struct ExpandoNode *node, void *data,
867 MuttFormatFlags flags, struct Buffer *buf)
868{
869 const struct EmailFormatInfo *efi = data;
870 struct Email *e = efi->email;
871 if (!e)
872 return;
873
874 const bool threads = mutt_using_threads();
875 const struct MbTable *c_flag_chars = cs_subset_mbtable(NeoMutt->sub, "flag_chars");
876 const int msg_in_pager = efi->msg_in_pager;
877
878 const char *ch = NULL;
879 if (e->deleted)
880 {
881 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_DELETED);
882 }
883 else if (e->attach_del)
884 {
886 }
887 else if (threads && thread_is_new(e))
888 {
890 }
891 else if (threads && thread_is_old(e))
892 {
894 }
895 else if (e->read && (msg_in_pager != e->msgno))
896 {
897 if (e->replied)
898 {
899 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_REPLIED);
900 }
901 else
902 {
903 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_ZEMPTY);
904 }
905 }
906 else
907 {
908 if (e->old)
909 {
910 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_OLD);
911 }
912 else
913 {
914 ch = mbtable_get_nth_wchar(c_flag_chars, FLAG_CHAR_NEW);
915 }
916 }
917
918 if (flags & MUTT_FORMAT_INDEX)
920 buf_strcpy(buf, ch);
921}
922
926static void email_strf_recv_local(const struct ExpandoNode *node, void *data,
927 MuttFormatFlags flags, struct Buffer *buf)
928{
929 const struct EmailFormatInfo *efi = data;
930 const struct Email *e = efi->email;
931 if (!e)
932 return;
933
934 index_email_date(node, e, RECV_LOCAL, flags, buf, node->text);
935}
936
940static long email_strf_recv_local_num(const struct ExpandoNode *node,
941 void *data, MuttFormatFlags flags)
942{
943 const struct EmailFormatInfo *efi = data;
944 const struct Email *e = efi->email;
945 if (!e)
946 return 0;
947
948 return e->received;
949}
950
954static void email_tags(const struct ExpandoNode *node, void *data,
955 MuttFormatFlags flags, struct Buffer *buf)
956{
957 const struct EmailFormatInfo *efi = data;
958 struct Email *e = efi->email;
959 if (!e)
960 return;
961
962 if (flags & MUTT_FORMAT_INDEX)
965}
966
970static void email_tags_transformed(const struct ExpandoNode *node, void *data,
971 MuttFormatFlags flags, struct Buffer *buf)
972{
973 const struct EmailFormatInfo *efi = data;
974 struct Email *e = efi->email;
975 if (!e)
976 return;
977
978 char *tag = mutt_hash_find(TagFormats, node->text);
979 if (!tag)
980 return;
981
982 if (flags & MUTT_FORMAT_INDEX)
985}
986
990static long email_thread_count(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
991{
992 const struct EmailFormatInfo *efi = data;
993 struct Email *e = efi->email;
994 struct Mailbox *m = efi->mailbox;
995
997}
998
1002static void email_thread_hidden_count(const struct ExpandoNode *node, void *data,
1003 MuttFormatFlags flags, struct Buffer *buf)
1004{
1005 const struct EmailFormatInfo *efi = data;
1006 const struct Email *e = efi->email;
1007 if (!e)
1008 return;
1009
1010 const bool threads = mutt_using_threads();
1011 const bool is_index = (flags & MUTT_FORMAT_INDEX) != 0;
1012
1013 if (threads && is_index && e->collapsed && (e->num_hidden > 1))
1014 {
1015 if (flags & MUTT_FORMAT_INDEX)
1017 const int num = e->num_hidden;
1018 buf_printf(buf, "%d", num);
1019 }
1020 else if (is_index && threads)
1021 {
1022 if (flags & MUTT_FORMAT_INDEX)
1024 const char *s = " ";
1025 buf_strcpy(buf, s);
1026 }
1027}
1028
1032static long email_thread_hidden_count_num(const struct ExpandoNode *node,
1033 void *data, MuttFormatFlags flags)
1034{
1035 const struct EmailFormatInfo *efi = data;
1036 const struct Email *e = efi->email;
1037 if (!e)
1038 return 0;
1039
1040 const bool threads = mutt_using_threads();
1041 const bool is_index = (flags & MUTT_FORMAT_INDEX) != 0;
1042
1043 if (threads && is_index && e->collapsed && (e->num_hidden > 1))
1044 {
1045 if (flags & MUTT_FORMAT_INDEX)
1047 return e->num_hidden;
1048 }
1049
1050 return 0;
1051}
1052
1056static long email_thread_number(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
1057{
1058 const struct EmailFormatInfo *efi = data;
1059 struct Email *e = efi->email;
1060 struct Mailbox *m = efi->mailbox;
1061
1063}
1064
1068static void email_thread_tags(const struct ExpandoNode *node, void *data,
1069 MuttFormatFlags flags, struct Buffer *buf)
1070{
1071 const struct EmailFormatInfo *efi = data;
1072 struct Email *e = efi->email;
1073 if (!e)
1074 return;
1075
1076 bool have_tags = true;
1077 struct Buffer *tags = buf_pool_get();
1079 if (!buf_is_empty(tags))
1080 {
1081 if (flags & MUTT_FORMAT_TREE)
1082 {
1083 struct Buffer *parent_tags = buf_pool_get();
1084 if (e->thread->prev && e->thread->prev->message)
1085 {
1086 driver_tags_get_transformed(&e->thread->prev->message->tags, parent_tags);
1087 }
1088 if (!parent_tags && e->thread->parent && e->thread->parent->message)
1089 {
1091 }
1092 if (parent_tags && buf_istr_equal(tags, parent_tags))
1093 have_tags = false;
1094 buf_pool_release(&parent_tags);
1095 }
1096 }
1097 else
1098 {
1099 have_tags = false;
1100 }
1101
1102 if (flags & MUTT_FORMAT_INDEX)
1104
1105 const char *s = have_tags ? buf_string(tags) : "";
1106 buf_strcpy(buf, s);
1107
1108 buf_pool_release(&tags);
1109}
1110
1114static void email_to_chars(const struct ExpandoNode *node, void *data,
1115 MuttFormatFlags flags, struct Buffer *buf)
1116{
1117 const struct EmailFormatInfo *efi = data;
1118 struct Email *e = efi->email;
1119 if (!e)
1120 return;
1121
1122 const struct MbTable *c_to_chars = cs_subset_mbtable(NeoMutt->sub, "to_chars");
1123
1124 int i;
1125 const char *s = (c_to_chars && ((i = user_is_recipient(e))) < c_to_chars->len) ?
1126 c_to_chars->chars[i] :
1127 " ";
1128
1129 buf_strcpy(buf, s);
1130}
1131
1135static void envelope_cc_all(const struct ExpandoNode *node, void *data,
1136 MuttFormatFlags flags, struct Buffer *buf)
1137{
1138 const struct EmailFormatInfo *efi = data;
1139 const struct Email *e = efi->email;
1140 if (!e || !e->env)
1141 return;
1142
1143 mutt_addrlist_write(&e->env->cc, buf, true);
1144}
1145
1149static void envelope_first_name(const struct ExpandoNode *node, void *data,
1150 MuttFormatFlags flags, struct Buffer *buf)
1151{
1152 const struct EmailFormatInfo *efi = data;
1153 const struct Email *e = efi->email;
1154 if (!e || !e->env)
1155 return;
1156
1157 const struct Address *from = TAILQ_FIRST(&e->env->from);
1158 const struct Address *to = TAILQ_FIRST(&e->env->to);
1159 const struct Address *cc = TAILQ_FIRST(&e->env->cc);
1160
1161 char tmp[128] = { 0 };
1162 char *p = NULL;
1163
1164 if (mutt_addr_is_user(from))
1165 {
1166 if (to)
1167 {
1168 const char *s = mutt_get_name(to);
1169 mutt_str_copy(tmp, NONULL(s), sizeof(tmp));
1170 }
1171 else if (cc)
1172 {
1173 const char *s = mutt_get_name(cc);
1174 mutt_str_copy(tmp, NONULL(s), sizeof(tmp));
1175 }
1176 }
1177 else
1178 {
1179 const char *s = mutt_get_name(from);
1180 mutt_str_copy(tmp, NONULL(s), sizeof(tmp));
1181 }
1182 p = strpbrk(tmp, " %@");
1183 if (p)
1184 {
1185 *p = '\0';
1186 }
1187
1188 buf_strcpy(buf, tmp);
1189}
1190
1194static void envelope_from(const struct ExpandoNode *node, void *data,
1195 MuttFormatFlags flags, struct Buffer *buf)
1196{
1197 const struct EmailFormatInfo *efi = data;
1198 const struct Email *e = efi->email;
1199 if (!e || !e->env)
1200 return;
1201
1202 const struct Address *from = TAILQ_FIRST(&e->env->from);
1203
1204 const char *s = NULL;
1205 if (from && from->mailbox)
1206 {
1207 s = mutt_addr_for_display(from);
1208 }
1209
1210 if (flags & MUTT_FORMAT_INDEX)
1212 buf_strcpy(buf, s);
1213}
1214
1218static void envelope_from_full(const struct ExpandoNode *node, void *data,
1219 MuttFormatFlags flags, struct Buffer *buf)
1220{
1221 const struct EmailFormatInfo *efi = data;
1222 struct Email *e = efi->email;
1223 if (!e || !e->env)
1224 return;
1225
1226 mutt_addrlist_write(&e->env->from, buf, true);
1227}
1228
1232static void envelope_initials(const struct ExpandoNode *node, void *data,
1233 MuttFormatFlags flags, struct Buffer *buf)
1234{
1235 const struct EmailFormatInfo *efi = data;
1236 const struct Email *e = efi->email;
1237 if (!e || !e->env)
1238 return;
1239
1240 const struct Address *from = TAILQ_FIRST(&e->env->from);
1241
1242 char tmp[128] = { 0 };
1243
1244 if (mutt_mb_get_initials(mutt_get_name(from), tmp, sizeof(tmp)))
1245 {
1246 if (flags & MUTT_FORMAT_INDEX)
1248
1249 buf_strcpy(buf, tmp);
1250 return;
1251 }
1252
1253 envelope_from(node, data, flags, buf);
1254}
1255
1259static void envelope_list_address(const struct ExpandoNode *node, void *data,
1260 MuttFormatFlags flags, struct Buffer *buf)
1261{
1262 const struct EmailFormatInfo *efi = data;
1263 const struct Email *e = efi->email;
1264 if (!e || !e->env)
1265 return;
1266
1267 char tmp[128] = { 0 };
1268
1269 if (first_mailing_list(tmp, sizeof(tmp), &e->env->to) ||
1270 first_mailing_list(tmp, sizeof(tmp), &e->env->cc))
1271 {
1272 buf_strcpy(buf, tmp);
1273 return;
1274 }
1275
1276 mailbox_mailbox_name(node, data, flags, buf);
1277}
1278
1282static void envelope_list_empty(const struct ExpandoNode *node, void *data,
1283 MuttFormatFlags flags, struct Buffer *buf)
1284{
1285 const struct EmailFormatInfo *efi = data;
1286 const struct Email *e = efi->email;
1287 if (!e || !e->env)
1288 return;
1289
1290 char tmp[128] = { 0 };
1291
1292 if (first_mailing_list(tmp, sizeof(tmp), &e->env->to) ||
1293 first_mailing_list(tmp, sizeof(tmp), &e->env->cc))
1294 {
1295 buf_strcpy(buf, tmp);
1296 }
1297}
1298
1302static void envelope_message_id(const struct ExpandoNode *node, void *data,
1303 MuttFormatFlags flags, struct Buffer *buf)
1304{
1305 const struct EmailFormatInfo *efi = data;
1306 struct Email *e = efi->email;
1307 if (!e || !e->env)
1308 return;
1309
1310 const char *s = e->env->message_id ? e->env->message_id : "<no.id>";
1311 buf_strcpy(buf, s);
1312}
1313
1317static void envelope_name(const struct ExpandoNode *node, void *data,
1318 MuttFormatFlags flags, struct Buffer *buf)
1319{
1320 const struct EmailFormatInfo *efi = data;
1321 const struct Email *e = efi->email;
1322 if (!e || !e->env)
1323 return;
1324
1325 const struct Address *from = TAILQ_FIRST(&e->env->from);
1326
1327 if (flags & MUTT_FORMAT_INDEX)
1329
1330 const char *s = mutt_get_name(from);
1331 buf_strcpy(buf, s);
1332}
1333
1337static void envelope_newsgroup(const struct ExpandoNode *node, void *data,
1338 MuttFormatFlags flags, struct Buffer *buf)
1339{
1340 const struct EmailFormatInfo *efi = data;
1341 const struct Email *e = efi->email;
1342 if (!e || !e->env)
1343 return;
1344
1345 const char *s = e->env->newsgroups;
1346 buf_strcpy(buf, s);
1347}
1348
1352static void envelope_organization(const struct ExpandoNode *node, void *data,
1353 MuttFormatFlags flags, struct Buffer *buf)
1354{
1355 const struct EmailFormatInfo *efi = data;
1356 const struct Email *e = efi->email;
1357 if (!e || !e->env)
1358 return;
1359
1360 const char *s = e->env->organization;
1361 buf_strcpy(buf, s);
1362}
1363
1367static void envelope_reply_to(const struct ExpandoNode *node, void *data,
1368 MuttFormatFlags flags, struct Buffer *buf)
1369{
1370 const struct EmailFormatInfo *efi = data;
1371 const struct Email *e = efi->email;
1372 if (!e || !e->env)
1373 return;
1374
1375 const struct Address *reply_to = TAILQ_FIRST(&e->env->reply_to);
1376
1377 if (reply_to && reply_to->mailbox)
1378 {
1379 if (flags & MUTT_FORMAT_INDEX)
1381 const char *s = mutt_addr_for_display(reply_to);
1382 buf_strcpy(buf, s);
1383 return;
1384 }
1385
1386 envelope_from(node, data, flags, buf);
1387}
1388
1392static void envelope_sender(const struct ExpandoNode *node, void *data,
1393 MuttFormatFlags flags, struct Buffer *buf)
1394{
1395 const struct EmailFormatInfo *efi = data;
1396 struct Email *e = efi->email;
1397 if (!e || !e->env)
1398 return;
1399
1400 char tmp[128] = { 0 };
1401
1402 make_from(e->env, tmp, sizeof(tmp), false, MUTT_FORMAT_NO_FLAGS);
1403
1404 if (flags & MUTT_FORMAT_INDEX)
1406
1407 buf_strcpy(buf, tmp);
1408}
1409
1413static void envelope_sender_plain(const struct ExpandoNode *node, void *data,
1414 MuttFormatFlags flags, struct Buffer *buf)
1415{
1416 const struct EmailFormatInfo *efi = (const struct EmailFormatInfo *) data;
1417 struct Email *e = efi->email;
1418 if (!e || !e->env)
1419 return;
1420
1421 char tmp[128] = { 0 };
1422
1423 if (flags & MUTT_FORMAT_INDEX)
1425
1426 make_from(e->env, tmp, sizeof(tmp), false, MUTT_FORMAT_PLAIN);
1427
1428 buf_strcpy(buf, tmp);
1429}
1430
1434static void envelope_spam(const struct ExpandoNode *node, void *data,
1435 MuttFormatFlags flags, struct Buffer *buf)
1436{
1437 const struct EmailFormatInfo *efi = data;
1438 struct Email *e = efi->email;
1439 if (!e || !e->env)
1440 return;
1441
1442 buf_copy(buf, &e->env->spam);
1443}
1444
1448static void envelope_subject(const struct ExpandoNode *node, void *data,
1449 MuttFormatFlags flags, struct Buffer *buf)
1450{
1451 const struct EmailFormatInfo *efi = data;
1452 const struct Email *e = efi->email;
1453 if (!e || !e->env)
1454 return;
1455
1456 if ((flags & MUTT_FORMAT_TREE) && !e->collapsed && !(flags & MUTT_FORMAT_FORCESUBJ))
1457 return;
1458
1459 if (flags & MUTT_FORMAT_INDEX)
1461
1463
1464 if (e->env->disp_subj)
1465 buf_strcpy(buf, e->env->disp_subj);
1466 else
1467 buf_strcpy(buf, e->env->subject);
1468}
1469
1473static void envelope_thread_tree(const struct ExpandoNode *node, void *data,
1474 MuttFormatFlags flags, struct Buffer *buf)
1475{
1476 const struct EmailFormatInfo *efi = data;
1477 const struct Email *e = efi->email;
1478 if (!e || !e->env)
1479 return;
1480
1481 if (!(flags & MUTT_FORMAT_TREE) || e->collapsed)
1482 return;
1483
1485 node_expando_set_has_tree(node, true);
1486 buf_strcpy(buf, e->tree);
1487}
1488
1492static void envelope_thread_x_label(const struct ExpandoNode *node, void *data,
1493 MuttFormatFlags flags, struct Buffer *buf)
1494{
1495 const struct EmailFormatInfo *efi = data;
1496 const struct Email *e = efi->email;
1497 if (!e || !e->env)
1498 return;
1499
1500 bool label = true;
1501 if (e->env->x_label)
1502 {
1503 struct Email *e_tmp = NULL;
1504 if (flags & MUTT_FORMAT_TREE && (e->thread->prev && e->thread->prev->message &&
1505 e->thread->prev->message->env->x_label))
1506 {
1507 e_tmp = e->thread->prev->message;
1508 }
1509 else if (flags & MUTT_FORMAT_TREE && (e->thread->parent && e->thread->parent->message &&
1511 {
1512 e_tmp = e->thread->parent->message;
1513 }
1514
1515 if (e_tmp && mutt_istr_equal(e->env->x_label, e_tmp->env->x_label))
1516 {
1517 label = false;
1518 }
1519 }
1520 else
1521 {
1522 label = false;
1523 }
1524
1525 if (flags & MUTT_FORMAT_INDEX)
1527
1528 if (label)
1529 {
1530 const char *s = e->env->x_label;
1531 buf_strcpy(buf, s);
1532 }
1533}
1534
1538static void envelope_to(const struct ExpandoNode *node, void *data,
1539 MuttFormatFlags flags, struct Buffer *buf)
1540{
1541 const struct EmailFormatInfo *efi = data;
1542 const struct Email *e = efi->email;
1543 if (!e || !e->env)
1544 return;
1545
1546 const struct Address *to = TAILQ_FIRST(&e->env->to);
1547 const struct Address *cc = TAILQ_FIRST(&e->env->cc);
1548
1549 char tmp[128] = { 0 };
1550
1551 if (!check_for_mailing_list(&e->env->to, "To ", tmp, sizeof(tmp)) &&
1552 !check_for_mailing_list(&e->env->cc, "Cc ", tmp, sizeof(tmp)))
1553 {
1554 if (to)
1555 snprintf(tmp, sizeof(tmp), "To %s", mutt_get_name(to));
1556 else if (cc)
1557 snprintf(tmp, sizeof(tmp), "Cc %s", mutt_get_name(cc));
1558 else
1559 {
1560 tmp[0] = '\0';
1561 }
1562 }
1563
1564 buf_strcpy(buf, tmp);
1565}
1566
1570static void envelope_to_all(const struct ExpandoNode *node, void *data,
1571 MuttFormatFlags flags, struct Buffer *buf)
1572{
1573 const struct EmailFormatInfo *efi = data;
1574 const struct Email *e = efi->email;
1575 if (!e || !e->env)
1576 return;
1577
1578 mutt_addrlist_write(&e->env->to, buf, true);
1579}
1580
1584static void envelope_username(const struct ExpandoNode *node, void *data,
1585 MuttFormatFlags flags, struct Buffer *buf)
1586{
1587 const struct EmailFormatInfo *efi = data;
1588 const struct Email *e = efi->email;
1589 if (!e || !e->env)
1590 return;
1591
1592 const struct Address *from = TAILQ_FIRST(&e->env->from);
1593 if (!from || !from->mailbox)
1594 return;
1595
1596 char tmp[128] = { 0 };
1597 char *p = NULL;
1598
1599 mutt_str_copy(tmp, mutt_addr_for_display(from), sizeof(tmp));
1600 p = strpbrk(tmp, "%@");
1601 if (p)
1602 {
1603 *p = '\0';
1604 }
1605
1606 buf_strcpy(buf, tmp);
1607}
1608
1612static void envelope_x_comment_to(const struct ExpandoNode *node, void *data,
1613 MuttFormatFlags flags, struct Buffer *buf)
1614{
1615 const struct EmailFormatInfo *efi = data;
1616 const struct Email *e = efi->email;
1617 if (!e || !e->env)
1618 return;
1619
1620 const char *s = e->env->x_comment_to;
1621 buf_strcpy(buf, s);
1622}
1623
1627static void envelope_x_label(const struct ExpandoNode *node, void *data,
1628 MuttFormatFlags flags, struct Buffer *buf)
1629{
1630 const struct EmailFormatInfo *efi = data;
1631 const struct Email *e = efi->email;
1632 if (!e || !e->env)
1633 return;
1634
1635 if (flags & MUTT_FORMAT_INDEX)
1637
1638 const char *s = e->env->x_label;
1639 buf_strcpy(buf, s);
1640}
1641
1645static void mailbox_mailbox_name(const struct ExpandoNode *node, void *data,
1646 MuttFormatFlags flags, struct Buffer *buf)
1647{
1648 const struct EmailFormatInfo *efi = data;
1649 struct Mailbox *m = efi->mailbox;
1650 if (!m)
1651 {
1652 buf_addstr(buf, "(null)");
1653 return;
1654 }
1655
1656 char *p = NULL;
1657
1658#ifdef USE_NOTMUCH
1659 struct Email *e = efi->email;
1660 if (m->type == MUTT_NOTMUCH)
1661 {
1663 }
1664#endif
1665 if (!p)
1666 {
1667 p = strrchr(mailbox_path(m), '/');
1668 if (p)
1669 {
1670 p++;
1671 }
1672 }
1673 buf_addstr(buf, p ? p : mailbox_path(m));
1674}
1675
1679static long mailbox_message_count(const struct ExpandoNode *node, void *data, MuttFormatFlags flags)
1680{
1681 const struct EmailFormatInfo *efi = data;
1682 const struct Mailbox *m = efi->mailbox;
1683
1684 if (m)
1685 return m->msg_count;
1686
1687 return 0;
1688}
1689
1693static void mailbox_percentage(const struct ExpandoNode *node, void *data,
1694 MuttFormatFlags flags, struct Buffer *buf)
1695{
1696 const struct EmailFormatInfo *efi = data;
1697
1698 const char *s = efi->pager_progress;
1699 buf_strcpy(buf, s);
1700}
1701
1708 // clang-format off
1720 { ED_EMAIL, ED_EMA_LINES, NULL, email_lines },
1724 { ED_EMAIL, ED_EMA_SCORE, NULL, email_score },
1728 { ED_EMAIL, ED_EMA_TAGS, email_tags, NULL },
1753 { ED_ENVELOPE, ED_ENV_TO, envelope_to, NULL },
1761 { -1, -1, NULL, NULL },
1762 // clang-format on
1763};
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:596
GUI display the mailboxes in a side panel.
int mutt_count_body_parts(struct Email *e, FILE *fp)
Count the MIME Body parts.
Definition: attachments.c:251
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:89
@ MT_COLOR_INDEX_SIZE
Index: size field.
Definition: color.h:95
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
Definition: color.h:98
@ MT_COLOR_INDEX_SUBJECT
Index: subject field.
Definition: color.h:96
@ MT_COLOR_INDEX_DATE
Index: date field.
Definition: color.h:91
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
Definition: color.h:97
@ MT_COLOR_TREE
Index: tree-drawing characters.
Definition: color.h:84
@ MT_COLOR_INDEX_LABEL
Index: label field.
Definition: color.h:93
@ MT_COLOR_INDEX_NUMBER
Index: index number.
Definition: color.h:94
@ MT_COLOR_INDEX_FLAGS
Index: flags field.
Definition: color.h:92
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
Definition: color.h:90
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:223
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition: mailbox.h:51
@ 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:139
@ 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:139
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.
Definition: expando_index.c:74
@ DISP_PLAIN
Empty string.
Definition: expando_index.c:79
@ DISP_TO
To: string.
Definition: expando_index.c:75
@ DISP_CC
Cc: string.
Definition: expando_index.c:76
@ DISP_BCC
Bcc: string.
Definition: expando_index.c:77
@ DISP_MAX
Definition: expando_index.c:80
@ DISP_FROM
From: string.
Definition: expando_index.c:78
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.
Definition: expando_index.c:87
@ SENT_LOCAL
Date sent in the local timezone.
Definition: expando_index.c:89
@ RECV_LOCAL
Date received in the local timezone.
Definition: expando_index.c:90
@ SENT_SENDER
Date sent in the sender's timezone.
Definition: expando_index.c:88
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.
Definition: expando_index.h:66
@ FLAG_CHAR_TO_ORIGINATOR
Character denoting that the user is originator.
Definition: expando_index.h:71
@ FLAG_CHAR_TO_UNIQUE
Character denoting that the user is unique recipient.
Definition: expando_index.h:68
@ FLAG_CHAR_TO_NOT_IN_THE_LIST
Character denoting that the user is not in list.
Definition: expando_index.h:67
@ FLAG_CHAR_TO_TO
Character denoting that the user is in the TO list.
Definition: expando_index.h:69
@ FLAG_CHAR_TO_CC
Character denoting that the user is in the CC list.
Definition: expando_index.h:70
@ FLAG_CHAR_TO_REPLY_TO
Character denoting that the user is in the Reply-To list.
Definition: expando_index.h:73
@ FLAG_CHAR_TO_SUBSCRIBED_LIST
Character denoting that the message is sent to a subscribed mailing list.
Definition: expando_index.h:72
@ FLAG_CHAR_CRYPT_CONTAINS_KEY
Character denoting a message contains a PGP key.
Definition: expando_index.h:58
@ FLAG_CHAR_CRYPT_SIGNED
Character denoting a message is signed.
Definition: expando_index.h:57
@ FLAG_CHAR_CRYPT_NO_CRYPTO
Character denoting a message has no cryptography information.
Definition: expando_index.h:59
@ FLAG_CHAR_CRYPT_GOOD_SIGN
Character denoting a message signed with a verified key.
Definition: expando_index.h:55
@ FLAG_CHAR_CRYPT_ENCRYPTED
Character denoting a message is PGP-encrypted.
Definition: expando_index.h:56
@ FLAG_CHAR_OLD
Character denoting an email that has been read.
Definition: expando_index.h:42
@ FLAG_CHAR_REPLIED
Character denoting an email that has been replied to.
Definition: expando_index.h:41
@ FLAG_CHAR_OLD_THREAD
Character denoting a thread of emails that has been read.
Definition: expando_index.h:44
@ FLAG_CHAR_ZEMPTY
Character denoting a read email, $index_format Z expando.
Definition: expando_index.h:47
@ FLAG_CHAR_TAGGED
Character denoting a tagged email.
Definition: expando_index.h:37
@ FLAG_CHAR_NEW
Character denoting an unread email.
Definition: expando_index.h:43
@ FLAG_CHAR_DELETED
Character denoting a deleted email.
Definition: expando_index.h:39
@ FLAG_CHAR_NEW_THREAD
Character denoting a thread containing at least one new email.
Definition: expando_index.h:45
@ FLAG_CHAR_DELETED_ATTACH
Character denoting a deleted attachment.
Definition: expando_index.h:40
@ FLAG_CHAR_SEMPTY
Character denoting a read email, $index_format S expando.
Definition: expando_index.h:46
@ FLAG_CHAR_IMPORTANT
Character denoting a important (flagged) email.
Definition: expando_index.h:38
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: Filename - 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: Email 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 -.
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:362
const struct Expando * mutt_idxfmt_hook(const char *name, struct Mailbox *m, struct Email *e)
Get index-format-hook format string.
Definition: hook.c:992
Parse and execute user-defined hooks.
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:78
bool check_for_mailing_list_addr(struct AddressList *al, char *buf, int buflen)
Check an address list for a mailing list.
Definition: maillist.c:102
bool first_mailing_list(char *buf, size_t buflen, struct AddressList *al)
Get the first mailing list in the list of addresses.
Definition: maillist.c:124
Handle mailing lists.
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:82
#define FREE(x)
Definition: memory.h:55
struct tm mutt_date_localtime(time_t t)
Converts calendar time to a broken-down time structure expressed in user timezone.
Definition: date.c:906
struct tm mutt_date_gmtime(time_t t)
Converts calendar time to a broken-down time structure expressed in UTC timezone.
Definition: date.c:927
Convenience wrapper for the library headers.
#define FALLTHROUGH
Definition: lib.h:111
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition: string.c:673
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:254
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:497
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:582
int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, enum MessageInThread mit)
Count the messages in a thread.
Definition: mutt_thread.c:1657
Create/manipulate threading in emails.
#define mutt_using_threads()
Definition: mutt_thread.h:113
@ MIT_NUM_MESSAGES
How many messages are in the thread.
Definition: mutt_thread.h:88
@ MIT_POSITION
Our position in the thread.
Definition: mutt_thread.h:89
#define mutt_thread_contains_unread(e)
Definition: mutt_thread.h:108
int mutt_str_pretty_size(struct Buffer *buf, size_t num)
Display an abbreviated size, like 3.4K.
Definition: muttlib.c:1003
Some miscellaneous functions.
int mx_msg_close(struct Mailbox *m, struct Message **ptr)
Close a message.
Definition: mx.c:1185
struct Message * mx_msg_open(struct Mailbox *m, struct Email *e)
Return a stream pointer for a message.
Definition: mx.c:1139
API for mailboxes.
API for encryption/signing of emails.
#define SEC_GOODSIGN
Email has a valid signature.
Definition: lib.h:86
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:96
#define SEC_ENCRYPT
Email is encrypted.
Definition: lib.h:84
#define PGP_KEY
Definition: lib.h:105
#define WithCrypto
Definition: lib.h:122
#define SEC_SIGN
Email is signed.
Definition: lib.h:85
void node_expando_set_color(const struct ExpandoNode *node, int cid)
Set the colour for an Expando.
Definition: node_expando.c:100
void node_expando_set_has_tree(const struct ExpandoNode *node, bool has_tree)
Set the has_tree flag for an Expando.
Definition: node_expando.c:115
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:1508
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:82
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:96
#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
GUI display the mailboxes in a side panel.
#define NONULL(x)
Definition: string2.h:37
An email address.
Definition: address.h:36
struct Buffer * mailbox
Mailbox and host address.
Definition: address.h:38
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
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:79
int msg_count
Total number of messages.
Definition: mailbox.h:88
enum MailboxType type
Mailbox type.
Definition: mailbox.h:102
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::@0 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:43
char ** env
Private copy of the environment variables.
Definition: neomutt.h:55
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:47
locale_t time_c_locale
Current locale but LC_TIME=C.
Definition: neomutt.h:49
bool subjrx_apply_mods(struct Envelope *env)
Apply regex modifications to the subject.
Definition: subjectrx.c:133
Subject Regex handling.
struct HashTable * TagFormats
Hash Table: "inbox" -> "GI" - Tag format strings.
Definition: tags.c:42
void driver_tags_get_transformed(struct TagList *tl, struct Buffer *tags)
Get transformed tags separated by space.
Definition: tags.c:152
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:187