NAME

Mail::Folder::Emaul - An Emaul folder interface for Mail::Folder.

WARNING: This code is in alpha release. Expect the interface to change.

SYNOPSYS

use Mail::Folder::Emaul;

DESCRIPTION

This module provides an interface to the emaul folder mechanism. It is currently intended to be used as an example of hooking a folder interface into Mail::Folder.

Emaul's folder structure is styled after mh. It uses directories for folders and numerically-named files for the individual mail messages. The current message for a particular folder is stored in a file .current_msg in the folder directory.

Many of mh's more useful features like sequences aren't implemented, but what the hey...

METHODS

open($folder_name)

  • Call the superclass open method

  • For every message file in the $folder_name directory, add the message_number to the object's list of messages.

  • Load the contents of $folder_dir/.current_msg into $self->{Current}.

close()

Does nothing except call the close method of the superclass.

sync()

  • Call the superclass sync method

  • For every pending delete, unlink that file in the folder directory

  • Clear out the 'pending delete' list.

  • Scan the folder directory for message files that weren't present the last time the folder was either opened or synced.

  • Add each new file found to the list of messages being slung around in the Mail::Folder object.

  • Update the contents of the folder's .current_msg file.

  • Return the number of new messages found.

pack()

Calls the superclass pack method.

Renames the message files in the folder so that there are no gaps in the numbering sequence.

Old deleted message files (ones that start with ,) are also renamed as necessary.

It also tweaks current_message accordingly.

It will abandon the operation and return 0 if a rename fails, otherwise it returns 1.

get_message($msg_number)

Calls the superclass get_message method.

Retrieves the given mail message file into a Mail::Internet object reference and returns the reference.

get_header($msg_number)

The $self->{Messages} associative array in a Mail::Folder object is used to hold Mail::Internet object references containing the headers of the mail messages in the folder. For performance reasons, the header references aren't populated immediately in the open method, they are retrieved by get_header as needed.

If the particular header has never been retrieved then get_header loads the header of the given mail message into $self->{Messages}{$msg_number} and returns the object reference

If the header for the given mail messages has already been retrieved in a prior call to get_header, then it is returned.

It also calls the superclass get_header method.

append_message($message_ref)

  • Call the superclass append_message method

  • Retrieve the highest message number in the folder

  • increment it

  • Create a new mail message file in the folder with the contents of $message_ref.

update_message($msg_number, $message_ref)

  • Call the superclass update_message method.

  • Replaces the contents of the given mail file with the contents of $message_ref.

AUTHOR

Kevin Johnson <kjj@primenet.com>

COPYRIGHT

Copyright (c) 1996 Kevin Johnson <kjj@primenet.com>.

All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

8 POD Errors

The following errors were encountered while parsing the POD:

Around line 50:

'=item' outside of any '=over'

Around line 84:

You forgot a '=back' before '=head2'

Around line 98:

'=item' outside of any '=over'

Around line 147:

You forgot a '=back' before '=head2'

Around line 260:

'=item' outside of any '=over'

Around line 287:

You forgot a '=back' before '=head2'

Around line 289:

'=item' outside of any '=over'

Around line 348:

You forgot a '=back' before '=head1'