[Imap-protocol] [SORT EXTENSION] Base-Subject extraction

Bron Gondwana brong at fastmail.fm
Tue Jun 7 01:36:18 PDT 2011

On Tue, 07 Jun 2011 02:26:53 -0600
Michael M Slusarz <slusarz at curecanti.org> wrote:

> In the interest of keeping everyone here out of jail and/or not on the

> losing side of a crushing judgment, let me go ahead and present to you

> a test suite that I freely release into the public domain:


> These subjects:


> 'Re: Test'

> 're: Test'

> 'Fwd: Test'

> 'fwd: Test'

> 'Fwd: Re: Test'

> 'Fwd: Re: Test (fwd)'


> Should all resolve into the string:


> 'Test'


> And this subject:


> "Re: re:re: fwd:[fwd: \t Test] (fwd) (fwd)(fwd) "


> Should resolve into the string:


> "\t Test"

Heh - thanks. I figured as much, and was just about to ask if that
was OK :)

> (I adapted/ripped off Timo's LGPL code for the actual subject parsing

> code itself, so I guess you probably shouldn't look at that if you are

> looking to keep your code ASL2-compatible).

On the other hand, the Cyrus code for same is BSD, so you can probably
rip that out just fine - but I warn you, it's nasty horrid C ;)

Bron ( no, seriously - it's not just C - it's nasty C )

#if 0 /* do nested blobs - wait for decision on this */

More information about the Imap-protocol mailing list