NAME
Mail::Ezmlm::Archive - Object Methods for Ezmlm-Idx Archives
SYNOPSIS
use Mail::Ezmlm::Archive;
$archive = Mail::Ezmlm::Archive->new('/path/to/list/folder');
$message_count = $archive->getcount;
@available_months = $archive->getmonths;
$threads = $archive->getthreads('200304');
ABSTRACT
Mail::Ezmlm::Archive is designed to provide an object interface to the message archives maintained by the ezmlm-idx software. See the ezmlm web page for a complete description of that software: <http://www.ezmlm.org>.
This version is designed to work with ezmlm 0.53 and ezmlm-idx 0.40.
DESCRIPTION
Setting up a new Archive object
use Mail::Ezmlm::Archive;
$archive = Mail::Ezmlm::Archive->new('/path/to/list/folder');
Changing which list the Archive object points at
$archive->setlist('/full/path/to/other/list');
Getting count of archived messages
$message_count = $archive->getcount;
Actually the getcount methods reads message count from DIR/num file, so we'd better consider the result as count of distributed messages instead of archived.
Getting a list of months
@available_months = $archive->getmonths;
This returns an array of strings in the 'YYYYMM' format, such as '200304', which represent months for which we have archived messages.
Getting a list of threads in a given month
$threads = $archive->getthreads('200304');
This method returns a reference to an array, whose elements are hashes with these keys:
- subject
-
The subject of the thread, as archived in DIR/archived/threads/$month
- count
-
Count of messages in the thread
- offset
-
Id of first message in the thread
- id
-
Thread Id.
- date
-
The date of last message in the thread, as archived in DIR/archived/threads/$month
Getting list of messages in a given thread
$messages = $archive->getthread('nknmgklhcgijmbonmbkk');
This method returns a reference to a hash, which has two keys: 'subject' and 'messages'. The former contains the subject of the first message in the thread. The latter is a reference to an array, whose elements are hashes with these keys:
- id
-
Message Id for retrieving.
- month
-
Month of the message, in 'YYYYMM' format
-
Author Id
-
Full value of the 'From:' line
Retrieving a message
$message = $archive->getmessage('52');
This method returns a reference to a hash with two keys: text and month. The first contains the full raw message, and the message contains the month in YYYYMM format. It returns undef if the message doesn't exist.
CACHING
All opened files are cached by default, so that we do not need to overload the filesystem for doing normal listing and browsing operations. However, caching can be disabled to reduce memory usage:
$archive->nocache;
Then, to enable it again:
$archive->cache;
BUGS AND LIMITATIONS
No methods for author-based browsing.
Not enough object oriented, maybe? :-)
AVAILABILITY
You can download the latest version from CPAN ( http://search.cpan.org ). You are very welcome to write mail to the author (aar@cpan.org) with your comments, suggestions, bug reports and complaints.
SEE ALSO
Mail::Ezmlm: object methods to manage Ezmlm lists by Guy Antony Halse
COPYRIGHT
Copyright (C) Alessandro Ranellucci. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Alessandro Ranellucci <aar@cpan.org>
5 POD Errors
The following errors were encountered while parsing the POD:
- Around line 234:
'=item' outside of any '=over'
- Around line 254:
You forgot a '=back' before '=head2'
- Around line 262:
'=item' outside of any '=over'
- Around line 278:
You forgot a '=back' before '=head2'
- Around line 310:
You forgot a '=back' before '=head1'