NeoMutt  2021-02-05-666-ge300cd
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;
121  void (*edata_free)(void **ptr);
123  struct Notify *notify;
124 };
129 struct EmailNode
130 {
131  struct Email *email;
132  STAILQ_ENTRY(EmailNode) entries;
133 };
134 STAILQ_HEAD(EmailList, EmailNode);
145 {
150 };
156 {
158  struct Email **emails;
159 };
167 {
171 };
177 {
178  char *header;
179 };
181 bool email_cmp_strict(const struct Email *e1, const struct Email *e2);
182 void email_free (struct Email **ptr);
183 struct Email *email_new (void);
184 size_t email_size (const struct Email *e);
186 int emaillist_add_email(struct EmailList *el, struct Email *e);
187 void emaillist_clear (struct EmailList *el);
189 struct ListNode *header_add (struct ListHead *hdrlist, const char *header);
190 struct ListNode *header_find (const struct ListHead *hdrlist, const char *header);
191 void header_free (struct ListHead *hdrlist, struct ListNode *target);
192 struct ListNode *header_set (struct ListHead *hdrlist, const char *header);
193 struct ListNode *header_update(struct ListNode *hdrnode, const char *header);
195 #endif /* MUTT_EMAIL_EMAIL_H */
An Event that happened to an Email.
Definition: email.h:155
int lines
How many lines in the body of this message?
Definition: email.h:85
An existing header has been changed.
Definition: email.h:170
The envelope/body of an email.
Definition: email.h:37
struct Body * body
List of MIME parts.
Definition: email.h:91
An event that happened to a header.
Definition: email.h:176
Types of Header Event.
Definition: email.h:166
Header has been removed.
Definition: email.h:169
char * header
The contents of the header.
Definition: email.h:178
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:71
struct ListNode * header_find(const struct ListHead *hdrlist, const char *header)
Find a header, matching on its field, in a list of headers.
Definition: email.c:180
bool searched
Email has been searched.
Definition: email.h:67
#define STAILQ_ENTRY(type)
Definition: queue.h:327
struct Email ** emails
Definition: email.h:158
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:44
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:100
void emaillist_clear(struct EmailList *el)
Drop a private list of Emails.
Definition: email.c:138
Email is about to be deleted.
Definition: email.h:147
int num_emails
Definition: email.h:157
bool tagged
Email is tagged.
Definition: email.h:44
bool read
Email is read.
Definition: email.h:51
struct ListNode * header_update(struct ListNode *hdrnode, const char *header)
Update an existing header.
Definition: email.c:217
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
Email has been added.
Definition: email.h:146
Header has been added.
Definition: email.h:168
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
struct ListNode * header_add(struct ListHead *hdrlist, const char *header)
Add a header to a list.
Definition: email.c:203
size_t email_size(const struct Email *e)
compute the size of an email
Definition: email.c:125
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:121
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:78
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:50
bool purge
Skip trash folder when deleting.
Definition: email.h:46
int vnum
Virtual message number.
Definition: email.h:88
Email has changed.
Definition: email.h:149
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: NotifyEmail, EventEmail.
Definition: email.h:123
Types of Email Event.
Definition: email.h:144
All the Emails are about to be deleted.
Definition: email.h:148
LOFF_T offset
Where in the stream does this message begin?
Definition: email.h:84
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:159
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:131
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:129
Convenience wrapper for the library headers.
A List node for strings.
Definition: list.h:34
struct ListNode * header_set(struct ListHead *hdrlist, const char *header)
Set a header value in a list.
Definition: email.c:233
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
void header_free(struct ListHead *hdrlist, struct ListNode *target)
Free and remove a header from a header list.
Definition: email.c:245
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