3

I was using basecamp, and for clients to reply to a message and automatically replies to it in basecamp is a pretty nice feature.

I was wondering how it's done, anybody have any ideas?

I am a PHP CodeIgniter developer, would be helpful if somebody gave me some pointers to do some research into this..

Thank you !

tpae
  • 6,286
  • 2
  • 37
  • 64

2 Answers2

2

I started using SendGrid to handle parsing incoming e-mails. It works very nicely.

tpae
  • 6,286
  • 2
  • 37
  • 64
2

Creating this kind of a functionality is quite daunting, but let's give it a try:

  • You should have some sort of identification for each e-mail send, so you know to which message/topic/object it belongs. I believe Basecamp is using a special return-address (hash@basecampnow.com) for each message.
  • Every time a new message is delivered to the object's inbox, read it contents and match all data above the ====== reply above this line =====. Check the sender's e-mail address, verify if the user is allowed to post to this object, write to the object and delete the message. You could check if you mail server has some kind of hook support, that fires every time a new messages comes in. Alternatively, you could run this as a cron-job every few minutes (but this is not very efficient, as you may imagine).

Personally, I've been wanting to make a Node.JS implementation of the incoming mail server, but I haven't come around to it yet (but check out this GitHub project for some inspiration.)

joelcox
  • 562
  • 9
  • 19
  • Does this mean I would have to have control of the mail server, in order to retrieve the hash? – tpae Jan 11 '11 at 00:40
  • Nope, you could connect to an inbox using PHP's imap_open() (see http://www.php.net/manual/en/book.imap.php). – joelcox Jan 14 '11 at 08:16
  • 4
    SendGrid has a feature where it accepts incoming mail for you and POSTs the contents to a URL of your choice. This means you could treat incoming emails an API which simplifies things. [http://wiki.sendgrid.com/doku.php?id=parse_api](http://wiki.sendgrid.com/doku.php?id=parse_api) – ohadpr Apr 11 '11 at 10:40