views:

754

answers:

1

I have this rails app that's running on our local intranet, with a thousand regular users. I am looking to integrate it with our email server(MS Exchange). Basically -

1) For each user, the app should fetch any new messages in their inbox from the mail-server, parse it, and file it in the database.

I could implement it with ruby/net-imap, but I am worried about performance. As I have mentioned there are a thousand users, each with a different email address. Polling the email server every x minutes wouldn for a thousand users could drastically reduce performance.

It looks like IMAP IDLE with ruby/net-imap could be an option, the mail server pushing a notification to my app whenever there's a new mail(IPhone/Outlook style). But it seems, for that i'll have to keep an imap connection open with the server for that. So if there are 100 users logged in at a time, that would mean 100 connections to mail-server. Will that drastically slow the app?

Or does anyone know of any other options (Btw, I don't have control over the mail-server)

We are using MRI, but could easily switch to jruby too.

+1  A: 

This might help... I know it is for gmail or not exactly what you're looking for, but you might be able to adapt it to your problem.

There are also some libraries to handle imap with ruby such as Chilkat Ruby IMAP Library 2.1, but I haven't tried any yet.

marcgg