Email::Folder::Reader - reads raw RFC822 mails from a box


Email-Folder documentation Contained in the Email-Folder distribution.

Index


Code Index:

NAME

Top

Email::Folder::Reader - reads raw RFC822 mails from a box

SYNOPSIS

Top

 use Email::Folder::Reader;
 my $box = Email::Folder::Reader->new('somebox');
 print $box->messages;

or, as an iterator

 use Email::Folder::Reader;
 my $box = Email::Folder::Reader->new('somebox');
 while ( my $mail = $box->next_message ) {
     print $mail;
 }

METHODS

Top

->new($filename, %options)

your standard class-method constructor

->next_message

returns the next message from the box, or false if there are no more

->messages

Returns all the messages in a box

AUTHOR

Top

Simon Wistow <simon@thegestalt.org>

COPYING

Top

Copyright 2003, Simon Wistow

Distributed under the same terms as Perl itself.

This software is under no warranty and will probably ruin your life, kill your friends, burn your house and bring about the apocolapyse.

SEE ALSO

Top

Email::LocalDelivery, Email::Folder


Email-Folder documentation Contained in the Email-Folder distribution.
package Email::Folder::Reader;
use strict;
use Carp;

sub new {
    my $class = shift;
    my $file  = shift || croak "You must pass a filename";
    bless { eval { $class->defaults },
            @_,
            _file => $file }, $class;
}

sub next_message {
}

sub messages {
    my $self = shift;

    my @messages;
    while (my $message = $self->next_message) {
        push @messages, $message;
    }
    return @messages;
}

1;

__END__