NeoMutt  2024-02-01-35-geee02f
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
email.h
Go to the documentation of this file.
1
25#ifndef MUTT_EMAIL_EMAIL_H
26#define MUTT_EMAIL_EMAIL_H
27
28#include "config.h"
29#include <stdbool.h>
30#include <time.h>
31#include "mutt/lib.h"
32#include "ncrypt/lib.h"
33#include "tags.h"
34
38struct Email
39{
40 // ---------------------------------------------------------------------------
41 // Data that gets stored in the Header Cache
42
45
46 bool expired : 1;
47 bool flagged : 1;
48 bool mime : 1;
49 bool old : 1;
50 bool read : 1;
51 bool replied : 1;
52 bool superseded : 1;
53 bool trash : 1;
54
55 // Timezone of the sender of this message
56 unsigned int zhours : 5;
57 unsigned int zminutes : 6;
58 bool zoccident : 1;
59
60 time_t date_sent;
61 time_t received;
62 int lines;
63
64 // ---------------------------------------------------------------------------
65 // Management data - Runtime info and glue to hold the objects together
66
67 size_t sequence;
68 struct Envelope *env;
69 struct Body *body;
70 char *path;
71 LOFF_T offset;
72 struct TagList tags;
73 struct Notify *notify;
74 void *edata;
75
76 bool active : 1;
77 bool changed : 1;
78 bool deleted : 1;
79 bool purge : 1;
80
90 void (*edata_free)(void **ptr);
91
92#ifdef MIXMASTER
93 struct ListHead chain;
94#endif
95#ifdef USE_NOTMUCH
96 void *nm_edata;
97#endif
98
99 // ---------------------------------------------------------------------------
100 // View data - Used by the GUI
101
102 bool attach_del : 1;
103 bool attach_valid : 1;
105 bool matched : 1;
106 bool quasi_deleted : 1;
107 bool recip_valid : 1;
108 bool searched : 1;
110 bool tagged : 1;
111 bool threaded : 1;
112
113 int index;
114 int msgno;
115 const struct AttrColor *attr_color;
116 int score;
117 int vnum;
119 short recipient;
120
121 // The following are used to support collapsing threads
123 bool collapsed : 1;
124 bool visible : 1;
125 bool limit_visited : 1;
126 size_t num_hidden;
128 char *tree;
129};
130ARRAY_HEAD(EmailArray, struct Email *);
131
136{
137 struct Email *email;
139};
140
150{
158};
159
164{
166 struct Email **emails;
167};
168
175{
179};
180
185{
186 char *header;
187};
188
189bool email_cmp_strict(const struct Email *e1, const struct Email *e2);
190void email_free (struct Email **ptr);
191struct Email *email_new (void);
192size_t email_size (const struct Email *e);
193
194struct ListNode *header_add (struct ListHead *hdrlist, const char *header);
195struct ListNode *header_find (const struct ListHead *hdrlist, const char *header);
196void header_free (struct ListHead *hdrlist, struct ListNode *target);
197struct ListNode *header_set (struct ListHead *hdrlist, const char *header);
198struct ListNode *header_update(struct ListNode *hdrnode, const char *header);
199
200#endif /* MUTT_EMAIL_EMAIL_H */
#define ARRAY_HEAD(name, type)
Define a named struct for arrays of elements of a certain type.
Definition: array.h:47
struct ListNode * header_update(struct ListNode *hdrnode, const char *header)
Update an existing header.
Definition: email.c:180
NotifyHeader
Types of Header Event.
Definition: email.h:175
@ NT_HEADER_CHANGE
An existing header has been changed.
Definition: email.h:178
@ NT_HEADER_ADD
Header has been added.
Definition: email.h:176
@ NT_HEADER_DELETE
Header has been removed.
Definition: email.h:177
bool email_cmp_strict(const struct Email *e1, const struct Email *e2)
Strictly compare message emails.
Definition: email.c:102
void header_free(struct ListHead *hdrlist, struct ListNode *target)
Free and remove a header from a header list.
Definition: email.c:208
size_t email_size(const struct Email *e)
Compute the size of an email.
Definition: email.c:127
struct Email * email_new(void)
Create a new Email.
Definition: email.c:80
NotifyEmail
Types of Email Event.
Definition: email.h:150
@ NT_EMAIL_ADD
Email has been added.
Definition: email.h:151
@ NT_EMAIL_DELETE
Email is about to be deleted.
Definition: email.h:152
@ NT_EMAIL_CHANGE_SECURITY
Email's security settings have changed.
Definition: email.h:157
@ NT_EMAIL_DELETE_ALL
All the Emails are about to be deleted.
Definition: email.h:153
@ NT_EMAIL_CHANGE
Email has changed.
Definition: email.h:154
@ NT_EMAIL_CHANGE_ATTACH
Email's Attachments have changed.
Definition: email.h:156
@ NT_EMAIL_CHANGE_ENVELOPE
Email's Envelope has changed.
Definition: email.h:155
struct ListNode * header_set(struct ListHead *hdrlist, const char *header)
Set a header value in a list.
Definition: email.c:196
struct ListNode * header_add(struct ListHead *hdrlist, const char *header)
Add a header to a list.
Definition: email.c:166
void email_free(struct Email **ptr)
Free an Email.
Definition: email.c:46
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:143
Convenience wrapper for the library headers.
API for encryption/signing of emails.
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:76
A curses colour and its attributes.
Definition: attr.h:66
The body of an email.
Definition: body.h:36
List of Emails.
Definition: email.h:136
STAILQ_ENTRY(EmailNode) entries
Linked list.
struct Email * email
Email in the list.
Definition: email.h:137
The envelope/body of an email.
Definition: email.h:39
bool searched
Email has been searched.
Definition: email.h:108
bool read
Email is read.
Definition: email.h:50
unsigned int zminutes
Minutes away from UTC.
Definition: email.h:57
bool matched
Search matches this Email.
Definition: email.h:105
bool display_subject
Used for threading.
Definition: email.h:104
bool visible
Is this message part of the view?
Definition: email.h:124
bool purge
Skip trash folder when deleting.
Definition: email.h:79
bool recip_valid
Is_recipient is valid.
Definition: email.h:107
bool attach_valid
true when the attachment count is valid
Definition: email.h:103
struct Envelope * env
Envelope information.
Definition: email.h:68
bool limit_visited
Has the limit pattern been applied to this message?
Definition: email.h:125
bool mime
Has a MIME-Version header?
Definition: email.h:48
void * edata
Driver-specific data.
Definition: email.h:74
bool collapsed
Is this message part of a collapsed thread?
Definition: email.h:123
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
bool subject_changed
Used for threading.
Definition: email.h:109
bool active
Message is not to be removed.
Definition: email.h:76
void * nm_edata
Notmuch private data.
Definition: email.h:96
char * tree
Character string to print thread tree.
Definition: email.h:128
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:126
void(* edata_free)(void **ptr)
Definition: email.h:90
bool zoccident
True, if west of UTC, False if east.
Definition: email.h:58
bool changed
Email has been edited.
Definition: email.h:77
LOFF_T offset
Where in the stream does this message begin?
Definition: email.h:71
bool attach_del
Has an attachment marked for deletion.
Definition: email.h:102
bool flagged
Marked important?
Definition: email.h:47
short attach_total
Number of qualifying attachments in message, if attach_valid.
Definition: email.h:118
bool threaded
Used for threading.
Definition: email.h:111
struct ListHead chain
Mixmaster chain.
Definition: email.h:93
const struct AttrColor * attr_color
Color-pair to use when displaying in the index.
Definition: email.h:115
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
int vnum
Virtual message number.
Definition: email.h:117
bool expired
Already expired?
Definition: email.h:46
struct TagList tags
For drivers that support server tagging.
Definition: email.h:72
struct Notify * notify
Notifications: NotifyEmail, EventEmail.
Definition: email.h:73
int score
Message score.
Definition: email.h:116
int msgno
Number displayed to the user.
Definition: email.h:114
char * path
Path of Email (for local Mailboxes)
Definition: email.h:70
size_t sequence
Sequence number assigned on creation.
Definition: email.h:67
bool deleted
Email is deleted.
Definition: email.h:78
int index
The absolute (unsorted) message number.
Definition: email.h:113
bool trash
Message is marked as trashed on disk (used by the maildir_trash option)
Definition: email.h:53
short recipient
User_is_recipient()'s return value, cached.
Definition: email.h:119
bool quasi_deleted
Deleted from neomutt, but not modified on disk.
Definition: email.h:106
bool tagged
Email is tagged.
Definition: email.h:110
bool superseded
Got superseded?
Definition: email.h:52
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:122
The header of an Email.
Definition: envelope.h:57
An Event that happened to an Email.
Definition: email.h:164
int num_emails
Number of Emails the event applies to.
Definition: email.h:165
struct Email ** emails
Emails affected by the event.
Definition: email.h:166
An event that happened to a header.
Definition: email.h:185
char * header
The contents of the header.
Definition: email.h:186
A List node for strings.
Definition: list.h:35
An Email conversation.
Definition: thread.h:34
Notification API.
Definition: notify.c:53
Driver based email tags.