- status( $status )
- handler_config( $type )
- set_return( $code )
- is_handler_loaded( $name )
- get_handler( $name )
- get_callbacks( $callback )
- set_object_maker( $name, $ref )
- get_object( $name )
- set_object( $name, $object, $destroy )
- destroy_object( $name )
- exit_on_close( $error )
- reject_mail( $reason )
- quarantine_mail( $reason )
- defer_mail( $reason )
- set_symbol( $code, $key, $value )
- get_symbol( $searchkey )
- can_sort_header( $header )
- prepend_header( $field, $value )
- add_auth_header( $value )
- add_c_auth_header( $value )
- append_header( $field, $value )
- METRICS METHODS
- RBL METHODS
- TIMEOUT METHODS
- get_microseconds_since( $time )
- is_exception_type( $exception )
- handle_exception( $exception )
- set_alarm( $microseconds )
- set_handler_alarm( $microseconds )
- set_overall_timeout( $microseconds )
- get_type_timeout( $type )
- CALLBACK METHODS
- remap_connect_callback( $hostname, $ip )
- top_connect_callback( $hostname, $ip )
- remap_helo_callback( $helo_host )
- top_helo_callback( $helo_host )
- top_envfrom_callback( $env_from )
- top_envrcpt_callback( $env_to )
- top_header_callback( $header, $value, $original )
- top_body_callback( $body_chunk )
- HELPER METHODS
- format_ctext( $text )
- format_ctext_no_space( $text )
- format_header_comment( $comment )
- format_header_entry( $key, $value )
- get_domain_from( $address )
- get_domains_from( $address )
- get_address_from( $text )
- get_addresses_from( $text )
- LOGGING METHODS
- LOW LEVEL METHODS
- WRITING HANDLERS
- COPYRIGHT AND LICENSE
Mail::Milter::Authentication::Handler - Handler superclass
Handle the milter requests and pass off to individual handlers
my $object = Mail::Milter::Authentication::Handler->new( $thischild );
Takes the argument of the current Mail::Milter::Authentication object and creates a new handler object.
Return the version of this handler
Set the status of the current child as visible by ps.
Return the configuration hashref.
Return the configuration for the current handler.
Return the current handler type.
Set the return code to be passed back to the MTA.
Get the current return code.
Get the reject mail reason (or undef)
Clear the reject mail reason
Get the defer mail reason (or undef)
Clear the defer mail reason
Get the quarantine mail reason (or undef)
Clear the quarantine mail reason
Return the current top Handler object.
Check if the named handler is loaded.
Return the named handler object.
Return the list of handlers which have callbacks for the given event in the order they must be called in.
Register an object maker for type 'name'
Return the named object from the object store.
Object 'resolver' will be created if it does not already exist.
Object 'spf_server' will be created by the SPF handler if it does not already exist.
Handlers may register makers for other types as required.
Store the given object in the object store with the given name.
If $destroy then the object will be destroyed when the connection to the child closes
Remove the reference to the named object from the object store.
Remove the references to all objects currently stored in the object store.
Certain objects (resolver and spf_server) are not destroyed for performance reasons.
Exit this child once it has completed, do not process further requests with this child.
Reject mail with the given reason
Request quarantine mail with the given reason
Defer mail with the given reason
Clear the symbol store.
Clear the symbol store but do not remove the Connect symbols.
Store the key value pair in the symbol store with the given code (event stage).
Return a value from the symbol store, searches all codes for the given key.
Returns a TEMP FAIL to the calling MTA if the configuration is set to do so.
Config can be set for all, authenticated, local, and trusted connections.
Returns 1 is this handler has a header_sort method capable or sorting entries for $header Returns 0 otherwise
Sorting function for sorting the Authentication-Results headers Calls out to __HANDLER__->header_sort() to sort headers of a particular type if available, otherwise sorts alphabetically.
Send the header changes to the MTA.
Add a trace header to the email.
Add a section to the authentication header for this email.
Add a section to the authentication header for this email, and to any subsequent emails for this connection.
Add a normal header to the email.
Return json data from external file
Register a metric type
Increment a metrics counter by $count (defaults to 1 if undef)
Set a metrics counter to $count
Send metrics to the parent
Return details of the metrics this module exports.
Check the given IP address against an rbl list.
Returns true is listed.
Check the given domain against an rbl list.
Returns true is listed.
Return the current time in microseconds
Return the number of microseconds since the given time (in microseconds)
Given a Mail::Milter::Authentication::Exception object, this return the exception object type. Otherwise returns undef.
Handle exceptions thrown, this method currently handles the timeout type, by re-throwing the exception.
Should be called in Handlers when handling local exceptions, such that the higher level timeout exceptions are properly handled.
Return the time remaining (in microseconds) for the current Handler section level callback timeout.
Set a timeout alarm for $microseconds, and set the time remaining in the top level handler object.
Set an alarm for $microseconds, or the current time remaining for the section callback, whichever is the lower. This should be used in Handler timeouts to ensure that a local timeout never goes for longer than the current handler section, or protocol section level timeout.
Reset the alarm to the current time remaining in the section or protocol level timeouts.
This should be called in Handlers after local timeouts have completed, to reset the higher level timeout alarm value.
Clear the current Handler level timeout, should be called from the Protocol layer, never from the Handler layer.
Set the time in microseconds after which the Handler layer should timeout, called from the Protocol later, never from the Handler layer.
For a given timeout type, return the configured timeout value, or the current handler level timeout, whichever is lower.
Manually check the current timeout, and throw if it has passed.
Top level handler for dequeue.
Top level handler for handler setup.
Top level handler for the connect event for remapping only.
Top level handler for the metrics event.
Top level handler for the connect event.
Top level handler for the HELO event for remapping only.
Top level handler for the HELO event.
Top level handler for the MAIL FROM event.
Top level handler for the RCPT TO event.
Top level handler for the BODY header event.
Top level handler for the BODY end of headers event.
Top level handler for the BODY body chunk event.
Top level handler for the BODY end of message event.
Apply policy to the message, currently a nop.
Top level handler for the abort event.
Top level handler for the close event.
Top level handler for the add header event.
Called after the Authentication-Results header has been added, but before any other headers.
Write serialized $data into the queue for later dequeueing
Return an ArrayRef of all queued items for $key
This may be a list of filenames, or may be a list of some other ID, it should not be assumed that this value is useful outside of the dequeue methods.
Used in get_dequeue_object and delete_dequeue_object
Return a previously queued item
Delete a previously queued item
Mark a previously queued item as errored
Is the current connection from a local ip address?
Requires the LocalIP Handler to be loaded.
Is the current connection from a trusted ip address?
Requires the TrustedIP Handler to be loaded.
Is the current connection encrypted?
Requires the TLS Handler to be loaded.
In SMTP mode this is only available AFTER the eoh call.
Returns undef if the state is not yet known.
Is the current connection authenticated?
Requires the Auth Handler to be loaded.
Return the ip address of the current connection.
Format text as ctext for use in headers.
Format text as ctext with no spaces for use in headers.
Format text as a comment for use in headers.
Format text as a key value pair for use in authentication header.
Extract a single domain from an email address.
Extract the domains from an email address as an arrayref.
Extract a single email address from a string.
Extract all email address from a string as an arrayref.
Return the effective hostname of the MTA.
Return the effective authserv-id. Defaults to hostname if not explicitly set.
Send output to debug and/or Mail Log.
priority is a standard Syslog priority.
Log an error.
Write out logs to disc.
Logs are not written immediately, they are written at the end of a connection so we can include a queue id. This is not available at the start of the process.
Return Continue code.
Return TempFail code.
Return Reject code.
Return Discard code.
Return Accept code.
Write a packet to the MTA (calls Protocol object)
Write an Add Header packet to the MTA (calls Protocol object)
Write an Insert Header packet to the MTA (calls Protocol object)
Write a Change Header packet to the MTA (calls Protocol object)
Marc Bradshaw <firstname.lastname@example.org>
This software is copyright (c) 2020 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.