We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I parse BODYSTRUCTURE, as I want to find the attachments..
Using
cmd, err := imap.Wait( client.UIDFetch(uidlist, "FLAGS", "INTERNALDATE", "RFC822.SIZE", "RFC822.HEADER", "BODYSTRUCTURE") )
and then,
for _, bsv := range imap.AsList(rsp.MessageInfo().Attrs["BODYSTRUCTURE"]) { if imap.TypeOf(bsv) == imap.List { vvv := imap.AsList(bsv) fmt.Println(" ==", vvv) } }
Prints
== [["text" "plain" ["charset" "UTF-8"] <nil> <nil> "7bit" 34 1 <nil> <nil> <nil> <nil>] ["text" "html" ["charset" "UTF-8"] <nil> <nil> "7bit" 55 1 <nil> <nil> <nil> <nil>] "alternative" ["boundary" "001a1145bb103402220524805d18"] <nil> <nil> <nil>] == ["application" "pdf" ["name" "White Paper - On-train fiber optic connectivity.pdf"] <nil> <nil> "base64" 1718302 <nil> ["attachment" ["filename" "White Paper - On-train fiber optic connectivity.pdf"]] <nil> <nil>] == ["application" "pdf" ["name" "Interim Report 23.11.14.pdf"] <nil> <nil> "base64" 447908 <nil> ["attachment" ["filename" "Interim Report 23.11.14.pdf"]] <nil> <nil>] == ["image" "jpeg" ["name" "ana.jpeg"] <nil> <nil> "base64" 882306 <nil> ["attachment" ["filename" "ana.jpeg"]] <nil> <nil>] == ["boundary" "001a1145bb103402290524805d1a"]
The text was updated successfully, but these errors were encountered:
Use the As* functions to navigate the returned structure. See https://github.com/mxk/go-imap/blob/master/imap/response.go#L266 for an example and https://tools.ietf.org/html/rfc3501#section-7.4.2 for a description of BODYSTRUCTURE. There is also a test example: https://github.com/mxk/go-imap/blob/master/imap/reader_test.go#L519.
Sorry, something went wrong.
No branches or pull requests
How do I parse BODYSTRUCTURE, as I want to find the attachments..
Using
and then,
Prints
The text was updated successfully, but these errors were encountered: