Mail::D...kPolicy(3)
π NAME
okay bestie, welcome to the Mail::D...kPolicy(3) page from User Contributed Perl Documentation β the manual name is Mail::DKIM::DkPolicy(3), and the class is Mail::DKIM::DkPolicy. It represents a DomainKeys Sender Signing Policy record. iconic behavior, no cap.
π·οΈ VERSION
this page is serving version 1.20240923 β yes, thatβs the exact version string, periodt.
πΈ DESCRIPTION
DomainKeys sender signing policies are described in RFC4870(historical). It is a record published in the message sender's (i.e. the person who transmitted the message) DNS that describes how they sign messages. iykyk β DNS policy lore but make it readable.
π οΈ CONSTRUCTORS
fetch() β fetch a sender signing policy from DNS
my $policy = Mail::DKIM::DkPolicy->fetch(
Protocol => 'dns',
Sender => 'joe@example.org',
);
The following named arguments are accepted:
Protocolβ always specify"dns".Authorβ the"author"of the message for which policy is being checked. This is the first email address in the"From"header. According to RFC 2822, section 3.6.2, the"From"header lists who is responsible for writing the message.Senderβ the"sender"of the message for which policy is being checked. This is the first email address in the"Sender"header, or if there is not a"Sender"header, the"From"header. According to RFC 2822, section 3.6.2, the"Sender"header lists who is responsible for transmitting the message.
Depending on what type of policy is being checked, both the Sender and Author fields may need to be specified.
If a DNS error or timeout occurs, an exception is thrown. so like, be ready for that vibe check.
Otherwise, a policy object of some sort will be returned. If no policy is actually published, then the "default policy" will be returned. To check when this happens, use:
my $is_default = $policy->is_implied_default_policy;
new() β construct a default policy object
my $policy = Mail::DKIM::DkPolicy->new;
parse() β gets a policy object by parsing a string
my $policy = Mail::DKIM::DkPolicy->parse(
String => 'o=~; t=y'
);
π§ METHODS
apply() β apply the policy to the results of a DKIM verifier
my $result = $policy->apply($dkim_verifier);
The caller must provide an instance of Mail::DKIM::Verifier, one which has already been fed the message being verified. yes, fed as in already got the message, bestie.
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.
flags() β get or set the flags (t=) tag
A vertical-bar separated list of flags. slay.
is_implied_default_policy() β is this policy implied?
my $is_implied = $policy->is_implied_default_policy;
If you fetch the policy for a particular domain, but that domain does not have a policy published, then the "default policy" is in effect. Use this method to detect when that happens.
location() β where the policy was fetched from
DomainKeys policies only have per-domain policies, so this will be the domain where the policy was published.
If nothing is published for the domain, and the default policy was returned instead, the location will be undef. ghosted by DNS, honestly.
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 default. The domain may sign some (but not all) email."-"β The domain signs all email.
signall() β true if policy is /-"
thatβs the exact odd little string from the page, no cap. short and mysterious.
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.
π AUTHORS
Jason Long <jason@long.name>Marc Bradshaw <marc@marcbradshaw.net>Bron Gondwana <brong@fastmailteam.com>(ARC)
π«Ά THANKS
Work on ensuring that this module passes the ARC test suite was generously sponsored by Valimail (https://www.valimail.com/). sponsor slay.
π COPYRIGHT AND LICENSE
- Copyright (C) 2013 by Messiah College
- Copyright (C) 2010 by Jason Long
- Copyright (C) 2017 by Standcore LLC
- Copyright (C) 2020 by FastMail Pty Ltd
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
π and thatβs the whole page, bestie β sourced from perl v5.42.0, dated 2024-09-23, filed under Mail::D...kPolicy(3). mwah! π
π¦ where this page comes from
- alpine 3.23: perl-mail-dkim-doc 1.20240923-r0 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- opensuse-leap 16.0: perl-Mail-DKIM 1.20240923-bp160.1.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms