NeoMutt  2024-04-16-36-g75b6fb
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
envelope.h File Reference

Representation of an email header (envelope) More...

#include "config.h"
#include <stdbool.h>
#include "mutt/lib.h"
#include "address/lib.h"
+ Include dependency graph for envelope.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  AutocryptHeader
 Parse Autocrypt header info. More...
 
struct  Envelope
 The header of an Email. More...
 

Macros

#define MUTT_ENV_CHANGED_IRT   (1 << 0)
 In-Reply-To changed to link/break threads.
 
#define MUTT_ENV_CHANGED_REFS   (1 << 1)
 References changed to break thread.
 
#define MUTT_ENV_CHANGED_XLABEL   (1 << 2)
 X-Label edited.
 
#define MUTT_ENV_CHANGED_SUBJECT   (1 << 3)
 Protected header update.
 

Enumerations

enum  ExpandoDataEnvelope {
  ED_ENV_CC_ALL = 1 , ED_ENV_FIRST_NAME , ED_ENV_FROM , ED_ENV_FROM_FULL ,
  ED_ENV_INITIALS , ED_ENV_LIST_ADDRESS , ED_ENV_LIST_EMPTY , ED_ENV_MESSAGE_ID ,
  ED_ENV_NAME , ED_ENV_NEWSGROUP , ED_ENV_ORGANIZATION , ED_ENV_REAL_NAME ,
  ED_ENV_REPLY_TO , ED_ENV_SENDER , ED_ENV_SENDER_PLAIN , ED_ENV_SPAM ,
  ED_ENV_SUBJECT , ED_ENV_THREAD_TREE , ED_ENV_THREAD_X_LABEL , ED_ENV_TO ,
  ED_ENV_TO_ALL , ED_ENV_USERNAME , ED_ENV_USER_NAME , ED_ENV_X_COMMENT_TO ,
  ED_ENV_X_LABEL
}
 Expando UIDs for Envelopes. More...
 
enum  NotifyEnvelope {
  NT_ENVELOPE_BCC = 1 , NT_ENVELOPE_CC , NT_ENVELOPE_FCC , NT_ENVELOPE_FOLLOWUP_TO ,
  NT_ENVELOPE_FROM , NT_ENVELOPE_MIXMASTER , NT_ENVELOPE_NEWSGROUPS , NT_ENVELOPE_REPLY_TO ,
  NT_ENVELOPE_SUBJECT , NT_ENVELOPE_TO , NT_ENVELOPE_X_COMMENT_TO
}
 Types of Envelope Event. More...
 

Functions

bool mutt_env_cmp_strict (const struct Envelope *e1, const struct Envelope *e2)
 Strictly compare two Envelopes.
 
void mutt_env_free (struct Envelope **ptr)
 Free an Envelope.
 
void mutt_env_merge (struct Envelope *base, struct Envelope **extra)
 Merge the headers of two Envelopes.
 
struct Envelopemutt_env_new (void)
 Create a new Envelope.
 
bool mutt_env_notify_send (struct Email *e, enum NotifyEnvelope type)
 Send an Envelope change notification.
 
void mutt_env_set_subject (struct Envelope *env, const char *subj)
 Set both subject and real_subj to subj.
 
int mutt_env_to_intl (struct Envelope *env, const char **tag, char **err)
 Convert an Envelope's Address fields to Punycode format.
 
void mutt_env_to_local (struct Envelope *env)
 Convert an Envelope's Address fields to local format.
 
struct AutocryptHeadermutt_autocrypthdr_new (void)
 Create a new AutocryptHeader.
 
void mutt_autocrypthdr_free (struct AutocryptHeader **ptr)
 Free an AutocryptHeader.
 

Detailed Description

Representation of an email header (envelope)

Authors
  • Richard Russon
  • Pietro Cerutti

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file envelope.h.

Macro Definition Documentation

◆ MUTT_ENV_CHANGED_IRT

#define MUTT_ENV_CHANGED_IRT   (1 << 0)

In-Reply-To changed to link/break threads.

Definition at line 34 of file envelope.h.

◆ MUTT_ENV_CHANGED_REFS

#define MUTT_ENV_CHANGED_REFS   (1 << 1)

References changed to break thread.

Definition at line 35 of file envelope.h.

◆ MUTT_ENV_CHANGED_XLABEL

