Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mail::milter::object(3pm) [debian man page]

Mail::Milter::Object(3pm)				User Contributed Perl Documentation				 Mail::Milter::Object(3pm)

NAME
Mail::Milter::Object - Perl extension to encapsulate a milter in an object 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 "Sendmail::Milter" consist of nondescript hash references. "Mail::Milter::Object" transforms these callback hashes into fully qualified objects that are easier to maintain and understand. In conjunction with "Mail::Milter::Chain", this also allows for a more modular approach to milter implementation, by allowing each milter to be a small, granular object that can exist indepen- dently 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 "getpriv()" and "setpriv()" on the context object. METHODS
new() Creates a new "Mail::Milter::Object". The fully qualified class is scanned for milter callback methods with names of the form CALL- BACK_callback. If such a method exists, a corresponding callback entry point is added to this object. AUTHOR
Todd Vierling, <tv@duh.org> <tv@pobox.com> SEE ALSO
Mail::Milter, Sendmail::Milter. perl v5.8.8 2004-02-26 Mail::Milter::Object(3pm)

Check Out this Related Man Page

Mail::Milter::Wrapper(3pm)				User Contributed Perl Documentation				Mail::Milter::Wrapper(3pm)

NAME
Mail::Milter::Wrapper - Perl extension for wrappering milter objects SYNOPSIS
use Mail::Milter::Wrapper; my $milter = ...; my $wrapper = new Mail::Milter::Wrapper($milter, &foo); use Sendmail::Milter; ... Sendmail::Milter::register('foo', $wrapper, SMFI_CURR_ACTS); DESCRIPTION
Mail::Milter::Wrapper wraps another milter, allowing for interception of the passed arguments and/or return code of the contained milter. METHODS
new(MILTER, CODEREF[, CALLBACK ...]) Creates a Mail::Milter::Wrapper object. MILTER is the milter to wrap, which may be a plain hash reference or an instance of a hashref object such as "Mail::Milter::Object". CODEREF is the wrapper subroutine. CALLBACKs, if specified, are named callbacks which are needed by the wrapper, even if the contained milter does not use them. The wrapper subroutine will be called with the following arguments, in this order: * reference to the wrapper * name of callback * subroutine reference to call into the wrapped milter * arguments for the callback (>= 0) This subroutine should ALWAYS pass the "close" callback through to the contained milter. Failure to do so may corrupt the contained milter's state information and cause memory leaks. As an example, a simple subroutine which just passes the callback through might be written as: sub callback_wrapper { shift; # don't need $this my $cbname = shift; my $callback_sub = shift; &$callback_sub(@_); } AUTHOR
Todd Vierling, <tv@duh.org> <tv@pobox.com> SEE ALSO
Mail::Milter, Sendmail::Milter perl v5.8.8 2004-02-26 Mail::Milter::Wrapper(3pm)
Man Page