NeoMutt  2022-04-29-145-g9b6a0e
Teaching an old dog new tricks
DOXYGEN
envelope.h
Go to the documentation of this file.
1 
24 #ifndef MUTT_EMAIL_ENVELOPE_H
25 #define MUTT_EMAIL_ENVELOPE_H
26 
27 #include "config.h"
28 #include <stdbool.h>
29 #include "mutt/lib.h"
30 #include "address/lib.h"
31 
32 struct Email;
33 
34 #define MUTT_ENV_CHANGED_IRT (1 << 0)
35 #define MUTT_ENV_CHANGED_REFS (1 << 1)
36 #define MUTT_ENV_CHANGED_XLABEL (1 << 2)
37 #define MUTT_ENV_CHANGED_SUBJECT (1 << 3)
38 
39 #ifdef USE_AUTOCRYPT
44 {
45  char *addr;
46  char *keydata;
47  bool prefer_encrypt : 1;
48  bool invalid : 1;
50 };
51 #endif
52 
56 struct Envelope
57 {
58  struct AddressList return_path;
59  struct AddressList from;
60  struct AddressList to;
61  struct AddressList cc;
62  struct AddressList bcc;
63  struct AddressList sender;
64  struct AddressList reply_to;
65  struct AddressList mail_followup_to;
66  struct AddressList x_original_to;
67  char *list_post;
70  char *subject;
71  char *real_subj;
72  char *disp_subj;
73  char *message_id;
74  char *supersedes;
75  char *date;
76  char *x_label;
77  char *organization;
78 #ifdef USE_NNTP
79  char *newsgroups;
80  char *xref;
81  char *followup_to;
82  char *x_comment_to;
83 #endif
84  struct Buffer spam;
85  struct ListHead references;
86  struct ListHead in_reply_to;
87  struct ListHead userhdrs;
88 #ifdef USE_AUTOCRYPT
91 #endif
92  unsigned char changed;
93 };
94 
104 {
116 };
117 
118 bool mutt_env_cmp_strict (const struct Envelope *e1, const struct Envelope *e2);
119 void mutt_env_free (struct Envelope **ptr);
120 void mutt_env_merge (struct Envelope *base, struct Envelope **extra);
121 struct Envelope *mutt_env_new (void);
122 bool mutt_env_notify_send(struct Email *e, enum NotifyEnvelope type);
123 int mutt_env_to_intl (struct Envelope *env, const char **tag, char **err);
124 void mutt_env_to_local (struct Envelope *env);
125 
126 #ifdef USE_AUTOCRYPT
128 void mutt_autocrypthdr_free(struct AutocryptHeader **p);
129 #endif
130 
131 #endif /* MUTT_EMAIL_ENVELOPE_H */
Email Address Handling.
int mutt_env_to_intl(struct Envelope *env, const char **tag, char **err)
Convert an Envelope's Address fields to Punycode format.
Definition: envelope.c:326
void mutt_env_merge(struct Envelope *base, struct Envelope **extra)
Merge the headers of two Envelopes.
Definition: envelope.c:166
void mutt_env_free(struct Envelope **ptr)
Free an Envelope.
Definition: envelope.c:97
NotifyEnvelope
Types of Envelope Event.
Definition: envelope.h:104
@ NT_ENVELOPE_SUBJECT
"Subject:" header has changed
Definition: envelope.h:113
@ NT_ENVELOPE_BCC
"Bcc:" header has changed
Definition: envelope.h:105
@ NT_ENVELOPE_TO
"To:" header has changed
Definition: envelope.h:114
@ NT_ENVELOPE_FCC
"Fcc:" header has changed
Definition: envelope.h:107
@ NT_ENVELOPE_CC
"Cc:" header has changed
Definition: envelope.h:106
@ NT_ENVELOPE_MIXMASTER
MixMaster chain has changed.
Definition: envelope.h:110
@ NT_ENVELOPE_REPLY_TO
"Reply-To:" header has changed
Definition: envelope.h:112
@ NT_ENVELOPE_FROM
"From:" header has changed
Definition: envelope.h:109
@ NT_ENVELOPE_X_COMMENT_TO
"X-Comment-To:" header has changed
Definition: envelope.h:115
@ NT_ENVELOPE_FOLLOWUP_TO
"Followup-To:" header has changed
Definition: envelope.h:108
@ NT_ENVELOPE_NEWSGROUPS
"Newsgroups:" header has changed
Definition: envelope.h:111
struct Envelope * mutt_env_new(void)
Create a new Envelope.
Definition: envelope.c:43
void mutt_autocrypthdr_free(struct AutocryptHeader **p)
Free an AutocryptHeader.
Definition: envelope.c:75
struct AutocryptHeader * mutt_autocrypthdr_new(void)
Create a new AutocryptHeader.
Definition: envelope.c:66
bool mutt_env_notify_send(struct Email *e, enum NotifyEnvelope type)
Send an Envelope change notification.
Definition: envelope.c:152
bool mutt_env_cmp_strict(const struct Envelope *e1, const struct Envelope *e2)
Strictly compare two Envelopes.
Definition: envelope.c:258
void mutt_env_to_local(struct Envelope *env)
Convert an Envelope's Address fields to local format.
Definition: envelope.c:288
Convenience wrapper for the library headers.
Parse Autocrypt header info.
Definition: envelope.h:44
bool invalid
Header is invalid.
Definition: envelope.h:48
struct AutocryptHeader * next
Linked list.
Definition: envelope.h:49
char * keydata
PGP Key data.
Definition: envelope.h:46
bool prefer_encrypt
User prefers encryption.
Definition: envelope.h:47
char * addr
Email address.
Definition: envelope.h:45
String manipulation buffer.
Definition: buffer.h:34
The envelope/body of an email.
Definition: email.h:37
The header of an Email.
Definition: envelope.h:57
struct ListHead userhdrs
user defined headers
Definition: envelope.h:87
char * supersedes
Supersedes header.
Definition: envelope.h:74
char * list_subscribe
This stores a mailto URL, or nothing.
Definition: envelope.h:68
struct AddressList return_path
Return path for the Email.
Definition: envelope.h:58
struct AddressList to
Email's 'To' list.
Definition: envelope.h:60
unsigned char changed
Changed fields, e.g. MUTT_ENV_CHANGED_SUBJECT.
Definition: envelope.h:92
char * followup_to
List of 'followup-to' fields.
Definition: envelope.h:81
struct AddressList reply_to
Email's 'reply-to'.
Definition: envelope.h:64
char * message_id
Message ID.
Definition: envelope.h:73
char * x_comment_to
List of 'X-comment-to' fields.
Definition: envelope.h:82
struct AddressList x_original_to
Email's 'X-Orig-to'.
Definition: envelope.h:66
struct AutocryptHeader * autocrypt_gossip
Autocrypt Gossip header.
Definition: envelope.h:90
char * newsgroups
List of newsgroups.
Definition: envelope.h:79
struct AddressList mail_followup_to
Email's 'mail-followup-to'.
Definition: envelope.h:65
struct AddressList cc
Email's 'Cc' list.
Definition: envelope.h:61
struct AddressList sender
Email's sender.
Definition: envelope.h:63
struct ListHead references
message references (in reverse order)
Definition: envelope.h:85
struct AutocryptHeader * autocrypt
Autocrypt header.
Definition: envelope.h:89
struct Buffer spam
Spam header.
Definition: envelope.h:84
struct ListHead in_reply_to
in-reply-to header content
Definition: envelope.h:86
char * subject
Email's subject.
Definition: envelope.h:70
struct AddressList bcc
Email's 'Bcc' list.
Definition: envelope.h:62
char * xref
List of cross-references.
Definition: envelope.h:80
char * organization
Organisation header.
Definition: envelope.h:77
char * x_label
X-Label.
Definition: envelope.h:76
char * list_post
This stores a mailto URL, or nothing.
Definition: envelope.h:67
char * date
Sent date.
Definition: envelope.h:75
char * real_subj
Offset of the real subject.
Definition: envelope.h:71
char * disp_subj
Display subject (modified copy of subject)
Definition: envelope.h:72
char * list_unsubscribe
This stores a mailto URL, or nothing.
Definition: envelope.h:69
struct AddressList from
Email's 'From' list.
Definition: envelope.h:59