diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
commit | f7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch) | |
tree | a3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /src/lib-imap-storage/imap-msgpart-url.h | |
parent | Initial commit. (diff) | |
download | dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.tar.xz dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.zip |
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib-imap-storage/imap-msgpart-url.h')
-rw-r--r-- | src/lib-imap-storage/imap-msgpart-url.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/lib-imap-storage/imap-msgpart-url.h b/src/lib-imap-storage/imap-msgpart-url.h new file mode 100644 index 0000000..5bc72c2 --- /dev/null +++ b/src/lib-imap-storage/imap-msgpart-url.h @@ -0,0 +1,50 @@ +#ifndef IMAP_MSGPART_URL_H +#define IMAP_MSGPART_URL_H + +#include "imap-msgpart.h" + +struct imap_url; +struct imap_msgpart; +struct imap_msgpart_url; + +/* Functions returning int return 1 on success, 0 if URL doesn't point to + valid mail, -1 on storage error. */ + +int imap_msgpart_url_create(struct mail_user *user, const struct imap_url *url, + struct imap_msgpart_url **url_r, + const char **client_error_r); +int imap_msgpart_url_parse(struct mail_user *user, struct mailbox *selected_box, + const char *urlstr, struct imap_msgpart_url **url_r, + const char **client_error_r); + +int imap_msgpart_url_open_mailbox(struct imap_msgpart_url *mpurl, + struct mailbox **box_r, enum mail_error *error_code_r, + const char **client_error_r); +struct mailbox *imap_msgpart_url_get_mailbox(struct imap_msgpart_url *mpurl); +int imap_msgpart_url_open_mail(struct imap_msgpart_url *mpurl, + struct mail **mail_r, + const char **client_error_r); + +struct imap_msgpart * +imap_msgpart_url_get_part(struct imap_msgpart_url *mpurl); + +/* Decode MIME parts with Content-Transfer-Encoding: base64/quoted-printable + to binary data (IMAP BINARY extension). If something can't be decoded, fails + with storage error set to MAIL_ERROR_CONVERSION. */ +void imap_msgpart_url_set_decode_to_binary(struct imap_msgpart_url *mpurl); + +/* stream_r is set to NULL when part has zero length, e.g. when partial offset + is larger than the size of the referenced part */ +int imap_msgpart_url_read_part(struct imap_msgpart_url *mpurl, + struct imap_msgpart_open_result *result_r, + const char **client_error_r); + +int imap_msgpart_url_get_bodypartstructure(struct imap_msgpart_url *mpurl, + const char **bpstruct_r, + const char **client_error_r); + +int imap_msgpart_url_verify(struct imap_msgpart_url *mpurl, + const char **client_error_r); +void imap_msgpart_url_free(struct imap_msgpart_url **mpurl); + +#endif |