(apologies if this shows up twice; the Perl lists seem to *really* hate me, even when sending from legitimate places) On Wed, Sep 19, 2007 at 02:30:24 EDT, Simon Wistow scribbled these curious markings: > On Tue, Sep 18, 2007 at 07:40:04PM -0500, Karen Cravens said: > > So, uh, anyway. Where were we? Oh yeah. How 'bout that Email::Store? > > (Email::Archive?) > > There are a bunch of lessons that I learnt from working on Email::Store > (I wasn't the original author) that I wanted to correct with a putative > rewrite that I never got round to. > > 1) The package based design > > This was partly fallout of being based on Class::DBI but I diskliked > everything being based on Package variables so > > use Email::Store 'dbi:mysql:mailstore'; > Email::Store->setup; # Do this once > > Email::Store::Mail->store( $rfc822 ); > Email::Store::Mail->retrieve( $msgid ); > > > what I would have preferred was > > my $store = Email::Store->new(%opts); > my $mess = $store->message($id); > my $top = $mess->thread->top; > > which would have made > > $store2->add($mess); > > possible. > > 2) No pluggable backend > > Email::Store was tied closely to Class::DBI which was best of breed at > the time. It would have been nice if it could have pluggable backends so > that you could have used whatever storage engine you wanted - > Class::DBI, DBIx::Class, Data::ObjectDriver even IMAP or a maildir. > > To be fair, I'm not exactly sure how this would work - some sort of > declarative schema like Jifty::DBI maybe. > > 3) Always keep a pristine copy of the message around > > Err, that's pretty much it. It may mean that you bloat you index size > but I think it's worth it in the long run. It means you can install > plugins (if yours is going to be plugin based) or upgrade the system and > add new functionality that you knno is going to work and you never have to > reindex your dataset. > > 4) That said, convert everything to UTF-8 > > Apart from the pristine copy (which should be outputted in ASCII) try > and do everything in UTF8. It just makes things easier. > > 5) Watch your timezones. > > Another tricky problem that it's always best to be thinking of from the > start rather than trying to retrofit. > > 6) Think of conversations rather than emails > > It might be worth architecting it as a series of conversations rather > than being email specific. That way later you could add in UseNet for a > Deja News style affair (ok so UseNet is very much like email but there > are differences) and maybe even more exotic things like blog posts > (which let's face it, with comments, merely an email thread), IM > conversations or SMS.
All excellent points that I'm hoping can be addressed for Email::Archive. You've given me a great deal of food for thought, Simon. I especially appreciate the comments on breaking from CDBI's interface style. May I have your permission to (with full attribution, of course) reproduce this as part of an Email::Archive design document in the SVN repo? Best regards, Christopher Nehren