SYNOPSIS

    package Foo;
    use base Mail::Milter::Object;

sub connect_callback { my $this = shift; my $ctx = shift; my @connect_args = @_; ... }

... my $milter = new Foo;

DESCRIPTION

Normally, milters passed to \*(C`Sendmail::Milter\*(C' consist of nondescript hash references. \*(C`Mail::Milter::Object\*(C' transforms these callback hashes into fully qualified objects that are easier to maintain and understand. In conjunction with \*(C`Mail::Milter::Chain\*(C', this also allows for a more modular approach to milter implementation, by allowing each milter to be a small, granular object that can exist independently of other milters.

Each object inheriting from this class has access to the hash reference making up the object itself. Two caveats must be noted when accessing this hashref:

* Key names used for private data should be prefixed by an underscore (_) in order to prevent accidental recognition as a callback name.

* Since a milter object can be reused many times throughout its existence, and perhaps reentrantly if threads are in use, the hashref should contain only global configuration data for this object rather than per-message data. Data stored per message or connection should be stashed in the milter context object by calling \*(C`getpriv()\*(C' and \*(C`setpriv()\*(C' on the context object.

METHODS

new()

Creates a new \*(C`Mail::Milter::Object\*(C'. The fully qualified class is scanned for milter callback methods with names of the form CALLBACK_callback. If such a method exists, a corresponding callback entry point is added to this object.

AUTHOR

RELATED TO Mail::Milter::Object…

Mail::Milter, Sendmail::Milter.