GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MAIL::FOLDER::EMAUL (3)

.ds Aq ’

NAME

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

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

CONTENTS

SYNOPSIS

use Mail::Folder::Emaul;

DESCRIPTION

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

The folder structure of <B>EmaulB> is styled after <B>mhB>. 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.

Folder locking is accomplished through the use of a .lock file in the folder directory.

If a Timeout option is specified when the object is created, that value will be used to determine the timeout for attempting to aquire a folder lock. The default is 10 seconds.

METHODS

    open($folder_name)

Populates the Mail::Folder object with information about the folder.
o Call the superclass open method.
o Make sure it is a valid mbox folder.
o Check to see it it is readonly
o Lock the folder if it is not readonly. (This is dubious)
o For every message file in the $folder_name directory, add the message_number to the list of messages in the object.
o Load the contents of $folder_dir/.current_msg into $self->{Current}.
o Set current_message.
o Load message labels.
o Unlock the folder if it is not readonly.

    sync

Flushes any pending changes out to the original folder.
o Call the superclass sync method.
o Return -1 if the folder is readonly.
o Return -1 if the folder cannot be locked.
o Scan the folder directory for message files that were not present the last time the folder was either opened or synced and absorb them.
o For every pending delete, unlink that file in the folder directory
o Clear out the ’pending delete’ list.
o Update the .current_msg file and the .msg_labels file if the NotMUA option is not set.
o Return the number of new messages found.

    pack

Calls the superclass pack method.

Return 0 if the folder is readonly.

Return 0 if the folder cannot be locked.

Renames the message files in the folder so that there are no gaps in the numbering sequence. It will tweak current_message accordingly.

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

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 <B>Mail::InternetB> object reference and returns the reference.

It will coerce the From_ field into a Mail-From field, add the ’seen’ label to the message, remove the Content-Length field if present, and cache the header.

Returns undef on failure.

    get_message_file($msg_number)

Calls the superclass get_message_file method.

Retrieves the given mail message file and returns the name of the file.

Returns undef on failure.

    get_header($msg_number)

Calls the superclass get_header method.

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.

The Content-Length field is deleted from the header object it returns.

    append_message($mref)

Calls the superclass append_message method.

Returns 0 if it cannot lock the folder.

Appends the contents of the mail message contained $mref to the the folder.

It also caches the header.

Please note that, contrary to other documentation for <B>Mail::FolderB>, 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, CW$mref)

Calls the superclass update_message method.

It returns 0 if it cannot lock the folder.

Replaces the message pointed to by $msg_number with the contents of the Mail::Internet object reference $mref.

Please note that, contrary to other documentation for <B>Mail::FolderB>, the Emaul update_message method actually updates the real folder, rather than queueing it up for a subsequent sync. This will be fixed soon.

    is_valid_folder_format($foldername)

Returns 0 if the folder is not a directory or looks like a maildir folder. The current logic allows it to handle MH directories, but watch out; you should probably set the NotMUA option so the interface doesn’t create it’s own little folder droppings like .msg_labels and such.

    create($foldername)

Returns 0 if the folder already exists.

Creates a new folder named $foldername with mode 0700 and then returns 1.

AUTHOR

Kevin Johnson <kjj@pobox.com>

COPYRIGHT

Copyright (c) 1996-1998 Kevin Johnson <kjj@pobox.com>.

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

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MAIL::FOLDER::EMAUL (3) 1998-04-05

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.