Mail-STS

library for looking up MTA-STS policies


License
Artistic-1.0-Perl

Documentation

DESCRIPTION

This class provides an interface for looking up RFC8461 MTA-STS policies.

SYNOPSIS

my $sts = Mail::STS->new;
$domain = $sts->domain('domain.de');

# may try dane first?
return 'dane' if $domain->tlsa;

# has a TLSRPT record?
$domain->tlsrpt
# undef or Mail::STS::TLSRPTRecord

$domain->sts;
# undef or Mail::STS::STSRecord
$domain->sts->id;
# 12345...

$policy = $domain->policy;
# Mail::STS::Policy or will die on error
$policy->mode;
# 'enforce', 'testing' or 'none'
$policy->mx;
# ['mta1.example.net', '*.example.de', ...]
$policy->match_mx('whatever.example.de');
# 1

ATTRIBUTES

agent_timeout(default: 60)

Set default for http agent for policy retrieval.

A timeout of one minute is suggested.

max_policy_size(default: 65536)

Maximum size for STS policy documents in bytes.

resolver

By default will use a Net::DNS::Resolver with dnssec/adflag enabled.

Could be used to provide a custom Net::DNS::Resolver object.

agent

By default will initialize a new LWP::UserAgent with parameters take from this object.

ssl_opts, proxy, no_proxy, env_proxy

These methods are delegated to the LWP::UserAgent object.

See LWP::UserAgent for details.

ssl_ca_file (default: undef)

Set a ssl_ca_file for the default LWP::UserAgent.

ssl_ca_path (default: undef)

Set a ssl_ca_path for the default LWP::UserAgent.

METHODS

domain($domain)

Returns a Mail::STS::Domain object for $domain for lookup of domain details.

SEE ALSO

Mail::STS::Domain, Mail::STS::Policy, Mail::STS::TLSRPTRecord, Mail::STS::STSRecord