]> git.notmuchmail.org Git - notmuch/blob - util/repair.h
Merge tag 'debian/0.29.3-1'
[notmuch] / util / repair.h
1 #ifndef _REPAIR_H
2 #define _REPAIR_H
3
4 #include "gmime-extra.h"
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 /* This is a collection of message structure and message format repair
11  * techniques that are designed to improve the user experience of
12  * notmuch */
13
14 /* If payload is a cryptographic payload within an encrypted message, and
15  * it has a "legacy display" part, then we can skip over it and jump
16  * to the actual content, because notmuch already handles protected
17  * headers appropriately.
18  *
19  * This function either returns payload directly (if it does not have
20  * a "legacy display" part), or it returns a pointer to its
21  * content-bearing subpart, with the "legacy display" part and the
22  * surrounding multipart/mixed object bypassed.
23  *
24  * No new objects are created by calling this function, and the
25  * returned object will only be released when the original part is
26  * disposed of.
27  */
28
29 GMimeObject *
30 _notmuch_repair_crypto_payload_skip_legacy_display (GMimeObject *payload);
31
32 /* Detecting and repairing "Mixed-Up MIME mangling". see
33  * https://tools.ietf.org/html/draft-dkg-openpgp-pgpmime-message-mangling-00#section-4.1
34  * If this returns NULL, the message was probably not "Mixed up".  If
35  * it returns non-NULL, then there is a newly-allocated MIME part that
36  * represents the repaired version.  The caller is responsible for
37  * ensuring that any returned object is freed with g_object_unref. */
38 GMimeObject *
39 _notmuch_repair_mixed_up_mangled (GMimeObject *part);
40
41 #ifdef __cplusplus
42 }
43 #endif
44 #endif