#define MUTT_ENV_CHANGED_XLABEL   (1 << 2)

X-Label edited.

Definition at line 36 of file envelope.h.

◆ MUTT_ENV_CHANGED_SUBJECT

#define MUTT_ENV_CHANGED_SUBJECT   (1 << 3)

Protected header update.

Definition at line 37 of file envelope.h.

Enumeration Type Documentation

◆ ExpandoDataEnvelope

Expando UIDs for Envelopes.

See also
ED_ENVELOPE, ExpandoDomain
Enumerator
ED_ENV_CC_ALL 

Envelope.cc.

ED_ENV_FIRST_NAME 

Envelope.from, Envelope.to, Envelope.cc.

ED_ENV_FROM 

Envelope.from (first)

ED_ENV_FROM_FULL 

Envelope.from (all)

ED_ENV_INITIALS 

Envelope.from (first)

ED_ENV_LIST_ADDRESS 

Envelope.to, Envelope.cc.

ED_ENV_LIST_EMPTY 

Envelope.to, Envelope.cc.

ED_ENV_MESSAGE_ID 

Envelope.message_id.

ED_ENV_NAME 

Envelope.from (first)

ED_ENV_NEWSGROUP 

Envelope.newsgroups.

ED_ENV_ORGANIZATION 

Envelope.organization.

ED_ENV_REAL_NAME 

Envelope.to (first)

ED_ENV_REPLY_TO 

Envelope.reply_to.

ED_ENV_SENDER 

Envelope, make_from()

ED_ENV_SENDER_PLAIN 

Envelope, make_from()

ED_ENV_SPAM 

Envelope.spam.

ED_ENV_SUBJECT 

Envelope.subject, Envelope.disp_subj.

ED_ENV_THREAD_TREE 

Email.tree.

ED_ENV_THREAD_X_LABEL 

Envelope.x_label.

ED_ENV_TO 

Envelope.to, Envelope.cc (first)

ED_ENV_TO_ALL 

Envelope.to (all)

ED_ENV_USERNAME 

Envelope.from.

ED_ENV_USER_NAME 

Envelope.to (first)

ED_ENV_X_COMMENT_TO 

Envelope.x_comment_to.

ED_ENV_X_LABEL 

Envelope.x_label.

Definition at line 98 of file envelope.h.

99{
100 ED_ENV_CC_ALL = 1,
119 ED_ENV_TO,
125};
@ ED_ENV_REAL_NAME
Envelope.to (first)
Definition: envelope.h:111
@ ED_ENV_SUBJECT
Envelope.subject, Envelope.disp_subj.
Definition: envelope.h:116
@ ED_ENV_NEWSGROUP
Envelope.newsgroups.
Definition: envelope.h:109
@ ED_ENV_INITIALS
Envelope.from (first)
Definition: envelope.h:104
@ ED_ENV_FROM_FULL
Envelope.from (all)
Definition: envelope.h:103
@ ED_ENV_X_COMMENT_TO
Envelope.x_comment_to.
Definition: envelope.h:123
@ ED_ENV_FROM
Envelope.from (first)
Definition: envelope.h:102
@ ED_ENV_LIST_ADDRESS
Envelope.to, Envelope.cc.
Definition: envelope.h:105
@ ED_ENV_SPAM
Envelope.spam.
Definition: envelope.h:115
@ ED_ENV_SENDER
Envelope, make_from()
Definition: envelope.h:113
@ ED_ENV_TO_ALL
Envelope.to (all)
Definition: envelope.h:120
@ ED_ENV_X_LABEL
Envelope.x_label.
Definition: envelope.h:124
@ ED_ENV_NAME
Envelope.from (first)
Definition: envelope.h:108
@ ED_ENV_CC_ALL
Envelope.cc.
Definition: envelope.h:100
@ ED_ENV_ORGANIZATION
Envelope.organization.
Definition: envelope.h:110
@ ED_ENV_REPLY_TO
Envelope.reply_to.
Definition: envelope.h:112
@ ED_ENV_LIST_EMPTY
Envelope.to, Envelope.cc.
Definition: envelope.h:106
@ ED_ENV_THREAD_X_LABEL
Envelope.x_label.
Definition: envelope.h:118
@ ED_ENV_MESSAGE_ID
Envelope.message_id.
Definition: envelope.h:107
@ ED_ENV_SENDER_PLAIN
Envelope, make_from()
Definition: envelope.h:114
@ ED_ENV_USER_NAME
Envelope.to (first)
Definition: envelope.h:122
@ ED_ENV_USERNAME
Envelope.from.
Definition: envelope.h:121
@ ED_ENV_THREAD_TREE
Email.tree.
Definition: envelope.h:117
@ ED_ENV_TO
Envelope.to, Envelope.cc (first)
Definition: envelope.h:119
@ ED_ENV_FIRST_NAME
Envelope.from, Envelope.to, Envelope.cc.
Definition: envelope.h:101

