jonhoo / rust-imap

IMAP client library for Rust
Apache License 2.0
477 stars 80 forks source link

Attachments #258

Closed JasterV closed 1 year ago

JasterV commented 1 year ago

Hello there:) This is more a question than an issue.

Is it possible to read the attachments of an email? Since IMAP protocol supports it I was wondering if this library can also handle that, otherwise I could try to contribute :)

Thank you rocket

jonhoo commented 1 year ago

Hey! You should be able to grab any part of the body (including attachments) through the use of Session::fetch and then inspecting the resulting Fetch responses. The attachments will generally be outlined in the "bodystructure" part of Fetch, which you can then fetch explicitly later on using BODY. This StackOverflow answer has some pointers that may prove useful :)