The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mail::Message::Head::Subset - subset of header information of a message

CLASS INHERITANCE

 Mail::Message::Head::Subset realizes a Mail::Message::Head::Complete

 Mail::Message::Head::Subset
   is a Mail::Message::Head
   is a Mail::Reporter

SYNOPSIS

 my Mail::Message::Head::Subset $subset = ...;
 $subset->isa('Mail::Message::Head')  # true
 $subset->guessBodySize               # integer or undef
 $subset->isDelayed                   # true

DESCRIPTION

Some types of folders contain an index file which lists a few lines of information per messages. Especially when it is costly to read header lines, the index speeds-up access considerably. For instance, the subjects of all messages are often wanted, but waiting for a thousand messages of the folder to be read may imply a thousand network reads (IMAP) or file openings (MH)

When you access header fields which are not in the header subset, the whole header has to be parsed (which may consume considerable time, depending on the type of folder).

METHODS

Initiation

build FIELDS

See Mail::Message::Head::build()

new OPTIONS

(Class method)

 OPTION               DEFAULT
 field_type           'Mail::Message::Field::Fast'
 log                  'WARNINGS'
 message              undef
 modified             <false>
 trace                'WARNINGS'
field_type => CLASS

See Mail::Message::Head::new(field_type)

log => LEVEL

See Mail::Reporter::new(log)

message => MESSAGE

See Mail::Message::Head::new(message)

modified => BOOLEAN

See Mail::Message::Head::new(modified)

trace => LEVEL

See Mail::Reporter::new(trace)

The Header

clone [FIELDS]

See Mail::Message::Head::Complete::clone()

isDelayed

See Mail::Message::Head::isDelayed()

isEmpty

See Mail::Message::Head::isEmpty()

isModified

See Mail::Message::Head::isModified()

isMultipart

See Mail::Message::Head::isMultipart()

message [MESSAGE]

See Mail::Message::Head::message()

modified [BOOLEAN]

See Mail::Message::Head::modified()

Constructing a Header

add FIELD | LINE | (NAME,BODY[,ATTRS])

See Mail::Message::Head::Complete::add()

delete NAME

See Mail::Message::Head::Complete::delete()

removeField FIELD

See Mail::Message::Head::Complete::removeField()

reset NAME, FIELDS

See Mail::Message::Head::Complete::reset()

set FIELD | LINE | (NAME, BODY [,ATTRS])

See Mail::Message::Head::Complete::set()

Access to the Header

addResentGroup RESENT-GROUP|DATA

See Mail::Message::Head::Complete::addResentGroup()

count NAME

Count the number of fields with this NAME. If the NAME cannot be found, the full header get loaded. In case we find any NAME field, it is decided we know all of them, and loading is not needed.

get NAME [,INDEX]

See Mail::Message::Head::get()

grepNames [NAMES|ARRAY-OF-NAMES|REGEXS]

See Mail::Message::Head::Complete::grepNames()

guessBodySize

The body size is defined in the Content-Length field. However, this field may not be known. In that case, a guess is made based on the known Lines field. When also that field is not known yet, undef is returned.

guessTimeStamp

See Mail::Message::Head::Complete::guessTimeStamp()

knownNames

See Mail::Message::Head::knownNames()

names

See Mail::Message::Head::Complete::names()

nrLines

See Mail::Message::Head::Complete::nrLines()

See Mail::Message::Head::Complete::print()

printUndisclosed [FILEHANDLE]

See Mail::Message::Head::Complete::printUndisclosed()

resentGroups

See Mail::Message::Head::Complete::resentGroups()

size

See Mail::Message::Head::Complete::size()

string

See Mail::Message::Head::Complete::string()

timestamp

See Mail::Message::Head::Complete::timestamp()

Reading and Writing [internals]

addNoRealize FIELD

See Mail::Message::Head::addNoRealize()

addOrderedFields FIELDS

See Mail::Message::Head::addOrderedFields()

createFromLine

See Mail::Message::Head::Complete::createFromLine()

createMessageId

See Mail::Message::Head::Complete::createMessageId()

fileLocation

See Mail::Message::Head::fileLocation()

load

See Mail::Message::Head::load()

messagIdPrefix [STRING]

See Mail::Message::Head::Complete::messagIdPrefix()

moveLocation DISTANCE

See Mail::Message::Head::moveLocation()

orderedFields

See Mail::Message::Head::orderedFields()

read PARSER

See Mail::Message::Head::read()

setNoRealize FIELD

See Mail::Message::Head::setNoRealize()

Logging and Tracing

defaultTrace [LEVEL, [LEVEL]

See Mail::Reporter::defaultTrace()

errors

See Mail::Reporter::errors()

log [LEVEL [,STRINGS]]

See Mail::Reporter::log()

report [LEVEL]

See Mail::Reporter::report()

reportAll [LEVEL]

See Mail::Reporter::reportAll()

trace [LEVEL]

See Mail::Reporter::trace()

warnings

See Mail::Reporter::warnings()

Other Methods

AUTOLOAD

See Mail::Reporter::AUTOLOAD()

DESTROY

See Mail::Reporter::DESTROY()

inGlobalDestruction

See Mail::Reporter::inGlobalDestruction()

logPriority LEVEL

See Mail::Reporter::logPriority()

logSettings

See Mail::Reporter::logSettings()

notImplemented

See Mail::Reporter::notImplemented()

SEE ALSO

A good start to read is Mail::Box-Overview. More documentation and a mailinglist are available from the project's website at http://perl.overmeer.net/mailbox/.

AUTHOR

Written by Mark Overmeer (mark@overmeer.net) with the help of many. See the ChangeLog for details.

VERSION

This code is beta, version 2.040.

Copyright (c) 2001-2003 by the authors. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.