Handle many inbound messages in Rails: MySQL vs Imap / Pop3 versus another solution

in an app I'm working on, users can forward their email accounts to an address from our system (something like email@userid.amazingstuff.com ). It doesn't matter why they should do it here, but I need professional advice on the best approach to this.

The basic idea is that our mail server receives incoming (forwarded) emails, and the mailpoller (which runs in a loop) downloads emails from the mail server, processes them (receives text, assigns them to an account, etc.), and saves them using the ActiveRecord "IncomingMail" model.

But I'm not sure how to connect to the server? Through Imap / Pop? Or should I store mail on the mail server using MySQL and connect directly to the database? Or is it a bad idea?

I need a fast, reliable and scalable system.

Thank you for your advice!


Update
I think DB like MySQL is always faster than parsing the filesystem. It should also be highly scalable. I am not thinking about using DBMail ( http://www.dbmail.org/ ). Anyone have any experience with this solution? Or any further hints / comments?

Thanks!

0


a source to share


1 answer


Pop should work, look here for sample code: http://www.ruby-doc.org/stdlib/libdoc/net/pop/rdoc/classes/Net/POP3.html



0


a source







All Articles