Mail::Milter::Authentication::Tester::HandlerTester
version 2.20180510
Emulates an Authentication Milter environment with methods for testing Handlers.
Can snapshot and restore state at any point.
Make testing of Authentication Milter Handler modules easier.
Mail::Milter::Authentication::Tester::HandlerTester - Test harness for testing Authentication Milter Handlers
Instantiate a new HandlerTester object.
$args is a hashref with the following entries.
Required
The Prefix path containing the authentication milter config file(s). This should contain all configuration files required for your test, the main authentication_milter.json file can be overridden by the handler_config option (see below).
This location should, for example, contain a valid mail-dmarc.ini for any tests using the DMARC handler.
If present, the config will be built from a generic default SMTP environment, with the given HASHREF substituted as the Handler configuration. This eliminates the need to have a config file for each handler configuration you wish to test.
The zonefile data for use with Net::DNS::Resolver::Mock
A zonefile for use with Net::DNS::Resolver::Mock
Save a snapshot with the given name
Restore state from the given snapshot
Returns the Handler object
Call the connect callbacks with the given data.
Returns the value of get_return()
Call the helo callbacks with the given data.
Returns the value of get_return();
Call the envfrom callbacks with the given data.
Call the envrcpt callbacks with the given data.
Call the header callbacks with the given data.
Call the end_of_headers callbacks.
Call the body callbacks with the given data.
Call the eom callbacks.
Call the close callbacks.
Call the abort callbacks.
Call the addheader callbacks.
Run with a given set of data as defined in $args hashref.
Dies if the mail would be rejected.
Arguments of $args are.
The name of the connecting server.
The ip address of the connecting server.
The helo string.
The envelope MAILFROM address.
Arrayref of the envelope RCPTTO addresses.
The email body.
Returns the value of get_return() from the current handler object.
Returns the value of get_reject_mail() from the current handler object.
Returns a dummy authservid servername.
Returns a Mail::AuthenticationResults::Header object representing the authentication results header which would be added to the message.
Carp Clone Mail::AuthenticationResults::Header Mail::AuthenticationResults::Header::AuthServID Mail::Milter::Authentication Mail::Milter::Authentication::Protocol::Milter Mail::Milter::Authentication::Protocol::SMTP Mail::Milter::Authentication::Config Module::Load Net::DNS::Resolver::Mock
Marc Bradshaw <marc@marcbradshaw.net>
Copyright 2018
This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
This software is copyright (c) 2018 by Marc Bradshaw.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Mail::Milter::Authentication, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::Milter::Authentication
CPAN shell
perl -MCPAN -e shell install Mail::Milter::Authentication
For more information on module installation, please visit the detailed CPAN module installation guide.