NeoMutt  2020-09-25
Teaching an old dog new tricks
Go to the documentation of this file.
26 #include "config.h"
27 #include <stddef.h>
28 #include <stdbool.h>
29 #include <time.h>
30 #include "mutt/lib.h"
31 #include "ncrypt/lib.h"
32 #include "tags.h"
37 struct Email
38 {
42  bool mime : 1;
43  bool flagged : 1;
44  bool tagged : 1;
45  bool deleted : 1;
46  bool purge : 1;
47  bool quasi_deleted : 1;
48  bool changed : 1;
49  bool attach_del : 1;
50  bool old : 1;
51  bool read : 1;
52  bool expired : 1;
53  bool superseded : 1;
54  bool replied : 1;
55  bool subject_changed : 1;
56  bool threaded : 1;
57  bool display_subject : 1;
58  bool recip_valid : 1;
59  bool active : 1;
60  bool trash : 1;
62  // timezone of the sender of this message
63  unsigned int zhours : 5;
64  unsigned int zminutes : 6;
65  bool zoccident : 1;
67  bool searched : 1;
68  bool matched : 1;
70  bool attach_valid : 1;
72  // the following are used to support collapsing threads
73  bool collapsed : 1;
74  bool visible : 1;
75  size_t num_hidden;
78  short recipient;
80  int pair;
82  time_t date_sent;
83  time_t received;
84  LOFF_T offset;
85  int lines;
86  int index;
87  int msgno;
88  int vnum;
89  int score;
90  struct Envelope *env;
91  struct Body *body;
92  char *path;
94  char *tree;
95  struct MuttThread *thread;
97  short attach_total;
99  size_t sequence;
101 #ifdef MIXMASTER
102  struct ListHead chain;
103 #endif
105 #ifdef USE_NOTMUCH
106  void *nm_edata;
107 #endif
109  struct TagList tags;
111  void *edata;
117  void (*edata_free)(void **ptr);
119  struct Notify *notify;
120 };
125 struct EmailNode
126 {
127  struct Email *email;
128  STAILQ_ENTRY(EmailNode) entries;
129 };
130 STAILQ_HEAD(EmailList, EmailNode);
138 {
141 };
147 {
149  struct Email **emails;
150 };
152 bool email_cmp_strict(const struct Email *e1, const struct Email *e2);
153 void email_free (struct Email **ptr);
154 struct Email *email_new (void);
155 size_t email_size (const struct Email *e);
157 int emaillist_add_email(struct EmailList *el, struct Email *e);
158 void emaillist_clear (struct EmailList *el);
160 #endif /* MUTT_EMAIL_EMAIL_H */
An Event that happened to an Email.
Definition: email.h:146
int lines
How many lines in the body of this message?
Definition: email.h:85
The envelope/body of an email.
Definition: email.h:37
struct Body * body
List of MIME parts.
Definition: email.h:91
struct MuttThread * thread
Thread of Emails.
Definition: email.h:95
bool attach_del
Has an attachment marked for deletion.
Definition: email.h:49
short recipient
User_is_recipient()&#39;s return value, cached.
Definition: email.h:78
bool display_subject
Used for threading.
Definition: email.h:57
bool threaded
Used for threading.
Definition: email.h:56
bool changed
Email has been edited.
Definition: email.h:48
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:83
bool searched
Email has been searched.
Definition: email.h:67
#define STAILQ_ENTRY(type)
Definition: queue.h:324
struct Email ** emails
Definition: email.h:149
bool zoccident
True, if west of UTC, False if east.
Definition: email.h:65
bool expired
Already expired?
Definition: email.h:52
void email_free(struct Email **ptr)
Free an Email.
Definition: email.c:43
The body of an email.
Definition: body.h:34
bool email_cmp_strict(const struct Email *e1, const struct Email *e2)
Strictly compare message emails.
Definition: email.c:92
void emaillist_clear(struct EmailList *el)
Drop a private list of Emails.
Definition: email.c:130
int num_emails
Definition: email.h:148
bool tagged
Email is tagged.
Definition: email.h:44
bool read
Email is read.
Definition: email.h:51
bool old
Email is seen, but unread.
Definition: email.h:50
bool mime
Has a MIME-Version header?
Definition: email.h:42
struct Envelope * env
Envelope information.
Definition: email.h:90
A new Email has just been created.
Definition: email.h:139
short attach_total
Number of qualifying attachments in message, if attach_valid.
Definition: email.h:97
bool superseded
Got superseded?
Definition: email.h:53
struct TagList tags
For drivers that support server tagging.
Definition: email.h:109
bool quasi_deleted
Deleted from neomutt, but not modified on disk.
Definition: email.h:47
bool trash
Message is marked as trashed on disk (used by the maildir_trash option)
Definition: email.h:60
int score
Message score.
Definition: email.h:89
time_t date_sent
Time when the message was sent (UTC)
Definition: email.h:82
bool visible
Is this message part of the view?
Definition: email.h:74
struct ListHead chain
Mixmaster chain.
Definition: email.h:102
bool active
Message is not to be removed.
Definition: email.h:59
size_t email_size(const struct Email *e)
compute the size of an email
Definition: email.c:117
size_t num_hidden
Number of hidden messages in this view (only valid when collapsed is set)
Definition: email.h:75
void(* edata_free)(void **ptr)
Free the private data attached to the Email.
Definition: email.h:117
size_t sequence
Sequence number assigned on creation.
Definition: email.h:99
bool attach_valid
true when the attachment count is valid
Definition: email.h:70
struct Email * email_new(void)
Create a new Email.
Definition: email.c:72
API for encryption/signing of emails.
bool collapsed
Is this message part of a collapsed thread?
Definition: email.h:73
Notification API.
Definition: notify.c:39
bool purge
Skip trash folder when deleting.
Definition: email.h:46
int vnum
Virtual message number.
Definition: email.h:88
unsigned int zhours
Hours away from UTC.
Definition: email.h:63
char * tree
Character string to print thread tree.
Definition: email.h:94
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib...
Definition: email.h:39
struct Notify * notify
Notifications handler.
Definition: email.h:119
Types of Email Event.
Definition: email.h:137
LOFF_T offset
Where in the stream does this message begin?
Definition: email.h:84
An Email is about to be destroyed.
Definition: email.h:140
An Email conversation.
Definition: thread.h:34
STAILQ_HEAD(EmailList, EmailNode)
int emaillist_add_email(struct EmailList *el, struct Email *e)
Add an Email to a list.
Definition: email.c:151
bool flagged
Marked important?
Definition: email.h:43
bool deleted
Email is deleted.
Definition: email.h:45
void * edata
Driver-specific data.
Definition: email.h:111
struct Email * email
Email in the list.
Definition: email.h:127
bool replied
Email has been replied to.
Definition: email.h:54
char * path
Path of Email (for local Mailboxes)
Definition: email.h:92
int index
The absolute (unsorted) message number.
Definition: email.h:86
bool subject_changed
Used for threading.
Definition: email.h:55
Driver based email tags.
bool recip_valid
Is_recipient is valid.
Definition: email.h:58
List of Emails.
Definition: email.h:125
Convenience wrapper for the library headers.
unsigned int zminutes
Minutes away from UTC.
Definition: email.h:64
int pair
Color-pair to use when displaying in the index.
Definition: email.h:80
time_t received
Time when the message was placed in the mailbox.
Definition: email.h:83
The header of an Email.
Definition: envelope.h:54
bool matched
Search matches this Email.
Definition: email.h:68
int msgno
Number displayed to the user.
Definition: email.h:87
void * nm_edata
Notmuch private data.
Definition: email.h:106