NAME

Mail::DKIM::Policy - represents a DKIM sender signing policy

CONSTRUCTORS

fetch() - fetch a sender signing policy from DNS

my $policy = fetch Mail::DKIM::Policy(
                 Protocol => "dns",
                 Domain => "example.org",
             );

If a DNS error or timeout occurs, an exception is thrown.

If the policy is not found, or a non-DNS error occurs, undef is returned instead of a policy.

new() - construct a default policy object

my $policy = new Mail::DKIM::Policy;

parse() - gets a policy object by parsing a string

my $policy = parse Mail::DKIM::Policy(
                 String => "o=~; t=y"
             );

METHODS

apply() - apply the policy to the results of a DKIM verifier

Possible results are:

accept

The message is approved by the sender signing policy.

reject

The message is rejected by the sender signing policy.

neutral

The message is neither approved nor rejected by the sender signing policy. It can be considered suspicious.

as_string() - the policy as a string

Note that the string returned by this method will not necessarily have the tags ordered the same as the text record found in DNS.

flags() - get or set the flags (t=) tag

A vertical-bar separated list of flags.

note() - get or set the human readable notes (n=) tag

Human readable notes regarding the record. Undef if no notes specified.

policy() - get or set the outbound signing policy (o=) tag

my $sp = $policy->policy;

Outbound signing policy for the entity. Possible values are:

~

The entity signs some but not all email.

-

All mail from the entity is signed; unsigned email MUST NOT be accepted, but email signed with a Verifier Acceptable Third Party Signature SHOULD be accepted.

TODO

testing() - checks the testing flag

my $testing = $policy->testing;

If nonzero, the testing flag is set on the signing policy, and the verify should not consider a message suspicious based on this policy.

BUGS

  • If a sender signing policy is not found for a given domain, the fetch() method should search the parent domains, according to section 4 of the dkim-ssp Internet Draft.