NeoMutt  2019-12-07-60-g0cfa53
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/mutt.h"
31 #include "ncrypt/ncrypt.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 limited : 1;
75  size_t num_hidden;
76 
77  short recipient;
78 
79  int pair;
80 
81  time_t date_sent;
82  time_t received;
83  LOFF_T offset;
84  int lines;
85  int index;
86  int msgno;
87  int vnum;
88  int score;
89  struct Envelope *env;
90  struct Body *content;
91  char *path;
92 
93  char *tree;
94  struct MuttThread *thread;
95 
96  short attach_total;
97 
98 #ifdef MIXMASTER
99  struct ListHead chain;
100 #endif
101 
102  struct TagList tags;
103 
105 
106  void *edata;
107  void (*free_edata)(void **);
108  struct Notify *notify;
109 };
110 
114 struct EmailNode
115 {
116  struct Email *email;
117  STAILQ_ENTRY(EmailNode) entries;
118 };
119 STAILQ_HEAD(EmailList, EmailNode);
120 
125 {
127  struct Email **emails;
128 };
129 
134 {
138 };
139 
140 bool email_cmp_strict(const struct Email *e1, const struct Email *e2);
141 void email_free (struct Email **ptr);
142 struct Email *email_new (void);
143 size_t email_size (const struct Email *e);
144 
145 int emaillist_add_email(struct EmailList *el, struct Email *e);
146 void emaillist_clear (struct EmailList *el);
147 
148 #endif /* MUTT_EMAIL_EMAIL_H */
void(* free_edata)(void **)
Driver-specific data free function.
Definition: email.h:107
An Event that happened to an Email.
Definition: email.h:124
int lines
How many lines in the body of this message?
Definition: email.h:84
The envelope/body of an email.
Definition: email.h:37
struct MuttThread * thread
Thread of Emails.
Definition: email.h:94
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:77
struct Body * content
List of MIME parts.
Definition: email.h:90
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
bool searched
Email has been searched.
Definition: email.h:67
#define STAILQ_ENTRY(type)
Definition: queue.h:324
struct Email ** emails
Definition: email.h:127
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:41
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:84
void emaillist_clear(struct EmailList *el)
Drop a private list of Emails.
Definition: email.c:123
int num_emails
Definition: email.h:126
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:89
short attach_total
Number of qualifying attachments in message, if attach_valid.
Definition: email.h:96
bool superseded
Got superseded?
Definition: email.h:53
bool limited
Is this message in a limited view?
Definition: email.h:74
struct TagList tags
For drivers that support server tagging.
Definition: email.h:102
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:88
time_t date_sent
Time when the message was sent (UTC)
Definition: email.h:81
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:110
size_t num_hidden
Number of hidden messages in this view.
Definition: email.h:75
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:68
bool collapsed
Is this message part of a collapsed thread?
Definition: email.h:73
Notification API.
Definition: notify.c:40
bool purge
Skip trash folder when deleting.
Definition: email.h:46
int vnum
Virtual message number.
Definition: email.h:87
API for encryption/signing of emails.
unsigned int zhours
Hours away from UTC.
Definition: email.h:63
char * tree
Character string to print thread tree.
Definition: email.h:93
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/ncrypt.h pgplib.h, smime.h
Definition: email.h:39
struct Notify * notify
Notifications handler.
Definition: email.h:108
NotifyEmail
Types of Email Event.
Definition: email.h:133
LOFF_T offset
Where in the stream does this message begin?
Definition: email.h:83
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:144
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:106
struct Email * email
Email in the list.
Definition: email.h:116
bool replied
Email has been replied to.
Definition: email.h:54
char * maildir_flags
Unknown maildir flags.
Definition: email.h:104
char * path
Path of Email (for local Mailboxes)
Definition: email.h:91
int index
The absolute (unsorted) message number.
Definition: email.h:85
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:114
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: ncrypt.h:120
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:79
time_t received
Time when the message was placed in the mailbox.
Definition: email.h:82
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:86