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.
METHODS
open($folder_name)
Populates the Mail::Folder
object with information about the folder.
Call the superclass
open
methodFor 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
Flushes any pending changes out to the original folder.
Call the superclass
sync
methodFor 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
open
ed orsync
ed.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)
If the particular header has never been retrieved then get_header
loads the header of the given mail message into a member of $self->{Messages}{$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)
Appends the contents of the mail message contained $message_ref
to the the folder.
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 other documentation for Mail::Folder, the Emaul append_message
method 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)
Replaces the message pointed to by $msg_number
with the contents of the Mail::Internet
object reference $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 other documentation for Mail::Folder, the Emaul update_message
method actually updates the real folder, rather than queueing it up for a subsequent sync. This will be fixed soon.
create($foldername)
Creates a new folder named $foldername
. Returns 0
if the folder already exists, otherwise returns of the folder creation was successful.
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.