NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
DOXYGEN
email.h
Go to the documentation of this file.
1 
23 #ifndef MUTT_EMAIL_EMAIL_H
24 #define MUTT_EMAIL_EMAIL_H
25 
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"
33 
37 struct Email
38 {
40 
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;
61 
62  // timezone of the sender of this message
63  unsigned int zhours : 5;
64  unsigned int zminutes : 6;
65  bool zoccident : 1;
66 
67  bool searched : 1;
68  bool matched : 1;
69 
70  bool attach_valid : 1;
71 
72  // the following are used to support collapsing threads
73  bool collapsed : 1;
74  bool visible : 1;
75  size_t num_hidden;
76 
78  short recipient;
79 
80  int pair;
81 
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;
93 
94  char *tree;
95  struct MuttThread *thread;
96 
97  short attach_total;
98 
99  size_t sequence;
100 
101 #ifdef MIXMASTER
102  struct ListHead chain;
103 #endif
104 
105 #ifdef USE_NOTMUCH
106  void *nm_edata;
107 #endif
108 
109  struct TagList tags;
110 
111  void *edata;
112 
117  void (*edata_free)(void **ptr);
118 
119  struct Notify *notify;
120 };
121 
125 struct EmailNode
126 {
127  struct Email *email;
128  STAILQ_ENTRY(EmailNode) entries;
129 };
130 STAILQ_HEAD(EmailList, EmailNode);
131 
138 {
141 };
142 
147 {
149  struct Email **emails;
150 };
151 
158 {
162 };
163 
168 {
169  char *header;
170 };
171 
172 bool email_cmp_strict(const struct Email *e1, const struct Email *e2);
173 void email_free (struct Email **ptr);
174 struct Email *email_new (void);
175 size_t email_size (const struct Email *e);
176 
177 int emaillist_add_email(struct EmailList *el, struct Email *e);
178 void emaillist_clear (struct EmailList *el);
179 
180 struct ListNode *header_add (struct ListHead *hdrlist, const char *header);
181 struct ListNode *header_find (const struct ListHead *hdrlist, const char *header);
182 void header_free (struct ListHead *hdrlist, struct ListNode *target);
183 struct ListNode *header_set (struct ListHead *hdrlist, const char *header);
184 struct ListNode *header_update(struct ListNode *hdrnode, const char *header);
185 
186 #endif /* MUTT_EMAIL_EMAIL_H */
NotifyEmail
NotifyEmail
Types of Email Event.
Definition: email.h:137
Envelope
The header of an Email.
Definition: envelope.h:54
Email::date_sent
time_t date_sent
Time when the message was sent (UTC)
Definition: email.h:82
header_set
struct ListNode * header_set(struct ListHead *hdrlist, const char *header)
Set a header value in a list.
Definition: email.c:225
Email::msgno
int msgno
Number displayed to the user.
Definition: email.h:87
Email::mime
bool mime
Has a MIME-Version header?
Definition: email.h:42
Email::subject_changed
bool subject_changed
Used for threading.
Definition: email.h:55
email_new
struct Email * email_new(void)
Create a new Email.
Definition: email.c:72
Email::lines
int lines
How many lines in the body of this message?
Definition: email.h:85
Email::matched
bool matched
Search matches this Email.
Definition: email.h:68
EmailNode::STAILQ_ENTRY
STAILQ_ENTRY(EmailNode) entries
Linked list.
ListNode
A List node for strings.
Definition: list.h:34
Email::thread
struct MuttThread * thread
Thread of Emails.
Definition: email.h:95
Body
The body of an email.
Definition: body.h:34
NT_HEADER_CHANGE
@ NT_HEADER_CHANGE
An existing header has been changed.
Definition: email.h:160
tags.h
header_free
void header_free(struct ListHead *hdrlist, struct ListNode *target)
Free and remove a header from a header list.
Definition: email.c:237
Email::num_hidden
size_t num_hidden
Number of hidden messages in this view (only valid when collapsed is set)
Definition: email.h:75
Email::offset
LOFF_T offset
Where in the stream does this message begin?
Definition: email.h:84
EmailNode::email
struct Email * email
Email in the list.
Definition: email.h:127
emaillist_add_email
int emaillist_add_email(struct EmailList *el, struct Email *e)
Add an Email to a list.
Definition: email.c:151
EventEmail::emails
struct Email ** emails
Definition: email.h:149
EmailNode
List of Emails.
Definition: email.h:125
Email::path
char * path
Path of Email (for local Mailboxes)
Definition: email.h:92
Email::edata_free
void(* edata_free)(void **ptr)
Free the private data attached to the Email.
Definition: email.h:117
SecurityFlags
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:83
email_cmp_strict
bool email_cmp_strict(const struct Email *e1, const struct Email *e2)
Strictly compare message emails.
Definition: email.c:92
Email::recipient
short recipient
User_is_recipient()'s return value, cached.
Definition: email.h:78
Email::zoccident
bool zoccident
True, if west of UTC, False if east.
Definition: email.h:65
Email::sequence
size_t sequence
Sequence number assigned on creation.
Definition: email.h:99
Email::tree
char * tree
Character string to print thread tree.
Definition: email.h:94
Email::old
bool old
Email is seen, but unread.
Definition: email.h:50
Email::received
time_t received
Time when the message was placed in the mailbox.
Definition: email.h:83
EventHeader
An event that happened to a header.
Definition: email.h:167
Email::active
bool active
Message is not to be removed.
Definition: email.h:59
NT_EMAIL_ADD
@ NT_EMAIL_ADD
A new Email has just been created.
Definition: email.h:139
EventEmail::num_emails
int num_emails
Definition: email.h:148
Email::visible
bool visible
Is this message part of the view?
Definition: email.h:74
lib.h
Email::tagged
bool tagged
Email is tagged.
Definition: email.h:44
Email::zminutes
unsigned int zminutes
Minutes away from UTC.
Definition: email.h:64
Email::notify
struct Notify * notify
Notifications handler.
Definition: email.h:119
Email::expired
bool expired
Already expired?
Definition: email.h:52
NotifyHeader
NotifyHeader
Types of Header Event.
Definition: email.h:157
Email::display_subject
bool display_subject
Used for threading.
Definition: email.h:57
Email::env
struct Envelope * env
Envelope information.
Definition: email.h:90
MuttThread
An Email conversation.
Definition: thread.h:34
Email::purge
bool purge
Skip trash folder when deleting.
Definition: email.h:46
EventHeader::header
char * header
The contents of the header.
Definition: email.h:169
Email::attach_total
short attach_total
Number of qualifying attachments in message, if attach_valid.
Definition: email.h:97
NT_HEADER_REMOVE
@ NT_HEADER_REMOVE
A header is about to be removed.
Definition: email.h:161
Email::flagged
bool flagged
Marked important?
Definition: email.h:43
Email::zhours
unsigned int zhours
Hours away from UTC.
Definition: email.h:63
Email::chain
struct ListHead chain
Mixmaster chain.
Definition: email.h:102
Email::security
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Definition: email.h:39
Email::collapsed
bool collapsed
Is this message part of a collapsed thread?
Definition: email.h:73
Email::trash
bool trash
Message is marked as trashed on disk (used by the maildir_trash option)
Definition: email.h:60
Email::score
int score
Message score.
Definition: email.h:89
NT_HEADER_ADD
@ NT_HEADER_ADD
A new header has been added.
Definition: email.h:159
lib.h
Email::deleted
bool deleted
Email is deleted.
Definition: email.h:45
header_find
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:172
email_free
void email_free(struct Email **ptr)
Free an Email.
Definition: email.c:43
Notify
Notification API.
Definition: notify.c:39
header_add
struct ListNode * header_add(struct ListHead *hdrlist, const char *header)
Add a header to a list.
Definition: email.c:195
Email::edata
void * edata
Driver-specific data.
Definition: email.h:111
Email::tags
struct TagList tags
For drivers that support server tagging.
Definition: email.h:109
email_size
size_t email_size(const struct Email *e)
compute the size of an email
Definition: email.c:117
NT_EMAIL_REMOVE
@ NT_EMAIL_REMOVE
An Email is about to be destroyed.
Definition: email.h:140
Email::recip_valid
bool recip_valid
Is_recipient is valid.
Definition: email.h:58
Email::searched
bool searched
Email has been searched.
Definition: email.h:67
Email::vnum
int vnum
Virtual message number.
Definition: email.h:88
Email::index
int index
The absolute (unsorted) message number.
Definition: email.h:86
Email::attach_valid
bool attach_valid
true when the attachment count is valid
Definition: email.h:70
Email::attach_del
bool attach_del
Has an attachment marked for deletion.
Definition: email.h:49
STAILQ_HEAD
STAILQ_HEAD(EmailList, EmailNode)
emaillist_clear
void emaillist_clear(struct EmailList *el)
Drop a private list of Emails.
Definition: email.c:130
EventEmail
An Event that happened to an Email.
Definition: email.h:146
Email::replied
bool replied
Email has been replied to.
Definition: email.h:54
Email
The envelope/body of an email.
Definition: email.h:37
Email::threaded
bool threaded
Used for threading.
Definition: email.h:56
header_update
struct ListNode * header_update(struct ListNode *hdrnode, const char *header)
Update an existing header.
Definition: email.c:209
Email::superseded
bool superseded
Got superseded?
Definition: email.h:53
Email::read
bool read
Email is read.
Definition: email.h:51
Email::quasi_deleted
bool quasi_deleted
Deleted from neomutt, but not modified on disk.
Definition: email.h:47
Email::changed
bool changed
Email has been edited.
Definition: email.h:48
Email::nm_edata
void * nm_edata
Notmuch private data.
Definition: email.h:106
Email::pair
int pair
Color-pair to use when displaying in the index.
Definition: email.h:80
Email::body
struct Body * body
List of MIME parts.
Definition: email.h:91