Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

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

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

NAME
Mail::Milter::Chain - Perl extension for chaining milter callbacks SYNOPSIS
use Mail::Milter::Chain; my $chain = new Mail::Milter::Chain({ connect => &foo, ... }, ...); $chain->register({ connect => &bar, ... }); $chain->register({ connect => &baz, ... }); $chain->accept_break(1); use Sendmail::Milter; ... Sendmail::Milter::register('foo', $chain, SMFI_CURR_ACTS); DESCRIPTION
Mail::Milter::Chain allows multiple milter callback sets to be registered in a single milter server instance, simulating multiple milters running in separate servers. This is typically much less resource intensive than running each milter in its own server process. Any contained milter returning SMFIS_REJECT, SMFIS_TEMPFAIL, or SMFIS_DISCARD will terminate the entire chain and return the respective code up to the containing chain or milter server. Normally, a milter returning SMFIS_ACCEPT will remove only that milter from the chain, allowing others to continue processing the message. Alternatively, SMFIS_ACCEPT can be made to terminate the entire chain as is done for error results; see "accept_break()" below. A "Mail::Milter::Chain" is itself a milter callback hash reference, and can thus be passed directly to "Sendmail::Milter::register()" or another Mail::Milter::Chain container. IMPORTANT CAVEAT: Once this object has been registered with a parent container (a milter or another chain), DO NOT call "register()" on this object any longer. This will result in difficult to diagnose problems at callback time. METHODS
new([HASHREF, ...]) Creates a Mail::Milter::Chain object. For convenience, accepts one or more hash references corresponding to individual callback sets that will be registered with this chain. accept_break(FLAG) If FLAG is 0 (the default), SMFIS_ACCEPT will only remove the current milter from the list of callbacks, thus simulating a completely independent milter server. If FLAG is 1, SMFIS_ACCEPT will terminate the entire chain and propagate SMFIS_ACCEPT up to the parent chain or milter server. This allows a milter to provide a sort of "whitelist" effect, where SMFIS_ACCEPT speaks for the entire chain rather than just one milter callback set. This method returns a reference to the object itself, allowing this method call to be chained. register(HASHREF) Registers a callback set with this chain. Do not call after this chain has itself been registered with a parent container (chain or milter server). AUTHOR
Todd Vierling, <tv@duh.org> <tv@pobox.com> SEE ALSO
Mail::Milter, Sendmail::Milter perl v5.8.8 2004-02-26 Mail::Milter::Chain(3pm)

Check Out this Related 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)
Man Page