Perl Mail::Box thread manager disorder

August 11, 2008

Ok, so the problem isn’t due to crappy code from my side but to a malformed header References field in one of the messages in that particular thread. To check I actually just removed the offensive reference, 2/3 of a line and bam, everything is threaded and in the right order and all are there. Hey. So easy.

Of course it’s not *correct.* It’s a messed up header but modifying the input to get my script to work as I want is just not right. And this is just one post that I noticed, I’ve got a huge heap of mboxes to process as well, what if there are others in there? Don’t they deserve to be well-threaded as well?

I’ve tried to think up a few dirty workarounds to bypass the problem but really, at the heart of this is the first threading call I make, $threads->sortedAll (or ->all, all the same) so I don’t have so much space and I can imagine how any fix could create just as many problems as it solves.

So I’ve decided to try it the “Let’s use a sledge hammer to knock a pin” way. I’m going to implement jwz’s threading algorithm and I think Step 1-B-2 and 1-C will take care of that particular issue. Step 4 should deal with some other problem I noticed today with the way dummies are currently handled in my side of the code — easy to work around, that one, but if I can knock 2 pins with one big fat huge sledge hammer, I’m gonna try that first 🙂

[EDIT: Of course as soon as I wrote this I realised there was already another Perl module that implements the algo, so all the sledge manoeuvring fun will probably not occur tomorrow as expected 😦 Ah well, if I can solve the problem and get on with it…]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: