3

A forum-like app I'm working on will send an email notification to the thread starter when a new replied is received. It would be nice if the owner can just reply the email to add a new reply to the thread.

How can I implement the feature, i.e. "reply to this email to comment" like Facebook?

Option A: scan the subject line/body? I don't like it 'cause what if the user modified the subject line by mistake?

Option B: use a unique reply-to e-mail address that links to the thread ID. Is this a common function for mail server? like set up a *@addComment.domain.com ? Or does the app server needs to setup a new email account before sending the email with reply-to?

Any other options?

Thanks!

Henry
  • 32,689
  • 19
  • 120
  • 221

4 Answers4

8

Using strings in the subject and body can be easily erased by a user of the system.

Use plus addressing (reply+UNIQUEIDENTIFIER@yourapplication.com) as the REPLY-TO address in the mail message. With CFIMAP you can retrieve the messages and parse the TO.

Wildcard domain (replyto@UNIQUEIDENTIFIER.yourapplication.com) is also an option, but if your email server supports plus addressing I would go that route.

jarofclay
  • 680
  • 4
  • 12
  • cool! never heard of "plus addressing". Most mail server supports it? – Henry Jul 21 '10 at 23:05
  • 1
    If your mail server doesn't support +addresses, you can use a catch-all box in a similar manner. However, this will end up with a bunch more spam, and that server IP/address should not be used for sending, as some ISPs don't treat servers with catchall addresses properly (or at least, they didn't). – Ben Doom Jul 22 '10 at 00:25
2

You could stuff the thread ID or the parent message ID (the message that is being replied to) in the Msgessage-ID: header of the email, or a custom email header, and put the processing after accepting the message.

However, using custom Reply-To: addresses is quite common.

chryss
  • 7,459
  • 37
  • 46
0

an option is to embed an identifier in both the subject and the body of the original email. something small, like bit.ly's 6-8 character code. that way, they're less likely to mess it up, and you have the safety of the email body, which most people leave in anyway.

kolosy
  • 3,029
  • 3
  • 29
  • 48
0

Using a custom email header is not advised as there is no guarantee that any server along the route would not strip it off (or simply fail to pass it on). A friend who worked at a huge email data center for AT&T said the techs there warned him off that idea.

This may also be true of the Message-ID: -- don't know.

andrewc
  • 21
  • 1