◆ NotifyEnvelope

Types of Envelope Event.

Observers of NT_ENVELOPE will not be passed any Event data.

Notifications that an Envelope field has changed. Envelope doesn't support notifications, so events will be passed to the Email.

Enumerator
NT_ENVELOPE_BCC 

"Bcc:" header has changed

NT_ENVELOPE_CC 

"Cc:" header has changed

NT_ENVELOPE_FCC 

"Fcc:" header has changed

NT_ENVELOPE_FOLLOWUP_TO 

"Followup-To:" header has changed

NT_ENVELOPE_FROM 

"From:" header has changed

NT_ENVELOPE_MIXMASTER 

MixMaster chain has changed.

NT_ENVELOPE_NEWSGROUPS 

"Newsgroups:" header has changed

NT_ENVELOPE_REPLY_TO 

"Reply-To:" header has changed

NT_ENVELOPE_SUBJECT 

"Subject:" header has changed

NT_ENVELOPE_TO 

"To:" header has changed

NT_ENVELOPE_X_COMMENT_TO 

"X-Comment-To:" header has changed

Definition at line 135 of file envelope.h.

136{
137 NT_ENVELOPE_BCC = 1,
148};
@ NT_ENVELOPE_SUBJECT
"Subject:" header has changed
Definition: envelope.h:145
@ NT_ENVELOPE_BCC
"Bcc:" header has changed
Definition: envelope.h:137
@ NT_ENVELOPE_TO
"To:" header has changed
Definition: envelope.h:146
@ NT_ENVELOPE_FCC
"Fcc:" header has changed
Definition: envelope.h:139
@ NT_ENVELOPE_CC
"Cc:" header has changed
Definition: envelope.h:138
@ NT_ENVELOPE_MIXMASTER
MixMaster chain has changed.
Definition: envelope.h:142
@ NT_ENVELOPE_REPLY_TO
"Reply-To:" header has changed
Definition: envelope.h:144
@ NT_ENVELOPE_FROM
"From:" header has changed
Definition: envelope.h:141
@ NT_ENVELOPE_X_COMMENT_TO
"X-Comment-To:" header has changed
Definition: envelope.h:147
@ NT_ENVELOPE_FOLLOWUP_TO
"Followup-To:" header has changed
Definition: envelope.h:140
@ NT_ENVELOPE_NEWSGROUPS
"Newsgroups:" header has changed
Definition: envelope.h:143

Function Documentation

◆ mutt_env_cmp_strict()

bool mutt_env_cmp_strict ( const struct Envelope e1,
const struct Envelope e2 
)

Strictly compare two Envelopes.

Parameters
e1First Envelope
e2Second Envelope
Return values
trueEnvelopes are strictly identical

Definition at line 285 of file envelope.c.

