summaryrefslogtreecommitdiffstats
path: root/src/lib-mail/message-binary-part.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:36:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:36:47 +0000
commit0441d265f2bb9da249c7abf333f0f771fadb4ab5 (patch)
tree3f3789daa2f6db22da6e55e92bee0062a7d613fe /src/lib-mail/message-binary-part.h
parentInitial commit. (diff)
downloaddovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.tar.xz
dovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.zip
Adding upstream version 1:2.3.21+dfsg1.upstream/1%2.3.21+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib-mail/message-binary-part.h')
-rw-r--r--src/lib-mail/message-binary-part.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib-mail/message-binary-part.h b/src/lib-mail/message-binary-part.h
new file mode 100644
index 0000000..f30033a
--- /dev/null
+++ b/src/lib-mail/message-binary-part.h
@@ -0,0 +1,29 @@
+#ifndef MESSAGE_BINARY_PART_H
+#define MESSAGE_BINARY_PART_H
+
+struct message_binary_part {
+ struct message_binary_part *next;
+
+ /* Absolute position from beginning of message. This can be used to
+ match the part to struct message_part. */
+ uoff_t physical_pos;
+ /* Decoded binary header/body size. The binary header size may differ
+ from message_part's, because Content-Transfer-Encoding is changed to
+ "binary". */
+ uoff_t binary_hdr_size;
+ uoff_t binary_body_size;
+ /* BODYSTRUCTURE for text/ and message/rfc822 parts includes lines
+ count. Decoding may change these numbers. */
+ unsigned int binary_body_lines_count;
+};
+
+/* Serialize message binary_part. */
+void message_binary_part_serialize(const struct message_binary_part *parts,
+ buffer_t *dest);
+
+/* Generate struct message_binary_part from serialized data. Returns 0 if ok,
+ -1 if any problems are detected. */
+int message_binary_part_deserialize(pool_t pool, const void *data, size_t size,
+ struct message_binary_part **parts_r);
+
+#endif