![]() |
POP3/SMTP library, converted from fMailbox (Flourish framework) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: POP3/SMTP library, converted from fMailbox (Flourish framework) (/showthread.php?tid=30251) |
POP3/SMTP library, converted from fMailbox (Flourish framework) - El Forum - 05-07-2010 [eluser]steelaz[/eluser] I tried to run fMailbox class stand-alone and it worked quite well, so I decided to use it on my CodeIgniter application. I had to change how this class is initiated to use it as regular CodeIgniter library. Also in some places I had to replace Flourish exceptions with CodeIgniter’s error handling. So, this is how you initiate library with just required parameters: Code: $config['type'] = 'imap'; More options are available: Code: $config['type'] = 'imap'; And this is how you call methods: Code: $messages = $this->mailbox->listMessages(10); So it works basically as documented here, but you have to pass initial arguments as array. Hope someone will find it useful. Installation: extract and copy Mailbox.php to your "libraries" directory. Original documentation: http://flourishlib.com/docs/fMailbox Download: http://www.arnas.net/blog/wp-content/plugins/download-monitor/download.php?id=Mailbox+library+for+CodeIgniter POP3/SMTP library, converted from fMailbox (Flourish framework) - El Forum - 05-11-2010 [eluser]PoetaWD[/eluser] This is pretty AWESOME! But you should find a way to implement this without modifying the code of the class.. it is still under development so it should be a easier way to update the class... I havent looked at the code yet... but I will sure use it in my application since I havent found anything like this before ! Thanks! POP3/SMTP library, converted from fMailbox (Flourish framework) - El Forum - 05-11-2010 [eluser]steelaz[/eluser] Hey PoetaWD, it shouldn't be too hard to update this library when fMailbox is updated, 99% of the code is still original fMailbox class. If you really want to use original fMailbox in CodeIgniter, you can try including it along with dependencies (various Flourish exception classes) and I think it should work. POP3/SMTP library, converted from fMailbox (Flourish framework) - El Forum - 06-03-2010 [eluser]whobutsb[/eluser] So happy to find this library, I've been wanting to use portions of the flourish library but not the whole thing. The one issue i'm having is when I use $this->mailbox->fetchMessage($uid); The fetchMessage method is only returning the uid in the array. I can't seem to get any of the additional info about the message. Has anyone else run in to this? POP3/SMTP library, converted from fMailbox (Flourish framework) - El Forum - 06-03-2010 [eluser]steelaz[/eluser] whobutsb, did you try accessing the same mailbox with standard Flourish library? POP3/SMTP library, converted from fMailbox (Flourish framework) - El Forum - 06-03-2010 [eluser]whobutsb[/eluser] No I haven't. I did some research in to the Mailbox library that you had setup and it only occurs when I'm trying to fetchMessages that were undeliverable. I'm actually trying to build a function that looks for bounced emails in the mailbox, and puts the in-valid email address into the database. The area it seems to get held up on is the parseStructure method, where it can't seem to parse the original message included in the bounced email. Do you think there is a better way of handling bounced emails? POP3/SMTP library, converted from fMailbox (Flourish framework) - El Forum - 06-03-2010 [eluser]steelaz[/eluser] I just checked and you are right, fetchMessage() fails with bounced emails. It looks like it fails because content-type part of header is missing in bounced email. To fix it, I added default conent-type as "text/plain". Go to parseStructure() function and below Code: if (!$headers) { add Code: if (!isset($headers['content-type']['value'])) This worked for me, but I'm submitting bug report to Flourish bug tracker and will see what they'll come up with. POP3/SMTP library, converted from fMailbox (Flourish framework) - El Forum - 06-03-2010 [eluser]whobutsb[/eluser] Great! Thanks for looking into that. I'm going to add your code to my library. POP3/SMTP library, converted from fMailbox (Flourish framework) - El Forum - 06-04-2010 [eluser]steelaz[/eluser] Official fix just came in (that was fast!), take a look - http://flourishlib.com/changeset/845 POP3/SMTP library, converted from fMailbox (Flourish framework) - El Forum - 06-04-2010 [eluser]whobutsb[/eluser] Wow that was fast. Thanks for researching and letting them know! |