We need a email to Json converter, with a imap mailbox, you have to parse it and create the json of
Should work with inline image and attachment.
Process of the script
1. connect to the imap mailbox
2. parse the mailbox with imap_search
3. Create the json of each email nin the box