Mail::Milter::Chain(3pm) | User Contributed Perl Documentation | Mail::Milter::Chain(3pm) |
Mail::Milter::Chain - Perl extension for chaining milter callbacks
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);
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.
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.
Todd Vierling, <tv@duh.org> <tv@pobox.com>
Mail::Milter, Sendmail::Milter
2023-01-22 | perl v5.36.0 |