NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
email.c File Reference

Dump an Email. More...

#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include "mutt/lib.h"
#include "address/lib.h"
#include "email/lib.h"
#include "lib.h"
#include "attach/lib.h"
#include "ncrypt/lib.h"
+ Include dependency graph for email.c:

Go to the source code of this file.

Macros

#define ADD_FLAG(F)
 
#define ADDR_LIST(AL)
 
#define OPT_STRING(S)
 
#define ADD_FLAG(F)
 
#define ADD_FLAG(F)
 
#define ADD_FLAG(F)
 
#define OPT_STRING(S)
 
#define ADD_FLAG(F)
 

Functions

void dump_addr_list (char *buf, size_t buflen, const struct AddressList *al, const char *name)
 Dump an address list.
 
void dump_list_head (const struct ListHead *list, const char *name)
 Dump a list of strings.
 
void dump_envelope (const struct Envelope *env)
 Dump an envelope.
 
void dump_email (const struct Email *e)
 Dump an email message.
 
void dump_param_list (const struct ParameterList *pl)
 Dump a parameter list.
 
void dump_body (const struct Body *body)
 Dump a message body.
 
void dump_attach (const struct AttachPtr *att)
 Dump an attachment.
 
char body_name (const struct Body *b)
 Get the first character of a body.
 
void dump_body_next (struct Buffer *buf, const struct Body *b)
 Dump the body tree structure.
 
void dump_body_one_line (const struct Body *b)
 Dump body layout as a one-line summary.
 

Detailed Description

Dump an Email.

Authors
  • Richard Russon

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 email.c.

Macro Definition Documentation

◆ ADD_FLAG [1/5]

