Page 1 of 1

email threading in gmail

Posted: Thu Jan 28, 2010 12:21 pm
by s.dot
Our team is using ActiveCollab software (integrated with Swift Mailer) for collaborations on projects.

Currently, a thread breaks up into a new thread after a reply is made from gmail. Our old project management software did not do this. I have analyzed subject lines and headers extensively but cannot find what makes the threads break up.

Does anyone know what makes gmail break up email threads?

I have also googled extensively and found some references to the in-reply-to and references email headers. We have tried setting these statically to no avail.

So far the only differences between the two project management softwares I can note are

* (obviously, the sender email address and host are different - duh)
* one sends text/plain, the other sends text/html (shouldn't be a difference, we've had threaded html convos before)

I can post more information (headers and subjects) if needed.

Re: email threading in gmail

Posted: Thu Jan 28, 2010 1:55 pm
by Weirdan
I can post more information (headers and subjects) if needed.
From what I know, threading is usually based on message-id + in-reply-to. Seeing actual headers would be helpful I guess (please be sure to mark where conversation broke).

Re: email threading in gmail

Posted: Fri Jan 29, 2010 11:52 am
by s.dot
Well, I was going to post the headers but I'm having a hell of a time getting them. I can get the headers from the inbox of the gmail account, no problem.

It's the incoming mail I'm having a problem getting to before the software parses it.

The ActiveCollab software's email importer must be doing something funky with gmail replies because this is precisely when the threading breaks.

1) Ticket created (or reply made) in web site (using AC software)
2) Reply from GMAIL account
-> if another reply from gmail account is made directly after initial gmail reply, threading remains intact
-> if a reply is made from the web site software, threading breaks up

I have done some tests and reproduced the situation using a reply from my dedicated server and the thread remains intact. This leads me to believe that my server and gmail are sending way different email headers.. OR.. the software is incorrectly parsing the headers from gmail.

Either way I think the only way to know is to fully examine the incoming email headers and how they are being parsed.

(kind of talking myself through this one)

Re: email threading in gmail

Posted: Sat Jan 30, 2010 9:41 pm
by josh
Always seemed to me like the subject/body played a big role. Example if I hit reply to a message and backspace the subject, it breaks the thread (I exploit that to find old emails, and write new messages to that person). But that may be just gmail detecting that and changing the message id header?

It does detect which parts of the body are "quoted" and collapses them. So they definitely have the means to tell just from the body alone (although it would make more sense that they use the message id with the volume of mail that they must deal with)

Re: email threading in gmail

Posted: Sat Jan 30, 2010 9:46 pm
by stuartshields
I agree with josh on this one, also I think it has something to do with re: within a reply. If you need another real world example you'll notice Thunderbird 3.0 has this same feature (although you do need to make it active).

Re: email threading in gmail

Posted: Tue Feb 16, 2010 12:54 pm
by s.dot
It did have to do with the in-reply-to header. I had to capture the message id gmail was sending, and then when that particular ticket was replied to from within the software i had to look up that message id and send the in-reply-to header with the value being that message id

made it work :)

Re: email threading in gmail

Posted: Tue Feb 16, 2010 6:37 pm
by josh
I have a contact form on my website. It sends emails with the regular mail() function, but with the same subject everytime.

Gmail annoyingly groups them by their subject even tho they are all "freshly composed". Just thought I'd share :D

Re: email threading in gmail

Posted: Tue Feb 16, 2010 6:40 pm
by Eran
you can add the date + time to the subject to avoid that

Re: email threading in gmail

Posted: Tue Feb 16, 2010 9:03 pm
by josh
Thanks for the tip. A salt of the user's email address would be even better!