Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

In the same way gmail can generate ads based on email content, I am looking for a way to develop a system which can:

  • Allow users to connect their email address to our site
  • It then would continously monitor all incomming emails
  • From the incomming emails there would be a critera(e.g. a certain address or subject) if any of the emails matched the critea it would would be saved to a database
  • Then once a new email had been found the users would receive an email notification will tells them to log back into the site to see it.

My questions are:

  1. Would this be possible?
  2. What would be a good language to use(generally I like php, python and java)
  3. Are there any frameworks which would help do this?
  4. How would I connect the users email account to allow access to their emails(do I need a mail server?)
  5. Any advice?

Thank you! If you need more information please let me know.

share|improve this question
2  
Wait a second. you want my email password so you can see all my email, then when a "key email" comes in you will send me an email so I will know about it. Not interested. There will be huge trust issues you have to overcome. – mhoran_psprep Jun 16 '12 at 12:53
@mhoran_psprep the overall system serves a purpose that is not so intrusive, I just did not want to give too much away just yet. – Mr D Jun 16 '12 at 13:05

closed as not constructive by Walter, Jalayn, psr, Matthieu, Ryathal Aug 23 '12 at 17:21

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

1 Answer

up vote 1 down vote accepted
  1. Yes, but users will have to trust you with their e-mail password, you'll have to store these unhashed (you can encrypt them though, but then you'll have to figure out how to hide the key); and if you leak them, you will wish you were dead.
  2. Any general-purpose language that is suitable for web programming and can open socket connections (or, alternatively, provides IMAP and POP3 libraries) will do. Use whatever you are comfortable with.
  3. Not directly. If you are familiar with a framework that you know will help you get a decent-looking website up and running, I don't see why you wouldn't use it. Other than that, I think you are looking for libraries more than for frameworks.
  4. You don't need a mail server, since you're not sending any e-mail (SMTP) nor providing any mailbox (POP3/IMAP server). All you need to do is connect to the user's IMAP or POP3 server; you can implement the protocol yourself, or you can go look for suitable libraries.

Alternatively, you can ask users to set up a forwarding service to your own server, and read e-mail from there. This way, users won't have to give you their password, and they can add some filters themselves before e-mail reaches your server. You do need to run your own IMAP or POP3 server for this though, but from there, the procedure is pretty much the same as outlined above, only you pull e-mail from your own server instead of the user's.

Oh, and you want to make sure that your alert e-mail doesn't trigger another alert, e.g. if the user has set up 'hotdog' to trigger an alert, and you naively send a message saying "There are new matches for the keyword 'hotdog'", then that message would be picked up as a new match, and trigger another message, and then this would repeat until your server commits suicide or the user's account gets blocked.

share|improve this answer
He will need to be able to send email. He needs to alert the customer that they an email. They will also have to register a second email address so they know when a "key email" has arrived. Or they could send a text, or tweet. – mhoran_psprep Jun 16 '12 at 12:54
Thank you that solved many questions, you make a good point about the chances of an infinite loop at the end which I hadn't thought about. One more thing: In order for there to be a background process constantly checking incoming mail, would that be best done in ROR or python? @mhoran_psprep the send mail part would be done through out own email address. – Mr D Jun 16 '12 at 13:04
Just write a script that checks for new mail once, in whatever language suits you best, and run it every 5 minutes or so, in a cron job. – tdammers Jun 16 '12 at 14:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.