#define ADD_FLAG ( F)
Value:
add_flag(buf, (env->changed & F), #F)
void add_flag(struct Buffer *buf, bool is_set, const char *name)
Add a flag name to a buffer if set.
Definition common.c:40

◆ ADDR_LIST

#define ADDR_LIST ( AL)
Value:
dump_addr_list(arr, sizeof(arr), &env->AL, #AL)
void dump_addr_list(char *buf, size_t buflen, const struct AddressList *al, const char *name)
Dump an address list.
Definition email.c:47

◆ OPT_STRING [1/2]

#define OPT_STRING ( S)
Value:
if (env->S) \
mutt_debug(LL_DEBUG1, "\t%s: %s\n", #S, env->S)
@ LL_DEBUG1
Log at debug level 1.
Definition logging2.h:45

◆ ADD_FLAG [2/5]

#define ADD_FLAG ( F)
Value:
add_flag(buf, e->F, #F)

◆ ADD_FLAG [3/5]

#define ADD_FLAG ( F)
Value:
add_flag(buf, (e->security & F), #F)

◆ ADD_FLAG [4/5]

#define ADD_FLAG ( F)
Value:
add_flag(buf, body->F, #F)

◆ OPT_STRING [2/2]

#define OPT_STRING ( S)
Value:
if (body->S) \
mutt_debug(LL_DEBUG1, "\t%s: %s\n", #S, body->S)

◆ ADD_FLAG [5/5]

#define ADD_FLAG ( F)
Value:
add_flag(buf, att->F, #F)

Function Documentation

◆ dump_addr_list()

void dump_addr_list ( char * buf,
size_t buflen,
const struct AddressList * al,
const char * name )

Dump an address list.

Parameters
bufBuffer to write to
buflenLength of buffer
alAddress list to dump
nameName of the list

Definition at line 47 of file email.c.

48{
49 if (!buf || !al)
50 return;
51 if (TAILQ_EMPTY(al))
52 return;
53
54 buf[0] = '\0';
55 struct Buffer *tmpbuf = buf_pool_get();
56 mutt_addrlist_write(al, tmpbuf, true);
57 mutt_str_copy(buf, buf_string(tmpbuf), buflen);
58 buf_pool_release(&tmpbuf);
59
60 mutt_debug(LL_DEBUG1, "\t%s: %s\n", name, buf);
61}
size_t mutt_addrlist_write(const struct AddressList *al, struct Buffer *buf, bool display)
Write an Address to a buffer.
Definition address.c:1210
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
#define mutt_debug(LEVEL,...)
Definition logging2.h:91
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition string.c:583
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:91
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:111
#define TAILQ_EMPTY(head)
Definition queue.h:778
String manipulation buffer.
Definition buffer.h:36
+ Here is the call graph for this function:

◆ dump_list_head()

void dump_list_head ( const struct ListHead * list,
const char * name )

Dump a list of strings.

Parameters
listList to dump
nameName of the list

Definition at line 68 of file email.c.

69{
70 if (!list || !name)
71 return;
72 if (STAILQ_EMPTY(list))
73 return;
74
75 struct Buffer *buf = buf_pool_get();
76
77 struct ListNode *np = NULL;
78 STAILQ_FOREACH(np, list, entries)
79 {
80 if (!buf_is_empty(buf))
81 buf_addch(buf, ',');
82 buf_addstr(buf, np->data);
83 }
84
85 mutt_debug(LL_DEBUG1, "\t%s: %s\n", name, buf_string(buf));
86 buf_pool_release(&buf);
87}
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition buffer.c:291
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
Definition buffer.c:241
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition buffer.c:226
#define STAILQ_FOREACH(var, head, field)
Definition queue.h:390
#define STAILQ_EMPTY(head)
Definition queue.h:382
A List node for strings.
Definition list.h:37
char * data
String.
Definition list.h:38
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump_envelope()

void dump_envelope ( const struct Envelope * env)

Dump an envelope.

Parameters
envEnvelope to dump

Helper to add a flag to debug output

Helper to dump an address list with debug output

Helper to print optional string fields

Definition at line 93 of file email.c.

94{
95 mutt_debug(LL_DEBUG1, "Envelope\n");
96
97 if (!env)
98 {
99 mutt_debug(LL_DEBUG1, "\tNULL pointer\n");
100 return;
101 }
102
103 struct Buffer *buf = buf_pool_get();
104 char arr[1024];
105
107#define ADD_FLAG(F) add_flag(buf, (env->changed & F), #F)
112#undef ADD_FLAG
113 mutt_debug(LL_DEBUG1, "\tchanged: %s\n", buf_is_empty(buf) ? "[NONE]" : buf_string(buf));
114
116#define ADDR_LIST(AL) dump_addr_list(arr, sizeof(arr), &env->AL, #AL)
117 ADDR_LIST(return_path);
118 ADDR_LIST(from);
119 ADDR_LIST(to);
120 ADDR_LIST(cc);
121 ADDR_LIST(bcc);
122 ADDR_LIST(sender);
123 ADDR_LIST(reply_to);
124 ADDR_LIST(mail_followup_to);
125 ADDR_LIST(x_original_to);
126#undef ADDR_LIST
127
129#define OPT_STRING(S) \
130 if (env->S) \
131 mutt_debug(LL_DEBUG1, "\t%s: %s\n", #S, env->S)
132 OPT_STRING(list_post);
133 OPT_STRING(list_subscribe);
134 OPT_STRING(list_unsubscribe);
135 OPT_STRING(subject);
136 OPT_STRING(real_subj);
137 OPT_STRING(disp_subj);
138 OPT_STRING(message_id);
139 OPT_STRING(supersedes);
140 OPT_STRING(date);
141 OPT_STRING(x_label);
142 OPT_STRING(organization);
143 OPT_STRING(newsgroups);
144 OPT_STRING(xref);
145 OPT_STRING(followup_to);
146 OPT_STRING(x_comment_to);
147#undef OPT_STRING
148
149 dump_list_head(&env->references, "references");
150 dump_list_head(&env->in_reply_to, "in_reply_to");
151 dump_list_head(&env->userhdrs, "userhdrs");
152
153 if (!buf_is_empty(&env->spam))
154 mutt_debug(LL_DEBUG1, "\tspam: %s\n", buf_string(&env->spam));
155
156#ifdef USE_AUTOCRYPT
157 if (env->autocrypt)
158 mutt_debug(LL_DEBUG1, "\tautocrypt: %p\n", (void *) env->autocrypt);
159 if (env->autocrypt_gossip)
160 mutt_debug(LL_DEBUG1, "\tautocrypt_gossip: %p\n", (void *) env->autocrypt_gossip);
161#endif
162
163 buf_pool_release(&buf);
164}
void dump_list_head(const struct ListHead *list, const char *name)
Dump a list of strings.
Definition email.c:68
#define OPT_STRING(S)
#define ADDR_LIST(AL)
#define ADD_FLAG(F)
#define MUTT_ENV_CHANGED_SUBJECT
Protected header update.
Definition envelope.h:37
#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
struct ListHead userhdrs
user defined headers
Definition envelope.h:85
struct AutocryptHeader * autocrypt_gossip
Autocrypt Gossip header.
Definition envelope.h:88
struct ListHead references
message references (in reverse order)
Definition envelope.h:83
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
+ Here is the call graph for this function:

◆ dump_email()

void dump_email ( const struct Email * e)

Dump an email message.

Parameters
eEmail to dump

Helper to add an email flag to debug output

Helper to add a security flag to debug output

Definition at line 170 of file email.c.

171{
172 mutt_debug(LL_DEBUG1, "Email\n");
173
174 if (!e)
175 {
176 mutt_debug(LL_DEBUG1, "\tNULL pointer\n");
177 return;
178 }
179
180 struct Buffer *buf = buf_pool_get();
181 char arr[256];
182
183 mutt_debug(LL_DEBUG1, "\tpath: %s\n", e->path);
184
186#define ADD_FLAG(F) add_flag(buf, e->F, #F)
187 ADD_FLAG(active);
188 ADD_FLAG(attach_del);
189 ADD_FLAG(attach_valid);
190 ADD_FLAG(changed);
191 ADD_FLAG(collapsed);
192 ADD_FLAG(deleted);
193 ADD_FLAG(display_subject);
194 ADD_FLAG(expired);
195 ADD_FLAG(flagged);
196 ADD_FLAG(matched);
197 ADD_FLAG(mime);
198 ADD_FLAG(old);
199 ADD_FLAG(purge);
200 ADD_FLAG(quasi_deleted);
201 ADD_FLAG(read);
202 ADD_FLAG(recip_valid);
203 ADD_FLAG(replied);
204 ADD_FLAG(searched);
205 ADD_FLAG(subject_changed);
206 ADD_FLAG(superseded);
207 ADD_FLAG(tagged);
208 ADD_FLAG(threaded);
209 ADD_FLAG(trash);
210 ADD_FLAG(visible);
211#undef ADD_FLAG
212 mutt_debug(LL_DEBUG1, "\tFlags: %s\n", buf_is_empty(buf) ? "[NONE]" : buf_string(buf));
213
215#define ADD_FLAG(F) add_flag(buf, (e->security & F), #F)
216 buf_reset(buf);
231#undef ADD_FLAG
232 mutt_debug(LL_DEBUG1, "\tSecurity: %s\n", buf_is_empty(buf) ? "[NONE]" : buf_string(buf));
233
234 mutt_date_make_tls(arr, sizeof(arr), e->date_sent);
235 mutt_debug(LL_DEBUG1, "\tSent: %s (%c%02u%02u)\n", arr,
236 e->zoccident ? '-' : '+', e->zhours, e->zminutes);
237
238 mutt_date_make_tls(arr, sizeof(arr), e->received);
239 mutt_debug(LL_DEBUG1, "\tRecv: %s\n", arr);
240
241 buf_pool_release(&buf);
242
243 mutt_debug(LL_DEBUG1, "\tnum_hidden: %ld\n", e->num_hidden);
244 mutt_debug(LL_DEBUG1, "\trecipient: %d\n", e->recipient);
245 mutt_debug(LL_DEBUG1, "\toffset: %ld\n", e->offset);
246 mutt_debug(LL_DEBUG1, "\tlines: %d\n", e->lines);
247 mutt_debug(LL_DEBUG1, "\tindex: %d\n", e->index);
248 mutt_debug(LL_DEBUG1, "\tmsgno: %d\n", e->msgno);
249 mutt_debug(LL_DEBUG1, "\tvnum: %d\n", e->vnum);
250 mutt_debug(LL_DEBUG1, "\tscore: %d\n", e->score);
251 mutt_debug(LL_DEBUG1, "\tattach_total: %d\n", e->attach_total);
252 // if (e->maildir_flags)
253 // mutt_debug(LL_DEBUG1, "\tmaildir_flags: %s\n", e->maildir_flags);
254
255 // struct MuttThread *thread
256 // struct Envelope *env
257 // struct Body *content
258 // struct TagList tags
259
260 // void *edata
261}
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition buffer.c:76
int mutt_date_make_tls(char *buf, size_t buflen, time_t timestamp)
Format date in TLS certificate verification style.
Definition date.c:838
#define SEC_INLINE
Email has an inline signature.
Definition lib.h:93
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
Definition lib.h:95
#define SEC_OPPENCRYPT
Opportunistic encrypt mode.
Definition lib.h:94
#define PGP_TRADITIONAL_CHECKED
Email has a traditional (inline) signature.
Definition lib.h:100
#define SEC_GOODSIGN
Email has a valid signature.
Definition lib.h:88
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition lib.h:98
#define SEC_SIGNOPAQUE
Email has an opaque signature (encrypted)
Definition lib.h:91
#define SEC_BADSIGN
Email has a bad signature.
Definition lib.h:89
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition lib.h:99
#define SEC_PARTSIGN
Not all parts of the email is signed.
Definition lib.h:90
#define SEC_ENCRYPT
Email is encrypted.
Definition lib.h:86
#define SEC_AUTOCRYPT_OVERRIDE
(Autocrypt) Indicates manual set/unset of encryption
Definition lib.h:96
#define SEC_SIGN
Email is signed.
Definition lib.h:87
#define SEC_KEYBLOCK
Email has a key attached.
Definition lib.h:92
unsigned int zminutes
Minutes away from UTC.
Definition email.h:57
int lines
How many lines in the body of this message?
Definition email.h:62
size_t num_hidden
Number of hidden messages in this view (only valid when collapsed is set)
Definition email.h:123
bool zoccident
True, if west of UTC, False if east.
Definition email.h:58
LOFF_T offset
Where in the stream does this message begin?
Definition email.h:71
short attach_total
Number of qualifying attachments in message, if attach_valid.
Definition email.h:115
unsigned int zhours
Hours away from UTC.
Definition email.h:56
time_t date_sent
Time when the message was sent (UTC)
Definition email.h:60
int vnum
Virtual message number.
Definition email.h:114
int score
Message score.
Definition email.h:113
int msgno
Number displayed to the user.
Definition email.h:111
char * path
Path of Email (for local Mailboxes)
Definition email.h:70
int index
The absolute (unsorted) message number.
Definition email.h:110
short recipient
User_is_recipient()'s return value, cached.
Definition email.h:116
time_t received
Time when the message was placed in the mailbox.
Definition email.h:61
+ Here is the call graph for this function:

◆ dump_param_list()

void dump_param_list ( const struct ParameterList * pl)

Dump a parameter list.

Parameters
plParameter list to dump

Definition at line 267 of file email.c.

268{
269 mutt_debug(LL_DEBUG1, "\tparameters\n");
270
271 if (!pl)
272 {
273 mutt_debug(LL_DEBUG1, "\tNULL pointer\n");
274 return;
275 }
276
277 if (TAILQ_EMPTY(pl))
278 {
279 mutt_debug(LL_DEBUG1, "\tempty\n");
280 return;
281 }
282
283 struct Parameter *np = NULL;
284 TAILQ_FOREACH(np, pl, entries)
285 {
286 mutt_debug(LL_DEBUG1, "\t\t%s = %s\n", NONULL(np->attribute), NONULL(np->value));
287 }
288}
#define TAILQ_FOREACH(var, head, field)
Definition queue.h:782
#define NONULL(x)
Definition string2.h:44
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
+ Here is the caller graph for this function:

◆ dump_body()

void dump_body ( const struct Body * body)

Dump a message body.

Parameters
bodyBody to dump

Helper to add a body flag to debug output

Helper to print optional string fields in body

Definition at line 294 of file email.c.

295{
296 mutt_debug(LL_DEBUG1, "Body\n");
297
298 if (!body)
299 {
300 mutt_debug(LL_DEBUG1, "\tNULL pointer\n");
301 return;
302 }
303
304 struct Buffer *buf = buf_pool_get();
305 char arr[256];
306
308#define ADD_FLAG(F) add_flag(buf, body->F, #F)
309 ADD_FLAG(attach_qualifies);
310 ADD_FLAG(badsig);
311 ADD_FLAG(deleted);
312 ADD_FLAG(force_charset);
313 ADD_FLAG(goodsig);
314#ifdef USE_AUTOCRYPT
315 ADD_FLAG(is_autocrypt);
316#endif
317 ADD_FLAG(noconv);
318 ADD_FLAG(tagged);
319 ADD_FLAG(unlink);
320 ADD_FLAG(use_disp);
321 ADD_FLAG(warnsig);
322#undef ADD_FLAG
323 mutt_debug(LL_DEBUG1, "\tFlags: %s\n", buf_is_empty(buf) ? "[NONE]" : buf_string(buf));
324
326#define OPT_STRING(S) \
327 if (body->S) \
328 mutt_debug(LL_DEBUG1, "\t%s: %s\n", #S, body->S)
329 OPT_STRING(charset);
330 OPT_STRING(description);
331 OPT_STRING(d_filename);
332 OPT_STRING(filename);
333 OPT_STRING(form_name);
334 OPT_STRING(language);
335 OPT_STRING(subtype);
336 OPT_STRING(xtype);
337#undef OPT_STRING
338
339 mutt_debug(LL_DEBUG1, "\thdr_offset: %ld\n", body->hdr_offset);
340 mutt_debug(LL_DEBUG1, "\toffset: %ld\n", body->offset);
341 mutt_debug(LL_DEBUG1, "\tlength: %ld\n", body->length);
342 mutt_debug(LL_DEBUG1, "\tattach_count: %d\n", body->attach_count);
343
344 mutt_debug(LL_DEBUG1, "\tcontent type: %s\n", name_content_type(body->type));
345 mutt_debug(LL_DEBUG1, "\tcontent encoding: %s\n", name_content_encoding(body->encoding));
346 mutt_debug(LL_DEBUG1, "\tcontent disposition: %s\n",
348
349 if (body->stamp != 0)
350 {
351 mutt_date_make_tls(arr, sizeof(arr), body->stamp);
352 mutt_debug(LL_DEBUG1, "\tstamp: %s\n", arr);
353 }
354
356
357 // struct Content *content; ///< Detailed info about the content of the attachment.
358 // struct Body *next; ///< next attachment in the list
359 // struct Body *parts; ///< parts of a multipart or message/rfc822
360 // struct Email *email; ///< header information for message/rfc822
361 // struct AttachPtr *aptr; ///< Menu information, used in recvattach.c
362 // struct Envelope *mime_headers; ///< Memory hole protected headers
363
364 if (body->next)
365 {
366 mutt_debug(LL_DEBUG1, "-NEXT-------------------------\n");
367 dump_body(body->next);
368 }
369 if (body->parts)
370 {
371 mutt_debug(LL_DEBUG1, "-PARTS-------------------------\n");
372 dump_body(body->parts);
373 }
374 if (body->next || body->parts)
375 mutt_debug(LL_DEBUG1, "--------------------------\n");
376 buf_pool_release(&buf);
377}
void dump_param_list(const struct ParameterList *pl)
Dump a parameter list.
Definition email.c:267
void dump_body(const struct Body *body)
Dump a message body.
Definition email.c:294
const char * name_content_encoding(enum ContentEncoding enc)
Get the name of a content encoding.
Definition names.c:177
const char * name_content_type(enum ContentType type)
Get the name of a content type.
Definition names.c:154
const char * name_content_disposition(enum ContentDisposition disp)
Get the name of a content disposition.
Definition names.c:197
struct Body * parts
parts of a multipart or message/rfc822
Definition body.h:73
LOFF_T offset
offset where the actual data begins
Definition body.h:52
signed short attach_count
Number of attachments.
Definition body.h:91
time_t stamp
Time stamp of last encoding update.
Definition body.h:77
LOFF_T length
length (in bytes) of attachment
Definition body.h:53
struct ParameterList parameter
Parameters of the content-type.
Definition body.h:63
unsigned int disposition
content-disposition, ContentDisposition
Definition body.h:42
struct Body * next
next attachment in the list
Definition body.h:72
unsigned int encoding
content-transfer-encoding, ContentEncoding
Definition body.h:41
long hdr_offset
Offset in stream where the headers begin.
Definition body.h:81
unsigned int type
content-type primary type, ContentType
Definition body.h:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump_attach()

void dump_attach ( const struct AttachPtr * att)

Dump an attachment.

Parameters
attAttachment to dump

Helper to add an attach flag to debug output

Definition at line 383 of file email.c.

384{
385 mutt_debug(LL_DEBUG1, "AttachPtr\n");
386
387 if (!att)
388 {
389 mutt_debug(LL_DEBUG1, "\tNULL pointer\n");
390 return;
391 }
392
393 struct Buffer *buf = buf_pool_get();
394
396#define ADD_FLAG(F) add_flag(buf, att->F, #F)
397 ADD_FLAG(unowned);
398 ADD_FLAG(decrypted);
399 ADD_FLAG(collapsed);
400#undef ADD_FLAG
401
402 if (att->fp)
403 mutt_debug(LL_DEBUG1, "\tfp: %p (%d)\n", (void *) att->fp, fileno(att->fp));
404 mutt_debug(LL_DEBUG1, "\tparent_type: %d\n", att->parent_type);
405 mutt_debug(LL_DEBUG1, "\tlevel: %d\n", att->level);
406 mutt_debug(LL_DEBUG1, "\tnum: %d\n", att->num);
407
408 // struct Body *content; ///< Attachment
409 buf_pool_release(&buf);
410}
int num
Attachment index number.
Definition attach.h:41
int level
Nesting depth of attachment.
Definition attach.h:40
FILE * fp
Used in the recvattach menu.
Definition attach.h:37
int parent_type
Type of parent attachment, e.g. TYPE_MULTIPART.
Definition attach.h:38
+ Here is the call graph for this function:

◆ body_name()

char body_name ( const struct Body * b)

Get the first character of a body.

Parameters
bBody to examine
Return values
charCharacter from description, filename or indicator

Definition at line 417 of file email.c.

418{
419 if (!b)
420 return '!';
421
422 if (b->type == TYPE_MULTIPART)
423 return '&';
424
425 if (b->description)
426 return b->description[0];
427
428 if (b->filename)
429 {
430 const char *base = basename(b->filename);
431 if (mutt_str_startswith(base, "neomutt-"))
432 return '0';
433
434 return base[0];
435 }
436
437 return '!';
438}
@ TYPE_MULTIPART
Type: 'multipart/*'.
Definition mime.h:37
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
Definition string.c:234
char * description
content-description
Definition body.h:55
char * filename
When sending a message, this is the file to which this structure refers.
Definition body.h:59
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump_body_next()

void dump_body_next ( struct Buffer * buf,
const struct Body * b )

Dump the body tree structure.

Parameters
bufBuffer to write to
bBody to dump

Definition at line 445 of file email.c.

446{
447 if (!b)
448 return;
449
450 buf_addstr(buf, "<");
451 for (; b; b = b->next)
452 {
453 buf_add_printf(buf, "%c", body_name(b));
454 dump_body_next(buf, b->parts);
455 if (b->next)
456 buf_addch(buf, ',');
457 }
458 buf_addstr(buf, ">");
459}
int buf_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
Definition buffer.c:204
void dump_body_next(struct Buffer *buf, const struct Body *b)
Dump the body tree structure.
Definition email.c:445
char body_name(const struct Body *b)
Get the first character of a body.
Definition email.c:417
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump_body_one_line()

void dump_body_one_line ( const struct Body * b)

Dump body layout as a one-line summary.

Parameters
bBody to summarize

Definition at line 465 of file email.c.

466{
467 if (!b)
468 return;
469
470 struct Buffer *buf = buf_pool_get();
471 buf_addstr(buf, "Body layout: ");
472 dump_body_next(buf, b);
473
474 mutt_message("%s", buf_string(buf));
475 buf_pool_release(&buf);
476}
#define mutt_message(...)
Definition logging2.h:93
+ Here is the call graph for this function: