Mailbox Application

Hi guys!

Thers loads of extentions for sending emails, but not for receiving emails.

Anyone know of a library well suited for yii-implenentation that can receive emails form both POP3 and IMAP?

I don’t think PHP is the best solution for this, you’ll have to pull the IMAP/POP3 messages once at a few minutes and you can do this via cron jobs or via ajax long pooling. Things will get very messy if you use long pooling with apache, you’ll end up without workers soon enough, that is if you have multiple users checking the email. So for PHP the solution remains cron jobs, run once at a few minutes and pull what’s new.

On the other hand, you could try node.js with websockets for this.

Also, there is a PHP library/framework that tries to use websockets, http://socketo.me/ , but i have never used it.

Thank you, Twisted. I will look into it.

I disagree with Twisted. There are a number of webmail applications available open source that are PHP based such as RoundCube and AfterLogic. Both of those applications perform very well in large user environments checking email via IMAP/IMAPS. The Apache servers are no where near high load either. Of course the environment is a VMware Clustered environment but each VM only has 2 CPU’s and 4GB RAM assigned to it and each VM will handle 500 users constantly.

I just said PHP/Apache combination for long pooling is not the best (see http://stackoverflow.com/questions/9730857/long-polling-with-php-on-apache and http://stackoverflow.com/questions/8093467/is-php-scalable-with-reverse-ajax-long-polling for example), i didn’t say he should not do it, but there are better solutions out there.

Also, RoundCube does not do long polling as far as i know (didn’t used for a while), it’s just uses regular intervals to pull the data which is another story.