logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Email::Thread - Use JWZ's mail threading algorithm with Email::Simple objects

Author

       Iain Truskett <spoon@cpan.org>

Contributor

       Ricardo Signes <rjbs@semiotic.systems>

Description

       Strictly speaking, this doesn't really need Email::Simple objects.  It just needs an object that responds
       to the same API. At the time of writing the list of classes with the Email::Simple API comprises just
       Email::Simple.

       Due to how it's implemented, its API is an exact clone of Mail::Thread.  Please see that module's
       documentation for API details. Just mentally substitute "Email::Thread" everywhere you see "Mail::Thread"
       and "Email::Thread::Container" where you see "Mail::Thread::Container".

Name

       Email::Thread - Use JWZ's mail threading algorithm with Email::Simple objects

Perl Version

       This module should work on any version of perl still receiving updates from the Perl 5 Porters.  This
       means it should work on any version of perl released in the last two to three years.  (That is, if the
       most recently released version is v5.40, then this module should work on both v5.40 and v5.38.)

       Although it may work on older versions of perl, no guarantee is made that the minimum required version
       will not be increased.  The version may be increased for any reason, and there is no promise that patches
       will be accepted to lower the minimum required perl.

See Also

       perl, Mail::Thread, Email::Simple

Synopsis

           use Email::Thread;
           my $threader = Email::Thread->new(@messages);

           $threader->thread;

           dump_em($_,0) for $threader->rootset;

           sub dump_em {
               my ($self, $level) = @_;
               debug (' \\-> ' x $level);
               if ($self->message) {
                   print $self->message->header("Subject") , "\n";
               } else {
                   print "[ Message $self not available ]\n";
               }
               dump_em($self->child, $level+1) if $self->child;
               dump_em($self->next, $level) if $self->next;
           }

Thanks

       Simon Cozens (SIMON) for encouraging me to release it, and for Email::Simple and Mail::Thread.

       Richard Clamp (RCLAMP) for the header patch.

Version

       version 0.713

See Also