Henry
Henry

Reputation: 32905

How to "Reply to this email to comment" like Facebook?

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!

Upvotes: 3

Views: 671

Answers (4)

andrewc
andrewc

Reputation: 31

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.

Upvotes: 0

jarofclay
jarofclay

Reputation: 680

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

Use plus addressing ([email protected]) as the REPLY-TO address in the mail message. With CFIMAP you can retrieve the messages and parse the TO.

Wildcard domain ([email protected]) is also an option, but if your email server supports plus addressing I would go that route.

Upvotes: 8

chryss
chryss

Reputation: 7519

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.

Upvotes: 2

kolosy
kolosy

Reputation: 3099

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.

Upvotes: 0

Related Questions