# Mail::Box::MH::Labels - maintain MH message related labels - perldoc - [phpMan]

## NAME
    [Mail::Box::MH::Labels](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3AMH%3A%3ALabels/markdown) - maintain MH message related labels

## INHERITANCE
     [Mail::Box::MH::Labels](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3AMH%3A%3ALabels/markdown)
       is a [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

## SYNOPSIS
     my $labels = [Mail::Box::MH::Labels](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3AMH%3A%3ALabels/markdown)->new;
     $labels->read(...)
     $labels->write(...)

## DESCRIPTION
    MH type message folders use one dedicated file per folder-directory to list special tags to
    messages in that folder. By doing this, mail agents may avoid parsing all the messages, which is
    very resource consuming.

    Labels can be used to group messages, for instance to reflect which messages have been read or
    which look like spam. Some labels are predefined, but more can be added without limitation.

    Extends "DESCRIPTION" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown).

## METHODS
    Extends "METHODS" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown).

### Constructors
    Extends "Constructors" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown).

    [Mail::Box::MH::Labels](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3AMH%3A%3ALabels/markdown)->new(%options)
         -Option  --Defined in     --Default
          filename                   <required>
          log       [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)   'WARNINGS'
          trace     [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)   'WARNINGS'

        filename => FILENAME
          The FILENAME which is used in each directory to store the headers of all mails. The
          filename must be an absolute path.

        log => LEVEL
        trace => LEVEL

### The Label Table
    $obj->append($messages)
        Append the label information about the specified $messages to the end of the label file. The
        information will not be merged with the information already present in the label file.

    $obj->filename()
        Returns the name of the index file.

    $obj->get($msgnr)
        Look if there is label info for message $msgnr.

    $obj->print($fh, $messages)
        Print the labels of the specified messages to the opened file.

    $obj->read()
        Read all label information from file.

    $obj->write($messages)
        Write the labels related to the specified messages to the label file.

### Error handling
    Extends "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown).

    $obj->AUTOLOAD()
        Inherited, see "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

    $obj->addReport($object)
        Inherited, see "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

    $obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )
    [Mail::Box::MH::Labels](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3AMH%3A%3ALabels/markdown)->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )
        Inherited, see "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

    $obj->errors()
        Inherited, see "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

    $obj->log( [$level, [$strings]] )
    [Mail::Box::MH::Labels](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3AMH%3A%3ALabels/markdown)->log( [$level, [$strings]] )
        Inherited, see "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

    $obj->logPriority($level)
    [Mail::Box::MH::Labels](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3AMH%3A%3ALabels/markdown)->logPriority($level)
        Inherited, see "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

    $obj->logSettings()
        Inherited, see "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

    $obj->notImplemented()
        Inherited, see "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

    $obj->report( [$level] )
        Inherited, see "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

    $obj->reportAll( [$level] )
        Inherited, see "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

    $obj->trace( [$level] )
        Inherited, see "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

    $obj->warnings()
        Inherited, see "Error handling" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

### Cleanup
    Extends "Cleanup" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown).

    $obj->DESTROY()
        Inherited, see "Cleanup" in [Mail::Reporter](https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AReporter/markdown)

## DIAGNOSTICS
    Error: Package $package does not implement $method.
        Fatal error: the specific package (or one of its superclasses) does not implement this
        method where it should. This message means that some other related classes do implement this
        method however the class at hand does not. Probably you should investigate this and probably
        inform the author of the package.

## SEE ALSO
    This module is part of Mail-Box distribution version 3.010, built on July 18, 2023. Website:
    <http://perl.overmeer.net/CPAN/>

## LICENSE
    Copyrights 2001-2023 by [Mark Overmeer]. For other contributors see ChangeLog.

    This program is free software; you can redistribute it and/or modify it under the same terms as
    Perl itself. See <http://dev.perl.org/licenses/>

