This module holds the shared methods between the different archive backends

Many of these methods have to do with massaging the message for viewing;



        my ($prev, $next) = $archive->get_neighbors();

this will tell you in the frame of reference of what message you're on, what the previous and next entry keys are.


see if an entry exists, returns 1 when its there, 0 if it aint



changes the archive's subject



changes the archive's message (yo)


        $archive -> set_archive_format($format);

changes the archive's format (yo)


        my $format = get_archive_subject($key); 

gets the subject of the given $key


        my $format = get_archive_format($key); 

gets the format of the given $key


        my $format = get_archive_message($key); 

gets the message of the given $key


        my ($begin, $stop) = $archive->create_index($start);

This 'll tell you what to print on each archive index. something like, 'start on the 40th message and end on the 50th'


returns the the key/id of the most recent archive message


returns the key/of the first archive message


        print $archive->create_index_nav($stopped_at);

creates a HTML table that looks like this:

            <<Prev                      Next >>

at the bottom of each archive index


        print $archive -> make_nav_table(-Id => $id, -List => $list_info{list}); 

this will make a HTML table that has the previous message, the index and the next message like this:

<< My Previous Message |Archive Index| My Next Message


(Private Method)

 my $msg = $self->_zap_sig_plaintext($msg); 

Given a string, $msg, returns the message without the opening or signature.

In a PlainText message, the opening is terminated using the (Dada Mail specific):


Which is:


The signature is begun with:


Which is:



(Private Method)

 $msg = $self->_zap_sig_html($msg);

Given a string $msg, returns a string that does not have the information located between the opening and signature comments.

The opening comments look like this:


The signature comments look like this:


These are both very Dada Mail-specific.



 my $summaries = $archive->make_search_summary($keyword, $search_results); 

Given a $keyword (string) and $search_results (array ref of archive keys/ids) will return a hashref of each line the keyword appears in.


Private Method

 ($new_message, $new_format) = $self->_faked_oldstyle_message($raw_msg);


Before version 2.9, Dada Mail did not save the complete email message, including the headers, in its archive. Beginning with 2.9, if you're using one of the SQL backends, it will - but for backwards compatability, the old style, message-only sort of method is still used.


 print $archives->message_blurb(-key  => $key,
                                -size => 256, 

Given a key/id of an archived message, returns a plaintext snippet of the archived message. -size will change who large the archive blurb is. NOTE: that this is the maximum size. If the message is smaller, the blurb will reflect that.


 print $archive->massage_msg_for_resending(-key => $entry),

given a -key - a key/id of an archived message, will return a copy of that archived message formatted to be resent. Basically, this means that the email message template has been stripped from the saved message.


 $entity = $self->_take_off_sigs($entity); 

($entity is a MIME::Entity object)

Returns a copy of the entity without the email message template apply (attempts to, anyways)


 $message = $self->massaged_msg_for_display(-key => $key);

returns a string, given a -key - an id/key of an archived message.

Can have many parameters passed to it:


Private Method

 $body = $self->_chomp_off_body($body); 

Give a string, will return the contents of the string that were found between HTML <body> tags. If no content was found, will return the entire string back, unchanged.


Private Method

 $body = $self->_add_a_body_if_needed($body)

Given a string, looks if the string is a complete HTML document, and, if it's not, wraps one around it.

Used for showing archived messages.


Private Methid

 $entity = $self->_get_body_entity($entity); 

Given an entity, attempts to find the main message - will default to HTML for multipart/alternative messages.


 $raw_msg = $self->_bs_raw_msg($subject, $message, $format); 

Tries to munge a complete MIME-compliant message, given a Subject, the body of a message and a format (text/plain, text/html)


 print $self->W3CDTF($key); 

Given a key/id of an archived message, which is created from the date the message was sent, returns a string in the W3CDTF format.

More information:

This is used for the Atom Feed.


 print $archive->atom_index();

returns a string representing the Atom Feed. More on Atom:

See Also:


 print $archive->rss_index();

returns a string representing the Rss Feed. More on Atom:



Sends a notice to updating services, telling them that they should check out the new Syndication Feeds. More information:


Private Method

Attempts to cleanse a key given to this object that contains weird things. Usually used to massage the id created from the Message-ID header of a email message.


Copyright (c) 1999 - 2016 Justin Simoni All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Dada Mail Project