NeoMutt  2025-12-11-872-g385a04
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
serialize.c
Go to the documentation of this file.
1
24
30
31#include "config.h"
32#include <stdbool.h>
33#include <stddef.h>
34#include <string.h>
35#include <sys/types.h>
36#include "mutt/lib.h"
37#include "address/lib.h"
38#include "config/lib.h"
39#include "email/lib.h"
40#include "core/lib.h"
41#include "alias/lib.h"
42#include "serialize.h"
43
45#define SERIAL_MAX_CHAR_SIZE (256 * 1024)
46
48#define SERIAL_MAX_LIST_COUNT 1024
49
57void lazy_realloc(void *ptr, size_t size)
58{
59 void **p = (void **) ptr;
60
61 if (p && (size < 4096))
62 return;
63
64 mutt_mem_realloc(ptr, size);
65}
66
74unsigned char *serial_dump_int(const unsigned int i, unsigned char *d, int *off)
75{
76 lazy_realloc(&d, *off + sizeof(int));
77 memcpy(d + *off, &i, sizeof(int));
78 (*off) += sizeof(int);
79
80 return d;
81}
82
90unsigned char *serial_dump_uint32_t(const uint32_t s, unsigned char *d, int *off)
91{
92 lazy_realloc(&d, *off + sizeof(uint32_t));
93 memcpy(d + *off, &s, sizeof(uint32_t));
94 (*off) += sizeof(uint32_t);
95
96 return d;
97}
98
106unsigned char *serial_dump_uint64_t(const uint64_t s, unsigned char *d, int *off)
107{
108 lazy_realloc(&d, *off + sizeof(uint64_t));
109 memcpy(d + *off, &s, sizeof(uint64_t));
110 (*off) += sizeof(uint64_t);
111
112 return d;
113}
114
121void serial_restore_int(unsigned int *i, const unsigned char *d, int *off)
122{
123 memcpy(i, d + *off, sizeof(int));
124 (*off) += sizeof(int);
125}
126
133void serial_restore_uint32_t(uint32_t *s, const unsigned char *d, int *off)
134{
135 memcpy(s, d + *off, sizeof(uint32_t));
136 (*off) += sizeof(uint32_t);
137}
138
145void serial_restore_uint64_t(uint64_t *s, const unsigned char *d, int *off)
146{
147 memcpy(s, d + *off, sizeof(uint64_t));
148 (*off) += sizeof(uint64_t);
149}
150
160unsigned char *serial_dump_char_size(const char *c, ssize_t size,
161 unsigned char *d, int *off, bool convert)
162{
163 char *p = NULL;
164
165 if (!c || (*c == '\0') || (size == 0))
166 {
167 return serial_dump_int(0, d, off);
168 }
169
170 if (convert && !mutt_str_is_ascii(c, size))
171 {
172 p = mutt_strn_dup(c, size);
173 if (mutt_ch_convert_string(&p, cc_charset(), "utf-8", MUTT_ICONV_NONE) == 0)
174 {
175 size = mutt_str_len(p) + 1;
176 }
177 }
178
179 d = serial_dump_int(size, d, off);
180 lazy_realloc(&d, *off + size);
181 memcpy(d + *off, p ? p : c, size);
182 *off += size;
183
184 FREE(&p);
185
186 return d;
187}
188
197unsigned char *serial_dump_char(const char *c, unsigned char *d, int *off, bool convert)
198{
199 return serial_dump_char_size(c, mutt_str_len(c) + 1, d, off, convert);
200}
201
209void serial_restore_char(char **c, const unsigned char *d, int *off, bool convert)
210{
211 unsigned int size = 0;
212 serial_restore_int(&size, d, off);
213
214 if ((size == 0) || (size > SERIAL_MAX_CHAR_SIZE))
215 {
216 *c = NULL;
217 return;
218 }
219
220 *c = MUTT_MEM_MALLOC(size, char);
221 memcpy(*c, d + *off, size);
222 if (convert && !mutt_str_is_ascii(*c, size))
223 {
224 char *tmp = mutt_str_dup(*c);
225 if (mutt_ch_convert_string(&tmp, "utf-8", cc_charset(), MUTT_ICONV_NONE) == 0)
226 {
227 FREE(c);
228 *c = tmp;
229 }
230 else
231 {
232 FREE(&tmp);
233 }
234 }
235 *off += size;
236}
237
246unsigned char *serial_dump_address(const struct AddressList *al,
247 unsigned char *d, int *off, bool convert)
248{
249 unsigned int counter = 0;
250 unsigned int start_off = *off;
251
252 d = serial_dump_int(0xdeadbeef, d, off);
253
254 struct Address *a = NULL;
255 TAILQ_FOREACH(a, al, entries)
256 {
257 d = serial_dump_buffer(a->personal, d, off, convert);
258 d = serial_dump_buffer(a->mailbox, d, off, convert);
259 d = serial_dump_int(a->group, d, off);
260 counter++;
261 }
262
263 memcpy(d + start_off, &counter, sizeof(int));
264
265 return d;
266}
267
275void serial_restore_address(struct AddressList *al, const unsigned char *d,
276 int *off, bool convert)
277{
278 unsigned int counter = 0;
279 unsigned int g = 0;
280
281 serial_restore_int(&counter, d, off);
282
283 if (counter > SERIAL_MAX_LIST_COUNT)
284 return;
285
286 while (counter > 0)
287 {
288 struct Address *a = mutt_addr_new();
289
290 a->personal = buf_new(NULL);
291 serial_restore_buffer(a->personal, d, off, convert);
292 if (buf_is_empty(a->personal))
293 {
294 buf_free(&a->personal);
295 }
296
297 a->mailbox = buf_new(NULL);
298 serial_restore_buffer(a->mailbox, d, off, false);
299 if (buf_is_empty(a->mailbox))
300 {
301 buf_free(&a->mailbox);
302 }
303
304 serial_restore_int(&g, d, off);
305 a->group = !!g;
307 counter--;
308 }
309}
310
319unsigned char *serial_dump_stailq(const struct ListHead *l, unsigned char *d,
320 int *off, bool convert)
321{
322 unsigned int counter = 0;
323 unsigned int start_off = *off;
324
325 d = serial_dump_int(0xdeadbeef, d, off);
326
327 struct ListNode *np = NULL;
328 STAILQ_FOREACH(np, l, entries)
329 {
330 d = serial_dump_char(np->data, d, off, convert);
331 counter++;
332 }
333
334 memcpy(d + start_off, &counter, sizeof(int));
335
336 return d;
337}
338
346void serial_restore_stailq(struct ListHead *l, const unsigned char *d, int *off, bool convert)
347{
348 unsigned int counter = 0;
349
350 serial_restore_int(&counter, d, off);
351
352 if (counter > SERIAL_MAX_LIST_COUNT)
353 return;
354
355 struct ListNode *np = NULL;
356 while (counter > 0)
357 {
358 np = mutt_list_insert_tail(l, NULL);
359 serial_restore_char(&np->data, d, off, convert);
360 counter--;
361 }
362}
363
372unsigned char *serial_dump_buffer(const struct Buffer *buf, unsigned char *d,
373 int *off, bool convert)
374{
375 if (buf_is_empty(buf))
376 {
377 d = serial_dump_int(0, d, off);
378 return d;
379 }
380
381 d = serial_dump_int(1, d, off);
382
383 d = serial_dump_char(buf->data, d, off, convert);
384
385 return d;
386}
387
395void serial_restore_buffer(struct Buffer *buf, const unsigned char *d, int *off, bool convert)
396{
397 buf_alloc(buf, 1);
398
399 unsigned int used = 0;
400 serial_restore_int(&used, d, off);
401 if (used == 0)
402 return;
403
404 char *str = NULL;
405 serial_restore_char(&str, d, off, convert);
406
407 buf_addstr(buf, str);
408 FREE(&str);
409}
410
419unsigned char *serial_dump_parameter(const struct ParameterList *pl,
420 unsigned char *d, int *off, bool convert)
421{
422 unsigned int counter = 0;
423 unsigned int start_off = *off;
424
425 d = serial_dump_int(0xdeadbeef, d, off);
426
427 struct Parameter *np = NULL;
428 TAILQ_FOREACH(np, pl, entries)
429 {
430 d = serial_dump_char(np->attribute, d, off, false);
431 d = serial_dump_char(np->value, d, off, convert);
432 counter++;
433 }
434
435 memcpy(d + start_off, &counter, sizeof(int));
436
437 return d;
438}
439
447void serial_restore_parameter(struct ParameterList *pl, const unsigned char *d,
448 int *off, bool convert)
449{
450 unsigned int counter = 0;
451
452 serial_restore_int(&counter, d, off);
453
454 if (counter > SERIAL_MAX_LIST_COUNT)
455 return;
456
457 struct Parameter *np = NULL;
458 while (counter > 0)
459 {
460 np = mutt_param_new();
461 serial_restore_char(&np->attribute, d, off, false);
462 serial_restore_char(&np->value, d, off, convert);
463 TAILQ_INSERT_TAIL(pl, np, entries);
464 counter--;
465 }
466}
467
475static inline uint32_t body_pack_flags(const struct Body *b)
476{
477 if (!b)
478 return 0;
479
480 // clang-format off
481 uint32_t packed = b->type +
482 (b->encoding << 4) +
483 (b->disposition << 7) +
484 (b->badsig << 9) +
485 (b->force_charset << 10) +
486 (b->goodsig << 11) +
487 (b->noconv << 12) +
488 (b->use_disp << 13) +
489 (b->warnsig << 14);
490 // clang-format on
491#ifdef USE_AUTOCRYPT
492 packed += (b->is_autocrypt << 15);
493#endif
494
495 return packed;
496}
497
505static inline void body_unpack_flags(struct Body *b, uint32_t packed)
506{
507 if (!b)
508 return;
509
510 // clang-format off
511 b->type = (packed & ((1 << 4) - 1)); // bits 0-3 (4)
512 b->encoding = ((packed >> 4) & ((1 << 3) - 1)); // bits 4-6 (3)
513 b->disposition = ((packed >> 7) & ((1 << 2) - 1)); // bits 7-8 (2)
514
515 b->badsig = (packed & (1 << 9));
516 b->force_charset = (packed & (1 << 10));
517 b->goodsig = (packed & (1 << 11));
518 b->noconv = (packed & (1 << 12));
519 b->use_disp = (packed & (1 << 13));
520 b->warnsig = (packed & (1 << 14));
521#ifdef USE_AUTOCRYPT
522 b->is_autocrypt = (packed & (1 << 15));
523#endif
524 // clang-format on
525}
526
535unsigned char *serial_dump_body(const struct Body *b, unsigned char *d, int *off, bool convert)
536{
537 uint32_t packed = body_pack_flags(b);
538 d = serial_dump_uint32_t(packed, d, off);
539
540 uint64_t big = b->offset;
541 d = serial_dump_uint64_t(big, d, off);
542
543 big = b->length;
544 d = serial_dump_uint64_t(big, d, off);
545
546 d = serial_dump_char(b->xtype, d, off, false);
547 d = serial_dump_char(b->subtype, d, off, false);
548
549 d = serial_dump_parameter(&b->parameter, d, off, convert);
550
551 d = serial_dump_char(b->description, d, off, convert);
552 d = serial_dump_char(b->content_id, d, off, convert);
553 d = serial_dump_char(b->form_name, d, off, convert);
554 d = serial_dump_char(b->filename, d, off, convert);
555 d = serial_dump_char(b->d_filename, d, off, convert);
556
557 return d;
558}
559
567void serial_restore_body(struct Body *b, const unsigned char *d, int *off, bool convert)
568{
569 uint32_t packed = 0;
570 serial_restore_uint32_t(&packed, d, off);
571 body_unpack_flags(b, packed);
572
573 uint64_t big = 0;
574 serial_restore_uint64_t(&big, d, off);
575 b->offset = big;
576
577 big = 0;
578 serial_restore_uint64_t(&big, d, off);
579 b->length = big;
580
581 serial_restore_char(&b->xtype, d, off, false);
582 serial_restore_char(&b->subtype, d, off, false);
583
585 serial_restore_parameter(&b->parameter, d, off, convert);
586
587 serial_restore_char(&b->description, d, off, convert);
588 serial_restore_char(&b->content_id, d, off, convert);
589 serial_restore_char(&b->form_name, d, off, convert);
590 serial_restore_char(&b->filename, d, off, convert);
591 serial_restore_char(&b->d_filename, d, off, convert);
592}
593
602unsigned char *serial_dump_envelope(const struct Envelope *env,
603 unsigned char *d, int *off, bool convert)
604{
605 d = serial_dump_address(&env->return_path, d, off, convert);
606 d = serial_dump_address(&env->from, d, off, convert);
607 d = serial_dump_address(&env->to, d, off, convert);
608 d = serial_dump_address(&env->cc, d, off, convert);
609 d = serial_dump_address(&env->bcc, d, off, convert);
610 d = serial_dump_address(&env->sender, d, off, convert);
611 d = serial_dump_address(&env->reply_to, d, off, convert);
612 d = serial_dump_address(&env->mail_followup_to, d, off, convert);
613
614 d = serial_dump_char(env->list_post, d, off, convert);
615 d = serial_dump_char(env->list_subscribe, d, off, convert);
616 d = serial_dump_char(env->list_unsubscribe, d, off, convert);
617 d = serial_dump_char(env->subject, d, off, convert);
618
619 if (env->real_subj)
620 d = serial_dump_int(env->real_subj - env->subject, d, off);
621 else
622 d = serial_dump_int(-1, d, off);
623
624 d = serial_dump_char(env->message_id, d, off, false);
625 d = serial_dump_char(env->supersedes, d, off, false);
626 d = serial_dump_char(env->date, d, off, false);
627 d = serial_dump_char(env->x_label, d, off, convert);
628 d = serial_dump_char(env->organization, d, off, convert);
629
630 d = serial_dump_buffer(&env->spam, d, off, convert);
631
632 d = serial_dump_stailq(&env->references, d, off, false);
633 d = serial_dump_stailq(&env->in_reply_to, d, off, false);
634 d = serial_dump_stailq(&env->userhdrs, d, off, convert);
635
636 d = serial_dump_char(env->xref, d, off, false);
637 d = serial_dump_char(env->followup_to, d, off, false);
638 d = serial_dump_char(env->x_comment_to, d, off, convert);
639
640 return d;
641}
642
650void serial_restore_envelope(struct Envelope *env, const unsigned char *d, int *off, bool convert)
651{
652 int real_subj_off = 0;
653
654 serial_restore_address(&env->return_path, d, off, convert);
655 serial_restore_address(&env->from, d, off, convert);
656 serial_restore_address(&env->to, d, off, convert);
657 serial_restore_address(&env->cc, d, off, convert);
658 serial_restore_address(&env->bcc, d, off, convert);
659 serial_restore_address(&env->sender, d, off, convert);
660 serial_restore_address(&env->reply_to, d, off, convert);
661 serial_restore_address(&env->mail_followup_to, d, off, convert);
662
663 serial_restore_char(&env->list_post, d, off, convert);
664 serial_restore_char(&env->list_subscribe, d, off, convert);
665 serial_restore_char(&env->list_unsubscribe, d, off, convert);
666
667 const bool c_auto_subscribe = cs_subset_bool(NeoMutt->sub, "auto_subscribe");
668 if (c_auto_subscribe)
670
671 serial_restore_char((char **) &env->subject, d, off, convert);
672 serial_restore_int((unsigned int *) (&real_subj_off), d, off);
673
674 size_t len = mutt_str_len(env->subject);
675 if ((real_subj_off < 0) || (real_subj_off >= len))
676 *(char **) &env->real_subj = NULL;
677 else
678 *(char **) &env->real_subj = env->subject + real_subj_off;
679
680 serial_restore_char(&env->message_id, d, off, false);
681 serial_restore_char(&env->supersedes, d, off, false);
682 serial_restore_char(&env->date, d, off, false);
683 serial_restore_char(&env->x_label, d, off, convert);
684 serial_restore_char(&env->organization, d, off, convert);
685
686 serial_restore_buffer(&env->spam, d, off, convert);
687
688 serial_restore_stailq(&env->references, d, off, false);
689 serial_restore_stailq(&env->in_reply_to, d, off, false);
690 serial_restore_stailq(&env->userhdrs, d, off, convert);
691
692 serial_restore_char(&env->xref, d, off, false);
693 serial_restore_char(&env->followup_to, d, off, false);
694 serial_restore_char(&env->x_comment_to, d, off, convert);
695}
696
704unsigned char *serial_dump_tags(const struct TagList *tl, unsigned char *d, int *off)
705{
706 unsigned int counter = 0;
707 unsigned int start_off = *off;
708
709 d = serial_dump_int(0xdeadbeef, d, off);
710
711 struct Tag *tag = NULL;
712 STAILQ_FOREACH(tag, tl, entries)
713 {
714 d = serial_dump_char(tag->name, d, off, false);
715 counter++;
716 }
717
718 memcpy(d + start_off, &counter, sizeof(int));
719
720 return d;
721}
722
729void serial_restore_tags(struct TagList *tl, const unsigned char *d, int *off)
730{
731 unsigned int counter = 0;
732
733 serial_restore_int(&counter, d, off);
734
735 if (counter > SERIAL_MAX_LIST_COUNT)
736 return;
737
738 while (counter > 0)
739 {
740 char *name = NULL;
741 serial_restore_char(&name, d, off, false);
743 counter--;
744 }
745}
void mutt_addrlist_append(struct AddressList *al, struct Address *a)
Append an Address to an AddressList.
Definition address.c:1489
struct Address * mutt_addr_new(void)
Create a new Address.
Definition address.c:401
Email Address Handling.
void mutt_auto_subscribe(const char *mailto)
Check if user is subscribed to mailing list.
Definition commands.c:49
Email Aliases.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition buffer.c:291
void buf_free(struct Buffer **ptr)
Deallocates a buffer.
Definition buffer.c:319
struct Buffer * buf_new(const char *str)
Allocate a new Buffer.
Definition buffer.c:304
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition buffer.c:226
void buf_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
Definition buffer.c:337
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
Convenience wrapper for the config headers.
const char * cc_charset(void)
Get the cached value of $charset.
Convenience wrapper for the core headers.
Structs that make up an email.
struct ListNode * mutt_list_insert_tail(struct ListHead *h, char *s)
Append a string to the end of a List.
Definition list.c:65
void mutt_mem_realloc(void *pptr, size_t size)
Resize a block of memory on the heap.
Definition memory.c:146
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
#define MUTT_MEM_MALLOC(n, type)
Definition memory.h:53
int mutt_ch_convert_string(char **ps, const char *from, const char *to, uint8_t flags)
Convert a string between encodings.
Definition charset.c:817
#define MUTT_ICONV_NONE
No flags are set.
Definition charset.h:66
Convenience wrapper for the library headers.
char * mutt_strn_dup(const char *begin, size_t len)
Duplicate a sub-string.
Definition string.c:384
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition string.c:257
bool mutt_str_is_ascii(const char *str, size_t len)
Is a string ASCII (7-bit)?
Definition string.c:688
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition string.c:503
struct Parameter * mutt_param_new(void)
Create a new Parameter.
Definition parameter.c:40
#define TAILQ_FOREACH(var, head, field)
Definition queue.h:782
#define TAILQ_INIT(head)
Definition queue.h:822
#define TAILQ_INSERT_TAIL(head, elm, field)
Definition queue.h:866
#define STAILQ_FOREACH(var, head, field)
Definition queue.h:390
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:535
unsigned char * serial_dump_tags(const struct TagList *tl, unsigned char *d, int *off)
Pack a TagList into a binary blob.
Definition serialize.c:704
void serial_restore_tags(struct TagList *tl, const unsigned char *d, int *off)
Unpack a TagList from a binary blob.
Definition serialize.c:729
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:106
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:209
unsigned char * serial_dump_int(const unsigned int i, unsigned char *d, int *off)
Pack an integer into a binary blob.
Definition serialize.c:74
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:395
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:650
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:602
static uint32_t body_pack_flags(const struct Body *b)
Pack the Body flags into a uint32_t.
Definition serialize.c:475
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:372
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:346
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:246
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:145
void lazy_realloc(void *ptr, size_t size)
Reallocate some memory.
Definition serialize.c:57
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:419
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:567
#define SERIAL_MAX_LIST_COUNT
Max entries in a serialized list (addresses, headers, parameters, tags)
Definition serialize.c:48
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:90
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:319
#define SERIAL_MAX_CHAR_SIZE
Max size for a single serialized string field (256 KiB)
Definition serialize.c:45
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:447
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:160
static void body_unpack_flags(struct Body *b, uint32_t packed)
Unpack the Body flags from a uint32_t.
Definition serialize.c:505
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:275
void serial_restore_int(unsigned int *i, const unsigned char *d, int *off)
Unpack an integer from a binary blob.
Definition serialize.c:121
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:133
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:197
Email-object serialiser.
An email address.
Definition address.h:35
struct Buffer * personal
Real name of address.
Definition address.h:36
bool group
Group mailbox?
Definition address.h:38
struct Buffer * mailbox
Mailbox and host address.
Definition address.h:37
The body of an email.
Definition body.h:36
char * content_id
Content-Id (RFC2392)
Definition body.h:58
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:62
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:63
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:61
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:60
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:59
String manipulation buffer.
Definition buffer.h:36
char * data
Pointer to data.
Definition buffer.h:37
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
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
char * followup_to
List of 'followup-to' fields.
Definition envelope.h:80
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:81
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:83
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 *const real_subj
Offset of the real subject.
Definition envelope.h:71
char * date
Sent date.
Definition envelope.h:75
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:37
char * data
String.
Definition list.h:38
Container for Accounts, Notifications.
Definition neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
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:41
char * name
Tag name.
Definition tags.h:42
void driver_tags_add(struct TagList *tl, char *new_tag)
Add a tag to header.
Definition tags.c:105