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.

Please note that pack acts on the real folder.

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->{Headers} 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 retrieved immediately by 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->{Headers}{$msg_number} and returns the object reference

If the header for the given mail message has already been retrieved in a prior call to get_header, then the cached entry 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.

    Please note that, contrary to the documentation for Mail::Folder, actually updates the real folder, rather than queueing it up for a subsequent sync. The dup and refile methods are also affected. This will be fixed soon.

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.

    Please note that, contrary to the documentation for Mail::Folder, actually updates the real folder, rather than queueing it up for a subsequent sync. This will be fixed soon.

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 52:

'=item' outside of any '=over'

Around line 85:

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

Around line 99:

'=item' outside of any '=over'

Around line 150:

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

Around line 266:

'=item' outside of any '=over'

Around line 299:

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

Around line 301:

'=item' outside of any '=over'

Around line 359:

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