286{
287 if (e1 && e2)
288 {
289 if (!mutt_str_equal(e1->message_id, e2->message_id) ||
290 !mutt_str_equal(e1->subject, e2->subject) ||
292 !mutt_addrlist_equal(&e1->from, &e2->from) ||
293 !mutt_addrlist_equal(&e1->sender, &e2->sender) ||
295 !mutt_addrlist_equal(&e1->to, &e2->to) || !mutt_addrlist_equal(&e1->cc, &e2->cc) ||
297 {
298 return false;
299 }
300 else
301 {
302 return true;
303 }
304 }
305 else
306 {
307 return (!e1 && !e2);
308 }
309}
bool mutt_addrlist_equal(const struct AddressList *ala, const struct AddressList *alb)
Compare two Address lists for equality.
Definition: address.c:840
bool mutt_list_equal(const struct ListHead *ah, const struct ListHead *bh)
Compare two string lists.
Definition: list.c:218
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:654
struct AddressList return_path
Return path for the Email.
Definition: envelope.h:58
char *const subject
Email's subject.
Definition: envelope.h:70
struct AddressList to
Email's 'To' list.
Definition: envelope.h:60
struct AddressList reply_to
Email's 'reply-to'.
Definition: envelope.h:64
char * message_id
Message ID.
Definition: envelope.h:73
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:83
struct AddressList from
Email's 'From' list.
Definition: envelope.h:59
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_env_free()

void mutt_env_free ( struct Envelope **  ptr)

Free an Envelope.

Parameters
[out]ptrEnvelope to free

Definition at line 126 of file envelope.c.

127{
128 if (!ptr || !*ptr)
129 return;
130
131 struct Envelope *env = *ptr;
132
135 mutt_addrlist_clear(&env->to);
136 mutt_addrlist_clear(&env->cc);
142
143 FREE(&env->list_post);
144 FREE(&env->list_subscribe);
145 FREE(&env->list_unsubscribe);
146 FREE((char **) &env->subject);
147 /* real_subj is just an offset to subject and shouldn't be freed */
148 FREE(&env->disp_subj);
149 FREE(&env->message_id);
150 FREE(&env->supersedes);
151 FREE(&env->date);
152 FREE(&env->x_label);
153 FREE(&env->organization);
154 FREE(&env->newsgroups);
155 FREE(&env->xref);
156 FREE(&env->followup_to);
157 FREE(&env->x_comment_to);
158
159 buf_dealloc(&env->spam);
160
164
165#ifdef USE_AUTOCRYPT
168#endif
169
170 FREE(ptr);
171}
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
Definition: address.c:1460
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:376
void mutt_autocrypthdr_free(struct AutocryptHeader **ptr)
Free an AutocryptHeader.
Definition: envelope.c:104
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
Definition: list.c:122
#define FREE(x)
Definition: memory.h:45
The header of an Email.
Definition: envelope.h:57
struct ListHead userhdrs
user defined headers
Definition: envelope.h:85
char * supersedes
Supersedes header.
Definition: envelope.h:74
char * list_subscribe
This stores a mailto URL, or nothing.
Definition: envelope.h:68
char * followup_to
List of 'followup-to' fields.
Definition: envelope.h:80
char * x_comment_to
List of 'X-comment-to' fields.
Definition: envelope.h:81
struct AddressList x_original_to
Email's 'X-Original-to'.
Definition: envelope.h:66
struct AutocryptHeader * autocrypt_gossip
Autocrypt Gossip header.
Definition: envelope.h:88
char * newsgroups
List of newsgroups.
Definition: envelope.h:78
struct AddressList mail_followup_to
Email's 'mail-followup-to'.
Definition: envelope.h:65
struct AutocryptHeader * autocrypt
Autocrypt header.
Definition: envelope.h:87
struct Buffer spam
Spam header.
Definition: envelope.h:82
struct ListHead in_reply_to
in-reply-to header content
Definition: envelope.h:84
struct AddressList bcc
Email's 'Bcc' list.
Definition: envelope.h:62
char * xref
List of cross-references.
Definition: envelope.h:79
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 * 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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_env_merge()

void mutt_env_merge ( struct Envelope base,
struct Envelope **  extra 
)

Merge the headers of two Envelopes.

Parameters
[in]baseEnvelope destination for all the headers
[out]extraEnvelope to copy from

Any fields that are missing from base will be copied from extra. extra will be freed afterwards.

Definition at line 193 of file envelope.c.

194{
195 if (!base || !extra || !*extra)
196 return;
197
198/* copies each existing element if necessary, and sets the element
199 * to NULL in the source so that mutt_env_free doesn't leave us
200 * with dangling pointers. */
201#define MOVE_ELEM(member) \
202 if (!base->member) \
203 { \
204 base->member = (*extra)->member; \
205 (*extra)->member = NULL; \
206 }
207
208#define MOVE_STAILQ(member) \
209 if (STAILQ_EMPTY(&base->member)) \
210 { \
211 STAILQ_SWAP(&base->member, &(*extra)->member, ListNode); \
212 }
213
214#define MOVE_ADDRESSLIST(member) \
215 if (TAILQ_EMPTY(&base->member)) \
216 { \
217 TAILQ_SWAP(&base->member, &(*extra)->member, Address, entries); \
218 }
219
220#define MOVE_BUFFER(member) \
221 if (buf_is_empty(&base->member)) \
222 { \
223 memcpy(&base->member, &(*extra)->member, sizeof(struct Buffer)); \
224 buf_init(&(*extra)->member); \
225 }
226
227 MOVE_ADDRESSLIST(return_path);
228 MOVE_ADDRESSLIST(from);
231 MOVE_ADDRESSLIST(bcc);
232 MOVE_ADDRESSLIST(sender);
233 MOVE_ADDRESSLIST(reply_to);
234 MOVE_ADDRESSLIST(mail_followup_to);
235 MOVE_ELEM(list_post);
236 MOVE_ELEM(list_subscribe);
237 MOVE_ELEM(list_unsubscribe);
238 MOVE_ELEM(message_id);
239 MOVE_ELEM(supersedes);
240 MOVE_ELEM(date);
241 MOVE_ADDRESSLIST(x_original_to);
242 if (!(base->changed & MUTT_ENV_CHANGED_XLABEL))
243 {
244 MOVE_ELEM(x_label);
245 }
246 if (!(base->changed & MUTT_ENV_CHANGED_REFS))
247 {
248 MOVE_STAILQ(references);
249 }
250 if (!(base->changed & MUTT_ENV_CHANGED_IRT))
251 {
252 MOVE_STAILQ(in_reply_to);
253 }
254
255 /* real_subj is subordinate to subject */
256 if (!base->subject)
257 {
258 *(char **) &base->subject = (*extra)->subject;
259 *(char **) &base->real_subj = (*extra)->real_subj;
260 base->disp_subj = (*extra)->disp_subj;
261 *(char **) &(*extra)->subject = NULL;
262 *(char **) &(*extra)->real_subj = NULL;
263 (*extra)->disp_subj = NULL;
264 }
265 /* spam and user headers should never be hashed, and the new envelope may
266 * have better values. Use new versions regardless. */
267 buf_dealloc(&base->spam);
268 mutt_list_free(&base->userhdrs);
269 MOVE_BUFFER(spam);
270 MOVE_STAILQ(userhdrs);
271#undef MOVE_ELEM
272#undef MOVE_STAILQ
273#undef MOVE_ADDRESSLIST
274#undef MOVE_BUFFER
275
276 mutt_env_free(extra);
277}
void mutt_env_free(struct Envelope **ptr)
Free an Envelope.
Definition: envelope.c:126
#define MOVE_ELEM(member)
#define MOVE_ADDRESSLIST(member)
#define MOVE_STAILQ(member)
#define MOVE_BUFFER(member)
#define MUTT_ENV_CHANGED_XLABEL
X-Label edited.
Definition: envelope.h:36
#define MUTT_ENV_CHANGED_IRT
In-Reply-To changed to link/break threads.
Definition: envelope.h:34
#define MUTT_ENV_CHANGED_REFS
References changed to break thread.
Definition: envelope.h:35
unsigned char changed
Changed fields, e.g. MUTT_ENV_CHANGED_SUBJECT.
Definition: envelope.h:90
char *const real_subj
Offset of the real subject.
Definition: envelope.h:71
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_env_new()

struct Envelope * mutt_env_new ( void  )

Create a new Envelope.

Return values
ptrNew Envelope

Definition at line 46 of file envelope.c.

47{
48 struct Envelope *env = mutt_mem_calloc(1, sizeof(struct Envelope));
50 TAILQ_INIT(&env->from);
51 TAILQ_INIT(&env->to);
52 TAILQ_INIT(&env->cc);
53 TAILQ_INIT(&env->bcc);
54 TAILQ_INIT(&env->sender);
55 TAILQ_INIT(&env->reply_to);
60 STAILQ_INIT(&env->userhdrs);
61 return env;
62}
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
#define STAILQ_INIT(head)
Definition: queue.h:372
#define TAILQ_INIT(head)
Definition: queue.h:765
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_env_notify_send()

bool mutt_env_notify_send ( struct Email e,
enum NotifyEnvelope  type 
)

Send an Envelope change notification.

Parameters
eEmail
typeNotification type, e.g. NT_ENVELOPE_SUBJECT
Return values
trueSuccessfully sent

Definition at line 179 of file envelope.c.

180{
181 struct EventEmail ev_e = { 1, &e };
182 return notify_send(e->notify, NT_ENVELOPE, type, &ev_e);
183}
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:173
@ NT_ENVELOPE
Envelope has changed, NotifyEnvelope.
Definition: notify_type.h:45
struct Notify * notify
Notifications: NotifyEmail, EventEmail.
Definition: email.h:73
An Event that happened to an Email.
Definition: email.h:199
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_env_set_subject()

void mutt_env_set_subject ( struct Envelope env,
const char *  subj 
)

Set both subject and real_subj to subj.

Parameters
envEnvelope
subjSubject

Definition at line 69 of file envelope.c.

70{
71 mutt_str_replace((char **) &env->subject, subj);
72 *(char **) &env->real_subj = NULL;
73
74 if (env->subject)
75 {
76 regmatch_t match;
77 const struct Regex *c_reply_regex = cs_subset_regex(NeoMutt->sub, "reply_regex");
78 if (mutt_regex_capture(c_reply_regex, env->subject, 1, &match))
79 {
80 if (env->subject[match.rm_eo] != '\0')
81 *(char **) &env->real_subj = env->subject + match.rm_eo;
82 }
83 else
84 {
85 *(char **) &env->real_subj = env->subject;
86 }
87 }
88}
const struct Regex * cs_subset_regex(const struct ConfigSubset *sub, const char *name)
Get a regex config item by name.
Definition: helpers.c:218
bool mutt_regex_capture(const struct Regex *regex, const char *str, size_t nmatch, regmatch_t matches[])
Match a regex against a string, with provided options.
Definition: regex.c:597
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:274
Container for Accounts, Notifications.
Definition: neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:45
Cached regular expression.
Definition: regex3.h:85
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_env_to_intl()

int mutt_env_to_intl ( struct Envelope env,
const char **  tag,
char **  err 
)

Convert an Envelope's Address fields to Punycode format.

Parameters
[in]envEnvelope to modify
[out]tagName of the failed field
[out]errFailed address
Return values
0Success, all addresses converted
1Error, tag and err will be set

Run mutt_addrlist_to_intl() on each of the Address fields in the Envelope.

Definition at line 355 of file envelope.c.

356{
357 if (!env)
358 return 1;
359
360 int rc = 0;
361 H_TO_INTL(return_path);
362 H_TO_INTL(from);
363 H_TO_INTL(to);
364 H_TO_INTL(cc);
365 H_TO_INTL(bcc);
366 H_TO_INTL(reply_to);
367 H_TO_INTL(mail_followup_to);
368 return rc;
369}
#define H_TO_INTL(member)
Definition: envelope.c:336
+ Here is the caller graph for this function:

◆ mutt_env_to_local()

void mutt_env_to_local ( struct Envelope env)

Convert an Envelope's Address fields to local format.

Parameters
envEnvelope to modify

Run mutt_addrlist_to_local() on each of the Address fields in the Envelope.

Definition at line 317 of file envelope.c.

318{
319 if (!env)
320 return;
321
329}
int mutt_addrlist_to_local(struct AddressList *al)
Convert an Address list from Punycode.
Definition: address.c:1378
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_autocrypthdr_new()

struct AutocryptHeader * mutt_autocrypthdr_new ( void  )

Create a new AutocryptHeader.

Return values
ptrNew AutocryptHeader

Definition at line 95 of file envelope.c.

96{
97 return mutt_mem_calloc(1, sizeof(struct AutocryptHeader));
98}
Parse Autocrypt header info.
Definition: envelope.h:44
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_autocrypthdr_free()

void mutt_autocrypthdr_free ( struct AutocryptHeader **  ptr)

Free an AutocryptHeader.

Parameters
ptrAutocryptHeader to free

Definition at line 104 of file envelope.c.

105{
106 if (!ptr || !*ptr)
107 return;
108
109 struct AutocryptHeader *cur = NULL;
110
111 while (*ptr)
112 {
113 cur = *ptr;
114 *ptr = (*ptr)->next;
115 FREE(&cur->addr);
116 FREE(&cur->keydata);
117 FREE(&cur);
118 }
119}
struct AutocryptHeader * next
Linked list.
Definition: envelope.h:49
char * keydata
PGP Key data.
Definition: envelope.h:46
char * addr
Email address.
Definition: envelope.h:45
+ Here is the caller graph for this function: