Mail::STS::Domain - class for MTA-STS domain lookups
version 0.01
my $domain = $sts->domain('example.com'); # or construct it yourself my $domain = Mail::STS::Domain( resolver => $resolver, # Net::DNS::Resolver agent => $agent, # LWP::UserAgent domain => 'example.com', ); $domain->mx; # [ 'mta1.example.com', ... ] $domain->tlsa; # undef or Net::DNS::RR:TLSA $domain->primary # mta1.example.com $domain->tlsrpt; # undef or Mail::STS::TLSRPTRecord $domain->sts; # undef or Mail::STS::STSRecord $domain->policy; # Mail::STS::Policy or will die()
The domain to lookup.
A Net::DNS::Resolver object to use for DNS lookups.
A LWP::UserAgent object to use for retrieving policy documents by https.
Maximum size allowed for STS policy document.
Retrieves MX hostnames from DNS and returns a array reference.
List is sorted by priority.
$domain->mx; # [ 'mta1.example.com', 'backup-mta1.example.com' ]
Returns the domainname if a AAAA or A record exists for the domain.
$domain->a; # "example.com"
Returns the type of record the domain resolves to:
If domain has MX records.
If domain has an AAAA or A record.
If the domain does not exist.
Returns the hostname of the primary MTA for this domain.
In case of MX records the first element of mx().
In case of an AAAA or A record the domainname.
Or undef if the domain does not resolve at all.
Returns 1 if resolver signaled successfull DNSSEC validation for the hostname returned by primary().
Otherwise returns 0.
Returns a Net::DNS::RR in case an TLSA record exists for the hostname returned by primary() otherwise undef.
Returns an Mail::STS::TLSRPTRecord if a TLSRPT TXT record for the domain could be lookup.
Returns an Mail::STS::STSRecord if a STS TXT record for the domain could be lookup.
Returns a Mail::STS::Policy object if a policy for the domain could be retrieved by the well known URL.
Otherwise will die with an error.
Returns 1 if resolver signaled successfull DNSSEC validation (ad flag) for returned record otherwise returns 0.
Markus Benning <ich@markusbenning.de>
This software is copyright (c) 2018 by Markus Benning <ich@markusbenning.de>.
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::STS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::STS
CPAN shell
perl -MCPAN -e shell install Mail::STS
For more information on module installation, please visit the detailed CPAN module installation guide.