Hi everyone,
im hoping someone will know the answer to this, its been puzzling me for days!
Im currently writing an email client and having some trouble reading the nested messages, everthing else seems to work fine and as it should do.
Im parsing a structure returned from imap_fetchstructure to obtain each message parts information and more importantly the part specifier, so that i can retrieve the part with imap_fetchbody.
The parsing function written works fine and as it should do listing each part specifier according to the IMAP4 spec.
However here lies my problem, when using any part specifier in imap_fetchbody to obtain any parts of the nested message, the function returns an empty string.
Ive seen on many notes complimenting the imap_fetchbody function that indicate PHP doesnt follow the IMAP spec when it comes to nested messages. But none of the notes give a very clear explination of how to go about doing it.
Im wondering if anyone can break it down for me in the same way as the following:
This is an example of the part specifiers of the imap spec.
HEADER ([RFC-822] header of the message)
TEXT MULTIPART/MIXED
1 TEXT/PLAIN
2 APPLICATION/OCTET-STREAM
3 MESSAGE/RFC822
3.HEADER ([RFC-822] header of the message)
3.TEXT ([RFC-822] text body of the message)
3.1 TEXT/PLAIN
3.2 APPLICATION/OCTET-STREAM
4 MULTIPART/MIXED
4.1 IMAGE/GIF
4.1.MIME ([MIME-IMB] header for the IMAGE/GIF)
4.2 MESSAGE/RFC822
4.2.HEADER ([RFC-822] header of the message)
4.2.TEXT ([RFC-822] text body of the message)
4.2.1 TEXT/PLAIN
4.2.2 MULTIPART/ALTERNATIVE
4.2.2.1 TEXT/PLAIN
4.2.2.2 TEXT/RICHTEXT
It would be wonderful if someoen could copy the above and change the part specifiers as to how PHP sees them with regards to the nested messages.
I do realise however that imap_fetchbody cannot accept the text versions of the part specifier (e.g. 4.1.HEADER above ), Im not too interested in these parts, but just the other parts of the message, (e.g. 4.2.1 above)
Thanks in advance, even for taking the time to read if not replying 🙂