Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

fMailbox.php - updated

posted by morg. 7 years ago

Well . I had to use fMailbox, fixed a few things and extended the class a bit (some functions might be of little general interest though), thought I'd share it back (especially for the fixes).

Fixes (that I remember...): parseStructure (some Lotus Note or related e-mail had 'Boundary' instead of 'boundary', added array_key checks to adapt)

Additions (some of which might not belong in a lib - also no pop3 versions):

saveFileAttach($path,$attachment) mails2Array($messages) - put all found emails in an array, somewhat adapted to my own needs though unboxMessage($message) - to flatten an email in a format that suited me, could be adapted/upgraded listUnseenMessages() - standard example of imap query markAsUnreadMessages($uid) - stuff I needed for testing

Uhm . where do I post that anyway .?

Your best bet would probably be to create a patch for the fix(es) and send it to will or post it as a ticket describing the problem and what it fixes.

Anything that is highly suited for your needs in terms of the additions probably won't get added unless it seems generally useful as well. Additionally, if I'm not mistaken, I didn't think Will wanted to have methods which would be supported by IMAP that weren't supported by POP3. One of the general goals I think is to normalize the access -- if this means more limited support for IMAP cause POP3 operates differently, so be it.

It might even make more sense just to make an fIMAPMailbox class which simply extends fMailbox with those things specific to IMAP.

posted by mattsah 7 years ago

@Morg. I'm really interested in the changes you're talking about regarding fMailbox. Can you post your code somewhere?

Kind regards

posted by jozydapozy 7 years ago

Right mhh sorry for the wait ;)

http://pastebin.com/yNmrFES1

posted by morg. 7 years ago

Hi Morg. Thanks for you code. Looks nice!

posted by jozydapozy 7 years ago