gpldoc

Sympa documentation licensed under GPL

NAME

Sympa::Spool - Base class of spool classes

SYNOPSIS

package Sympa::Spool::FOO;

use base qw(Sympa::Spool);

sub _directories {
    return {
        directory     => '/path/to/spool',
        bad_directory => '/path/to/spool/bad',
    };
}
use constant _generator      => 'Sympa::Message';
use constant _marshal_format => '%s@%s.%ld.%ld,%d';
use constant _marshal_keys   => [qw(localpart domainpart date PID RAND)];
use constant _marshal_regexp =>
    qr{\A([^\s\@]+)(?:\@([\w\.\-]+))?\.(\d+)\.(\w+)(?:,.*)?\z};

1;

DESCRIPTION

This module is the base class for spool subclasses of Sympa.

Public methods

Properties

Instance of Sympa::Spool may have following properties.

Low level functions

Methods subclass should implement

Marshaling and unmarshaling metadata

Spool class gives generator class the metadata to instantiate it. On spool based on filesystem, it is typically encoded into file names. For example a file name in incoming spool (Sympa::Spool::Incoming)

listname-owner@domain.name.143599229.12345

encodes the metadata

localpart  => 'listname-owner',
listname   => 'listname',
listtype   => 'return_path',
domainpart => 'domain.name',
date       => 143599229,

Metadata always includes information of context: List, Robot, Site (or Family). For example:

- Message in incoming spool bound for listname@domain.name:

context    => Sympa::List <listname@domain.name>,

- Command message in incoming spool bound for sympa@domain.name:

context    => 'domain.name',

- Message sent from Sympa to super-listmaster(s):

context    => '*'

Context is determined when the generator class is instantiated, and generally never changed through lifetime of instance. Thus, constructor of generator class should take context object as an argument.

localpart is encoded in a bit complex manner.

CONFIGURATION PARAMETERS

Following site configuration parameters in sympa.conf will be referred.

SEE ALSO

Sympa::Message, especially Serialization.

HISTORY

Sympa::Spool appeared on Sympa 6.2. It as the base class appeared on Sympa 6.2.6.

build_glob_pattern(), size(), _glob_pattern() and _store_key() were introduced on Sympa 6.2.8. _filter_pre() was introduced on Sympa 6.2.10. marshal(), unmarshal() and no_filter option of next() were introduced on Sympa 6.2.22. _no_glob_pattern() was introduced and _glob_pattern() was deprecated on Sympa 6.2.36.


The content of this page is automatically generated from the source distribution of Sympa. For details about this document see original source file.

Theme originally designed by orderedlist