Receiving and processing letters in the application

I am currently building an open source issue management application for my company (will open it when it finishes) and we have a feature request that I am not sure how to address.

They asked if it was possible to send emails to, say, issue@mydomain.com , which then parse the body and create a problem in the application.

I'm really not sure where to start. Is there a way around this outside of setting up your own SMTP servers and writing a complete email processing application to run on the mail server?

FYI, we are now using Google Apps for our email servers.

+3


source to share


1 answer


The best way to deal with this is to send emails to a specific mailbox. Then use the Ruby IMAP library:

http://ruby-doc.org/stdlib-1.9.3/libdoc/net/imap/rdoc/Net/IMAP.html



You can read messages, get an item, see if it matches a pattern, or even search for text patterns in the body. In the old days, we often wrote email handlers that would automatically run when a message arrived. But nowadays I see a lot more applications that run cron, look for new messages, parse them, and then do something with them as your application should do. Email is so user-friendly, I definitely understand why your company wants to research its use.

My suggestion assumes, of course, that you can funnel @ support into an IMAP-compliant account. Gmail is compatible, you can test it.

+2


source







All Articles