Jump to content

Need help for script to download emails from IMAP server into local database


paritycheck

Recommended Posts

Hi guys, I'm working on a project that uses roundcube (from www.roundcube.net) and we've been tweaking it so now it reads emails from a local database. The thing is that we aim to use the interface of roundcube to read from a database as though it was an imap server. The thing is that we need to build a script that would download emails from the imap server and insert the emails into teh database on a periodic basis.

 

The idea I have is that we would have a script that would do the downloading on a periodic basis and at the same time on the application end we would set up the check recent function of the roundcube to check for emails that have been downloaded and marked as recent to be displayed in the interface. The thing is that we have built the code to download emails and it works quite well for single or multiple emails of small sizes - however the issue is that when it comes to having emails that are quite large and have huge attachments - we're also downloading the attachments btw the script dies midway must be due to losing connection or timeout. Considering the fact that we expect literally 100s of emails to come in every hour we would need to build the script so that it downloads without dying and making sure that we don't lose any emails. The idea is to download and delete emails from our imap server so our application functions something like a pop3.

 

How do we do this part I mean what kind of logic should we use to ensure that connections do not die or even if they do die there should be a way to resume from where we lost connection ???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.