NAME
Mail::TLSRPT::Policy - TLSRPT policy object
VERSION
version 2.20261112
SYNOPSIS
my $policy = Mail::TLSRPT::Policy->new( policy_type => 'no-policy-found', policy_string => [], policy_domain => 'example.com', polixy_mx_host => 'mx.example.com', total_succerssful_session_count => 10, total_failure_session_count => 2, failures => $failures, );
DESCRIPTION
Classes to process tlsrpt policy in a report
CONSTRUCTOR
new($class)
Create a new object
new_from_data($data)
Create a new object using a data structure, this will create sub-objects as required.
METHODS
policy_mx_hosts
Return the mx-host patterns as an arrayref. RFC 8460 gives mx-host as a list, though its own example gives a string. A list can be given to new as policy_mx_hosts, in place of policy_mx_host: it's joined with spaces into policy_mx_host, and as_struct gives mx-host back as that list, or if policy_mx_host has been set since, as policy_mx_host split on whitespace.
policy_mode
Return the mode from the mode field of an sts policy_string, as written, or undef if there isn't one. Returns undef for other policy types.
known_policy_types
Return the list of policy types RFC 8460 section 4.4 defines
is_known_policy_type
Return true if the policy type is one of known_policy_types
as_struct
Return the current object and sub-objects as a data structure
as_string
Return a textual human readable representation of the current object and its sub-objects
process_prometheus($prometheus,$report)
Generate metrics using the given Prometheus::Tiny object
AUTHOR
Jemma Bradshaw <jemma@nothingbutstatic.dev>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Jemma 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.