OK. Here's the dig. I'm making a webmail client and I've pretty much figured out everything there is to reading and downloading attachments using imap_fetchstructure and imap_fetchbody... except for one nasty situation, mainly messages attached to other messages (this happens as a result of forwarding a message). I understand that I can use , f.e. '2.1', '2.2' and such as parameters to imap_fetchbody to retrieve the various parts of the attached message, but this method is a blind shot without knowing the actual structure of the attached message. How can I get that structure?
Nevermind, I've figured it out myself and I'm posting it so that future generations have a brighter living . The only way to do it is to use imap_append to create a temporary copy of the attached message, read from it all the data you need and then delete it afterwards. Pretty labor-intensive for the server..., but I guess until the interface changes completely I'm not one to complain.