The current comment posting mechanism only supports comment threading based on the message headers. Specifically, Message-Id, In-Reply-To and References are used to maintain this message thread context. This works fine for mail clients/servers that support this protocol, but not all do.

I would like to propose the addition of a tag embedded within the body of the message that would be used to maintain thread context. It could be a url_encoded set of parameters such as:

1. If the message is a node, it would be in the format:

[[mailhandler:nid=123]]

2. If the message is a comment on a node, it would be in the format:

[[mailhandler:nid=123&cid=333]]

Replies sent to the server would search for these strings and if found, set comment properties accordingly before creating a comment. All normal user_access calls, throttling and security checks would still apply. These strings could be placed at the bottom of each message.

An alternative would be to use the mailing list protocol of encoding a unique (typically numeric) id into the subject line surrounded by parenthesis or braces. The only drawbacks with this are that the random id would need to be stored in a database and matched up later, and subject line space would be taken up by the id. The main benefit is that the body text wouldn't be altered, and the possibility of the id being altered, "trimmed" or line-broken out of shape would be greatly reduced. Additionally, there would be slightly added security in that users couldn't alter the message id to post to other nodes/comments (though, if normal security measures were enforced, this wouldn't be a problem either way).

Ideas?

Comments

moshe weitzman’s picture

Is this hypothetical or do we know that many mobile phones ignore these headers? I prefer not to add code for a few broken mail clients. I think failure to use those headers is a serious bug in a mail client.

javanaut’s picture

Again, I find the moblog module being the red-headed email step child ;)

I can say from personally testing it out on my phone that the headers are sometimes discarded. I suspect that it is because it is converted into some mobile message format (SMS?) at the carrier's server. I'm currently trying to figure out how/when messages are perceived as "Multimedia" messages, which seem to keep their headers and which ones are considered "Text" messages, which lose just about everything except for the body. Not that mailhandler should be concerned with this, but if it does turn out to be common for carriers to discard headers, then I don't see an alternative to one of these proposals..well, for me at least.

zostay’s picture

Why not just do it the way that many email integration systems do it, like RT and Microsoft CRM. Just look for an identifier in the Subject, if a given mailbox is configured for such.

For example, you could post to a specific node via:

Subject: [MySite #1234] My New Node

Or if you had customized format for this, you could do:

Subject: My New Node MySite|1234

It should be pretty easy to create a custom format for this sort of thing.

If you want to add comments to the mix:

Subject: My New Comment MySite|1234-1234

ilo’s picture

Status: Active » Closed (won't fix)

I'm going to close this, nice discussion to be considered. But I'll keep in mind the idea of using the subject identifier at some point.

Thank you all!