NeoMutt
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
serialize.c
Go to the documentation of this file.
1
32#include "config.h"
33#include <stddef.h>
34#include <stdbool.h>
35#include <string.h>
36#include <sys/types.h>
37#include "mutt/lib.h"
38#include "address/lib.h"
39#include "config/lib.h"
40#include "email/lib.h"
41#include "core/lib.h"
42#include "serialize.h"
43
51void lazy_realloc(void *ptr, size_t size)
52{
53 void **p = (void **) ptr;
54
55 if (p && (size < 4096))
56 return;
57
58 mutt_mem_realloc(ptr, size);
59}
60
68unsigned char *serial_dump_int(const unsigned int i, unsigned char *d, int *off)
69{
70 lazy_realloc(&d, *off + sizeof(int));
71 memcpy(d + *off, &i, sizeof(int));
72 (*off) += sizeof(int);
73
74 return d;
75}
76
84unsigned char *serial_dump_uint32_t(const uint32_t s, unsigned char *d, int *off)
85{
86 lazy_realloc(&d, *off + sizeof(uint32_t));
87 memcpy(d + *off, &s, sizeof(uint32_t));
88 (*off) += sizeof(uint32_t);
89
90 return d;
91}
92
100unsigned char *serial_dump_uint64_t(const uint64_t s, unsigned char *d, int *off)
101{
102 lazy_realloc(&d, *off + sizeof(uint64_t));
103 memcpy(d + *off, &s, sizeof(uint64_t));
104 (*off) += sizeof(uint64_t);
105
106 return d;
107}
108
115void serial_restore_int(unsigned int *i, const unsigned char *d, int *off)
116{
117 memcpy(i, d + *off, sizeof(int));
118 (*off) += sizeof(int);
119}
120
127void serial_restore_uint32_t(uint32_t *s, const unsigned char *d, int *off)
128{
129 memcpy(s, d + *off, sizeof(uint32_t));
130 (*off) += sizeof(uint32_t);
131}
132
139void serial_restore_uint64_t(uint64_t *s, const unsigned char *d, int *off)
140{
141 memcpy(s, d + *off, sizeof(uint64_t));
142 (*off) += sizeof(uint64_t);
143}
144
154unsigned char *serial_dump_char_size(const char *c, ssize_t size,
155 unsigned char *d, int *off, bool convert)
156{
157 char *p = NULL;
158
159 if (!c || (*c == '\0') || (size == 0))
160 {
161 return serial_dump_int(0, d, off);
162 }
163
164 if (convert && !mutt_str_is_ascii(c, size))
165 {
166 p = mutt_strn_dup(c, size);
167 if (mutt_ch_convert_string(&p, cc_charset(), "utf-8", MUTT_ICONV_NO_FLAGS) == 0)
168 {
169 size = mutt_str_len(p) + 1;
170 }
171 }
172
173 d = serial_dump_int(size, d, off);
174 lazy_realloc(&d, *off + size);
175 memcpy(d + *off, p ? p : c, size);
176 *off += size;
177
178 FREE(&p);
179
180 return d;
181}
182
191unsigned char *serial_dump_char(const char *c, unsigned char *d, int *off, bool convert)
192{
193 return serial_dump_char_size(c, mutt_str_len(c) + 1, d, off, convert);
194}
195
203void serial_restore_char(char **c, const unsigned char *d, int *off, bool convert)
204{
205 unsigned int size = 0;
206 serial_restore_int(&size, d, off);
207
208 if (size == 0)
209 {
210 *c = NULL;
211 return;
212 }
213
214 *c = mutt_mem_malloc(size);
215 memcpy(*c, d + *off, size);
216 if (convert && !mutt_str_is_ascii(*c, size))
217 {
218 char *tmp = mutt_str_dup(*c);
219 if (mutt_ch_convert_string(&tmp, "utf-8", cc_charset(), MUTT_ICONV_NO_FLAGS) == 0)
220 {
221 FREE(c);
222 *c = tmp;
223 }
224 else
225 {
226 FREE(&tmp);
227 }
228 }
229 *off += size;
230}
231
240unsigned char *serial_dump_address(const struct AddressList *al,
241 unsigned char *d, int *off, bool convert)
242{
243 unsigned int counter = 0;
244 unsigned int start_off = *off;
245
246 d = serial_dump_int(0xdeadbeef, d, off);
247
248 struct Address *a = NULL;
249 TAILQ_FOREACH(a, al, entries)
250 {
251 d = serial_dump_buffer(a->personal, d, off, convert);
252 d = serial_dump_buffer(a->mailbox, d, off, convert);
253 d = serial_dump_int(a->group, d, off);
254 counter++;
255 }
256
257 memcpy(d + start_off, &counter, sizeof(int));
258
259 return d;
260}
261
269void serial_restore_address(struct AddressList *al, const unsigned char *d,
270 int *off, bool convert)
271{
272 unsigned int counter = 0;
273 unsigned int g = 0;
274
275 serial_restore_int(&counter, d, off);
276
277 while (counter)
278 {
279 struct Address *a = mutt_addr_new();
280
281 a->personal = buf_new(NULL);
282 serial_restore_buffer(a->personal, d, off, convert);
283 if (buf_is_empty(a->personal))
284 {
285 buf_free(&a->personal);
286 }
287
288 a->mailbox = buf_new(NULL);
289 serial_restore_buffer(a->mailbox, d, off, false);
290 if (buf_is_empty(a->mailbox))
291 {
292 buf_free(&a->mailbox);
293 }
294
295 serial_restore_int(&g, d, off);
296 a->group = !!g;
298 counter--;
299 }
300}
301
310unsigned char *serial_dump_stailq(const struct ListHead *l, unsigned char *d,
311 int *off, bool convert)
312{
313 unsigned int counter = 0;
314 unsigned int start_off = *off;
315
316 d = serial_dump_int(0xdeadbeef, d, off);
317
318 struct ListNode *np = NULL;
319 STAILQ_FOREACH(np, l, entries)
320 {
321 d = serial_dump_char(np->data, d, off, convert);
322 counter++;
323 }
324
325 memcpy(d + start_off, &counter, sizeof(int));
326
327 return d;
328}
329
337void serial_restore_stailq(struct ListHead *l, const unsigned char *d, int *off, bool convert)
338{
339 unsigned int counter = 0;
340
341 serial_restore_int(&counter, d, off);
342
343 struct ListNode *np = NULL;
344 while (counter)
345 {
346 np = mutt_list_insert_tail(l, NULL);
347 serial_restore_char(&np->data, d, off, convert);
348 counter--;
349 }
350}
351
360unsigned char *serial_dump_buffer(const struct Buffer *buf, unsigned char *d,
361 int *off, bool convert)
362{
363 if (buf_is_empty(buf))
364 {
365 d = serial_dump_int(0, d, off);
366 return d;
367 }
368
369 d = serial_dump_int(1, d, off);
370
371 d = serial_dump_char(buf->data, d, off, convert);
372
373 return d;
374}
375
383void serial_restore_buffer(struct Buffer *buf, const unsigned char *d, int *off, bool convert)
384{
385 buf_alloc(buf, 1);
386
387 unsigned int used = 0;
388 serial_restore_int(&used, d, off);
389 if (used == 0)
390 return;
391
392 char *str = NULL;
393 serial_restore_char(&str, d, off, convert);
394
395 buf_addstr(buf, str);
396 FREE(&str);
397}
398
407unsigned char *serial_dump_parameter(const struct ParameterList *pl,
408 unsigned char *d, int *off, bool convert)
409{
410 unsigned int counter = 0;
411 unsigned int start_off = *off;
412
413 d = serial_dump_int(0xdeadbeef, d, off);
414
415 struct Parameter *np = NULL;
416 TAILQ_FOREACH(np, pl, entries)
417 {
418 d = serial_dump_char(np->attribute, d, off, false);
419 d = serial_dump_char(np->value, d, off, convert);
420 counter++;
421 }
422
423 memcpy(d + start_off, &counter, sizeof(int));
424
425 return d;
426}
427
435void serial_restore_parameter(struct ParameterList *pl, const unsigned char *d,
436 int *off, bool convert)
437{
438 unsigned int counter = 0;
439
440 serial_restore_int(&counter, d, off);
441
442 struct Parameter *np = NULL;
443 while (counter)
444 {
445 np = mutt_param_new();
446 serial_restore_char(&np->attribute, d, off, false);
447 serial_restore_char(&np->value, d, off, convert);
448 TAILQ_INSERT_TAIL(pl, np, entries);
449 counter--;
450 }
451}
452
460static inline uint32_t body_pack_flags(const struct Body *b)
461{
462 if (!b)
463 return 0;
464
465 // clang-format off
466 uint32_t packed = b->type +
467 (b->encoding << 4) +
468 (b->disposition << 7) +
469 (b->badsig << 9) +
470 (b->force_charset << 10) +
471 (b->goodsig << 11) +
472 (b->noconv << 12) +
473 (b->use_disp << 13) +
474 (b->warnsig << 14);
475 // clang-format on
476#ifdef USE_AUTOCRYPT
477 packed += (b->is_autocrypt << 15);
478#endif
479
480 return packed;
481}
482
490static inline void body_unpack_flags(struct Body *b, uint32_t packed)
491{
492 if (!b)
493 return;
494
495 // clang-format off
496 b->type = (packed & ((1 << 4) - 1)); // bits 0-3 (4)
497 b->encoding = ((packed >> 4) & ((1 << 3) - 1)); // bits 4-6 (3)
498 b->disposition = ((packed >> 7) & ((1 << 2) - 1)); // bits 7-8 (2)
499
500 b->badsig = (packed & (1 << 9));
501 b->force_charset = (packed & (1 << 10));
502 b->goodsig = (packed & (1 << 11));
503 b->noconv = (packed & (1 << 12));
504 b->use_disp = (packed & (1 << 13));
505 b->warnsig = (packed & (1 << 14));
506#ifdef USE_AUTOCRYPT
507 b->is_autocrypt = (packed & (1 << 15));
508#endif
509 // clang-format on
510}
511
520unsigned char *serial_dump_body(const struct Body *b, unsigned char *d, int *off, bool convert)
521{
522 uint32_t packed = body_pack_flags(b);
523 d = serial_dump_uint32_t(packed, d, off);
524
525 uint64_t big = b->offset;
526 d = serial_dump_uint64_t(big, d, off);
527
528 big = b->length;
529 d = serial_dump_uint64_t(big, d, off);
530
531 d = serial_dump_char(b->xtype, d, off, false);
532 d = serial_dump_char(b->subtype, d, off, false);
533
534 d = serial_dump_parameter(&b->parameter, d, off, convert);
535
536 d = serial_dump_char(b->description, d, off, convert);
537 d = serial_dump_char(b->form_name, d, off, convert);
538 d = serial_dump_char(b->filename, d, off, convert);
539 d = serial_dump_char(b->d_filename, d, off, convert);
540
541 return d;
542}
543
551void serial_restore_body(struct Body *b, const unsigned char *d, int *off, bool convert)
552{
553 uint32_t packed = 0;
554 serial_restore_uint32_t(&packed, d, off);
555 body_unpack_flags(b, packed);
556
557 uint64_t big = 0;
558 serial_restore_uint64_t(&big, d, off);
559 b->offset = big;
560
561 big = 0;
562 serial_restore_uint64_t(&big, d, off);
563 b->length = big;
564
565 serial_restore_char(&b->xtype, d, off, false);
566 serial_restore_char(&b->subtype, d, off, false);
567
569 serial_restore_parameter(&b->parameter, d, off, convert);
570
571 serial_restore_char(&b->description, d, off, convert);
572 serial_restore_char(&b->form_name, d, off, convert);
573 serial_restore_char(&b->filename, d, off, convert);
574 serial_restore_char(&b->d_filename, d, off, convert);
575}
576
585unsigned char *serial_dump_envelope(const struct Envelope *env,
586 unsigned char *d, int *off, bool convert)
587{
588 d = serial_dump_address(&env->return_path, d, off, convert);
589 d = serial_dump_address(&env->from, d, off, convert);
590 d = serial_dump_address(&env->to, d, off, convert);
591 d = serial_dump_address(&env->cc, d, off, convert);
592 d = serial_dump_address(&env->bcc, d, off, convert);
593 d = serial_dump_address(&env->sender, d, off, convert);
594 d = serial_dump_address(&env->reply_to, d, off, convert);
595 d = serial_dump_address(&env->mail_followup_to, d, off, convert);
596
597 d = serial_dump_char(env->list_post, d, off, convert);
598 d = serial_dump_char(env->list_subscribe, d, off, convert);
599 d = serial_dump_char(env->list_unsubscribe, d, off, convert);
600 d = serial_dump_char(env->subject, d, off, convert);
601
602 if (env->real_subj)
603 d = serial_dump_int(env->real_subj - env->subject, d, off);
604 else
605 d = serial_dump_int(-1, d, off);
606
607 d = serial_dump_char(env->message_id, d, off, false);
608 d = serial_dump_char(env->supersedes, d, off, false);
609 d = serial_dump_char(env->date, d, off, false);
610 d = serial_dump_char(env->x_label, d, off, convert);
611 d = serial_dump_char(env->organization, d, off, convert);
612
613 d = serial_dump_buffer(&env->spam, d, off, convert);
614
615 d = serial_dump_stailq(&env->references, d, off, false);
616 d = serial_dump_stailq(&env->in_reply_to, d, off, false);
617 d = serial_dump_stailq(&env->userhdrs, d, off, convert);
618
619#ifdef USE_NNTP
620 d = serial_dump_char(env->xref, d, off, false);
621 d = serial_dump_char(env->followup_to, d, off, false);
622 d = serial_dump_char(env->x_comment_to, d, off, convert);
623#endif
624
625 return d;
626}
627
635void serial_restore_envelope(struct Envelope *env, const unsigned char *d, int *off, bool convert)
636{
637 int real_subj_off = 0;
638
639 serial_restore_address(&env->return_path, d, off, convert);
640 serial_restore_address(&env->from, d, off, convert);
641 serial_restore_address(&env->to, d, off, convert);
642 serial_restore_address(&env->cc, d, off, convert);
643 serial_restore_address(&env->bcc, d, off, convert);
644 serial_restore_address(&env->sender, d, off, convert);
645 serial_restore_address(&env->reply_to, d, off, convert);
646 serial_restore_address(&env->mail_followup_to, d, off, convert);
647
648 serial_restore_char(&env->list_post, d, off, convert);
649 serial_restore_char(&env->list_subscribe, d, off, convert);
650 serial_restore_char(&env->list_unsubscribe, d, off, convert);
651
652 const bool c_auto_subscribe = cs_subset_bool(NeoMutt->sub, "auto_subscribe");
653 if (c_auto_subscribe)
655
656 serial_restore_char(&env->subject, d, off, convert);
657 serial_restore_int((unsigned int *) (&real_subj_off), d, off);
658
659 size_t len = mutt_str_len(env->subject);
660 if ((real_subj_off < 0) || (real_subj_off >= len))
661 env->real_subj = NULL;
662 else
663 env->real_subj = env->subject + real_subj_off;
664
665 serial_restore_char(&env->message_id, d, off, false);
666 serial_restore_char(&env->supersedes, d, off, false);
667 serial_restore_char(&env->date, d, off, false);
668 serial_restore_char(&env->x_label, d, off, convert);
669 serial_restore_char(&env->organization, d, off, convert);
670
671 serial_restore_buffer(&env->spam, d, off, convert);
672
673 serial_restore_stailq(&env->references, d, off, false);
674 serial_restore_stailq(&env->in_reply_to, d, off, false);
675 serial_restore_stailq(&env->userhdrs, d, off, convert);
676
677#ifdef USE_NNTP
678 serial_restore_char(&env->xref, d, off, false);
679 serial_restore_char(&env->followup_to, d, off, false);
680 serial_restore_char(&env->x_comment_to, d, off, convert);
681#endif
682}
683
691unsigned char *serial_dump_tags(const struct TagList *tags, unsigned char *d, int *off)
692{
693 unsigned int counter = 0;
694 unsigned int start_off = *off;
695
696 d = serial_dump_int(0xdeadbeef, d, off);
697
698 struct Tag *t = NULL;
699 STAILQ_FOREACH(t, tags, entries)
700 {
701 d = serial_dump_char(t->name, d, off, false);
702 counter++;
703 }
704
705 memcpy(d + start_off, &counter, sizeof(int));
706
707 return d;
708}
709
716void serial_restore_tags(struct TagList *tags, const unsigned char *d, int *off)
717{
718 unsigned int counter = 0;
719
720 serial_restore_int(&counter, d, off);
721
722 while (counter)
723 {
724 char *name = NULL;
725 serial_restore_char(&name, d, off, false);
726 driver_tags_add(tags, name);
727 counter--;
728 }
729}
void mutt_addrlist_append(struct AddressList *al, struct Address *a)
Append an Address to an AddressList.
Definition: address.c:1481
struct Address * mutt_addr_new(void)
Create a new Address.
Definition: address.c:399
Email Address Handling.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition: buffer.c:303
void buf_free(struct Buffer **ptr)
Deallocates a buffer.
Definition: buffer.c:331
struct Buffer * buf_new(const char *str)
Allocate a new Buffer.
Definition: buffer.c:316
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition: buffer.c:238
void buf_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
Definition: buffer.c:349
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:48
Convenience wrapper for the config headers.
const char * cc_charset(void)
Get the cached value of $charset.
Definition: config_cache.c:115
Convenience wrapper for the core headers.
Structs that make up an email.
void mutt_auto_subscribe(const char *mailto)
Check if user is subscribed to mailing list.
Definition: parse.c:68
struct ListNode * mutt_list_insert_tail(struct ListHead *h, char *s)
Append a string to the end of a List.
Definition: list.c:64
void * mutt_mem_malloc(size_t size)
Allocate memory on the heap.
Definition: memory.c:90
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:114
#define FREE(x)
Definition: memory.h:45
int mutt_ch_convert_string(char **ps, const char *from, const char *to, uint8_t flags)
Convert a string between encodings.
Definition: charset.c:826
#define MUTT_ICONV_NO_FLAGS
No flags are set.
Definition: charset.h:71
Convenience wrapper for the library headers.
char * mutt_strn_dup(const char *begin, size_t len)
Duplicate a sub-string.
Definition: string.c:452
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:251
bool mutt_str_is_ascii(const char *str, size_t len)
Is a string ASCII (7-bit)?
Definition: string.c:875
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:568
struct Parameter * mutt_param_new(void)
Create a new Parameter.
Definition: parameter.c:39
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:725
#define TAILQ_INIT(head)
Definition: queue.h:765
#define TAILQ_INSERT_TAIL(head, elm, field)
Definition: queue.h:809
#define STAILQ_FOREACH(var, head, field)
Definition: queue.h:352
unsigned char * serial_dump_body(const struct Body *b, unsigned char *d, int *off, bool convert)
Pack an Body into a binary blob.
Definition: serialize.c:520
void serial_restore_tags(struct TagList *tags, const unsigned char *d, int *off)
Unpack a TagList from a binary blob.
Definition: serialize.c:716
unsigned char * serial_dump_uint64_t(const uint64_t s, unsigned char *d, int *off)
Pack a uint64_t into a binary blob.
Definition: serialize.c:100
void serial_restore_char(char **c, const unsigned char *d, int *off, bool convert)
Unpack a variable-length string from a binary blob.
Definition: serialize.c:203
unsigned char * serial_dump_int(const unsigned int i, unsigned char *d, int *off)
Pack an integer into a binary blob.
Definition: serialize.c:68
void serial_restore_buffer(struct Buffer *buf, const unsigned char *d, int *off, bool convert)
Unpack a Buffer from a binary blob.
Definition: serialize.c:383
void serial_restore_envelope(struct Envelope *env, const unsigned char *d, int *off, bool convert)
Unpack an Envelope from a binary blob.
Definition: serialize.c:635
unsigned char * serial_dump_envelope(const struct Envelope *env, unsigned char *d, int *off, bool convert)
Pack an Envelope into a binary blob.
Definition: serialize.c:585
static uint32_t body_pack_flags(const struct Body *b)
Pack the Body flags into a uint32_t.
Definition: serialize.c:460
unsigned char * serial_dump_buffer(const struct Buffer *buf, unsigned char *d, int *off, bool convert)
Pack a Buffer into a binary blob.
Definition: serialize.c:360
void serial_restore_stailq(struct ListHead *l, const unsigned char *d, int *off, bool convert)
Unpack a STAILQ from a binary blob.
Definition: serialize.c:337
unsigned char * serial_dump_address(const struct AddressList *al, unsigned char *d, int *off, bool convert)
Pack an Address into a binary blob.
Definition: serialize.c:240
void serial_restore_uint64_t(uint64_t *s, const unsigned char *d, int *off)
Unpack an uint64_t from a binary blob.
Definition: serialize.c:139
void lazy_realloc(void *ptr, size_t size)
Reallocate some memory.
Definition: serialize.c:51
unsigned char * serial_dump_parameter(const struct ParameterList *pl, unsigned char *d, int *off, bool convert)
Pack a Parameter into a binary blob.
Definition: serialize.c:407
void serial_restore_body(struct Body *b, const unsigned char *d, int *off, bool convert)
Unpack a Body from a binary blob.
Definition: serialize.c:551
unsigned char * serial_dump_uint32_t(const uint32_t s, unsigned char *d, int *off)
Pack a uint32_t into a binary blob.
Definition: serialize.c:84
unsigned char * serial_dump_stailq(const struct ListHead *l, unsigned char *d, int *off, bool convert)
Pack a STAILQ into a binary blob.
Definition: serialize.c:310
void serial_restore_parameter(struct ParameterList *pl, const unsigned char *d, int *off, bool convert)
Unpack a Parameter from a binary blob.
Definition: serialize.c:435
unsigned char * serial_dump_char_size(const char *c, ssize_t size, unsigned char *d, int *off, bool convert)
Pack a fixed-length string into a binary blob.
Definition: serialize.c:154
static void body_unpack_flags(struct Body *b, uint32_t packed)
Unpack the Body flags from a uint32_t.
Definition: serialize.c:490
void serial_restore_address(struct AddressList *al, const unsigned char *d, int *off, bool convert)
Unpack an Address from a binary blob.
Definition: serialize.c:269
void serial_restore_int(unsigned int *i, const unsigned char *d, int *off)
Unpack an integer from a binary blob.
Definition: serialize.c:115
unsigned char * serial_dump_tags(const struct TagList *tags, unsigned char *d, int *off)
Pack a TagList into a binary blob.
Definition: serialize.c:691
void serial_restore_uint32_t(uint32_t *s, const unsigned char *d, int *off)
Unpack an uint32_t from a binary blob.
Definition: serialize.c:127
unsigned char * serial_dump_char(const char *c, unsigned char *d, int *off, bool convert)
Pack a variable-length string into a binary blob.
Definition: serialize.c:191
Email-object serialiser.
An email address.
Definition: address.h:36
struct Buffer * personal
Real name of address.
Definition: address.h:37
bool group
Group mailbox?
Definition: address.h:39
struct Buffer * mailbox
Mailbox and host address.
Definition: address.h:38
The body of an email.
Definition: body.h:36
char * d_filename
filename to be used for the content-disposition header If NULL, filename is used instead.
Definition: body.h:56
LOFF_T offset
offset where the actual data begins
Definition: body.h:52
char * xtype
content-type if x-unknown
Definition: body.h:61
bool noconv
Don't do character set conversion.
Definition: body.h:46
bool badsig
Bad cryptographic signature (needed to check encrypted s/mime-signatures)
Definition: body.h:43
bool is_autocrypt
Flag autocrypt-decrypted messages for replying.
Definition: body.h:50
LOFF_T length
length (in bytes) of attachment
Definition: body.h:53
struct ParameterList parameter
Parameters of the content-type.
Definition: body.h:62
bool use_disp
Content-Disposition uses filename= ?
Definition: body.h:47
char * description
content-description
Definition: body.h:55
unsigned int disposition
content-disposition, ContentDisposition
Definition: body.h:42
bool force_charset
Send mode: don't adjust the character set when in send-mode.
Definition: body.h:44
char * subtype
content-type subtype
Definition: body.h:60
unsigned int encoding
content-transfer-encoding, ContentEncoding
Definition: body.h:41
bool goodsig
Good cryptographic signature.
Definition: body.h:45
char * form_name
Content-Disposition form-data name param.
Definition: body.h:59
bool warnsig
Maybe good signature.
Definition: body.h:48
unsigned int type
content-type primary type, ContentType
Definition: body.h:40
char * filename
When sending a message, this is the file to which this structure refers.
Definition: body.h:58
String manipulation buffer.
Definition: buffer.h:34
char * data
Pointer to data.
Definition: buffer.h:35
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
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 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 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 * list_unsubscribe
This stores a mailto URL, or nothing.
Definition: envelope.h:69
struct AddressList from
Email's 'From' list.
Definition: envelope.h:59
A List node for strings.
Definition: list.h:35
char * data
String.
Definition: list.h:36
Container for Accounts, Notifications.
Definition: neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:45
Attribute associated with a MIME part.
Definition: parameter.h:33
char * attribute
Parameter name.
Definition: parameter.h:34
char * value
Parameter value.
Definition: parameter.h:35
LinkedList Tag Element.
Definition: tags.h:39
char * name
Tag name.
Definition: tags.h:40
void driver_tags_add(struct TagList *list, char *new_tag)
Add a tag to header.
Definition: tags.c:83