Milter wrapper to delay failure returns
use Mail::Milter::Wrapper::DeferToRCPT;
my $milter = ...; my $wrapper = new Mail::Milter::Wrapper::DeferToRCPT($milter);
my $wrapper2 = &DeferToRCPT($milter); # convenience
Mail::Milter::Wrapper::DeferToRCPT is a convenience milter wrapper which defers any error return during the \*(L"connect\*(R", \*(L"helo\*(R", and/or \*(L"envfrom\*(R" callbacks to the \*(L"envrcpt\*(R" callback.
Many broken client mailers exist in the real world and will do such things as instantaneously reconnect when receiving an error at the \s-1MAIL\s0 \s-1FROM:\s0 stage. This wrapper ensures that errors are never propagated back to the \s-1MTA\s0 until at least the \s-1RCPT\s0 \s-1TO:\s0 phase.
Errors in \*(L"connect\*(R" and \*(L"helo\*(R" will apply to the entire \s-1SMTP\s0 transaction. Errors in \*(L"envfrom\*(R" will only apply to that particular message.
This wrapper can also be used to enhance logging. Though the contained milter may wish to reject a mail in progress, it may be useful for logging purposes to capture the \s-1HELO\s0 string, sender, and recipient addresses of each attempted mail.
Todd Vierling, <[email protected]> <[email protected]>
Mail::Milter::Wrapper