javanile / php-imap2

PHP IMAP with OAUTH2
https://php-imap2.javanile.org/
GNU General Public License v3.0
48 stars 29 forks source link

+ Extend body parsing capabilities to match with imap_fetchstructure #12

Closed dicode-nl closed 1 year ago

dicode-nl commented 1 year ago

I've extended the BodyStructure.php to be able to parse more different message types and match output with imap_fetchstructure. Tested with over 2000+ messages

darkworks commented 1 year ago

this is much needed , please merge it

ProteanHub commented 1 year ago

This code works beautifully and fixed the issues we were having with duplicated html body, and attachments not being assigned properly. Thank you!

dicode-nl commented 1 year ago

@Orgoth can't this be fixed in a single statement like the rest of the base types

            if (is_scalar($item) && strtolower($item) == 'signed') {
                $subType = 'SIGNED';
                $section = 'parameters';
                continue;
            }
dicode-nl commented 1 year ago

@Orgoth could you send me the json for fromBodyStructure so I can run it trough the parser?

dicode-nl commented 1 year ago

Seems legit to me, pushed the changes to this PR.

dicode-nl commented 1 year ago

@Orgoth how about this version, it is more in line with the original c-client parsing which is used by php_imap

r954 commented 1 year ago

@dicode-nl So far this is working as intended! Fixed a bunch of issues I was having. Great work!

francescobianco commented 1 year ago

Hi @dicode-nl ! I wanted to say hugely thank you for your work. I have already integrated your work into the next release. I'm doing some testing but I'm sure it will be official.

Please consider supporting the users of this project by obviously charging a fee for your valuable work. Not to me but directly to those who ask for help.

Thanks too @Orgoth for the support of the project