1
votes

I'm currently trying to design a PHP webapp that allows users to send emails to other users. The recipient can then reply to the email and the message will be updated in the webapp.

Now to keep track of each individual user message, I would like to add a custom header (ie. conversation_id) in the email. When the recipient replies to the email in their email client, will the custom mail header (ie. conversation_id) be preserved?

There will be cron job that executes every minute that opens a POP3 stream to the web server to retrieve new emails (replies that the user may have sent with their mail client) to update my DB.

I'm not sure if this is a good way for designing such an app. Any suggestions?

EDIT: Also, I'm sure wondering how I can strip out the quoted messages in the reply?

2

2 Answers

4
votes

You can't rely on mail headers being preserved - it is pretty much up to the individual mail client to decide what to include.

I would generally put the conversation ID within [] brackets in the subject which makes it really easy to parse out with a regular expression.

0
votes

Each message already contains the Message-ID field which is used by the mail clients to create the content of the In-Reply-To field.

Wouldn't the usual way after the standards be to rely on the user's mail client setting the in-reply-to field correctly? As far as I know, all email client use this correctly. (even though according to this thread Outlook may have an occasional bug?)

So I think, emails already feature this and you don't have to worry about creating a custom mail header entry and unpredictably behaving mail clients.

EDIT: I rembember a friend telling me his frustration from work about how many people remove or even edit these Tags in [ ] brackets from the suject field. Also, it seems to be a very dirty work-around and all of your software would need to handle it without opposing it to the users ability to change it => practically impossible.

EDIT: I think it will be hard to reliably strip out the quoted message in the reply, because each mail client handles it differently.