1Mail::DKIM::Policy(3) User Contributed Perl DocumentationMail::DKIM::Policy(3)
2
3
4
6 Mail::DKIM::Policy - abstract base class for originator "signing"
7 policies
8
10 version 1.20220520
11
13 # get all policies that apply to a verified message
14 foreach my $policy ($dkim->policies)
15 {
16
17 # the name of this policy
18 my $name = $policy->name;
19
20 # the location in DNS where this policy was found
21 my $location = $policy->location;
22
23 # apply this policy to the message being verified
24 my $result = $policy->apply($dkim);
25
26 }
27
29 Between the various versions of the DomainKeys/DKIM standards, several
30 different forms of sender "signing" policies have been defined. In
31 order for the Mail::DKIM library to support these different policies,
32 it uses several different subclasses. All subclasses support this
33 general interface, so that a program using Mail::DKIM can support any
34 and all policies found for a message.
35
37 These methods are supported by all classes implementing the
38 Mail::DKIM::Policy interface.
39
40 apply()
41 Apply the policy to the results of a DKIM verifier.
42
43 my $result = $policy->apply($dkim_verifier);
44
45 The caller must provide an instance of Mail::DKIM::Verifier, one which
46 has already been fed the message being verified.
47
48 Possible results are:
49
50 accept
51 The message is approved by the sender signing policy.
52
53 reject
54 The message is rejected by the sender signing policy.
55
56 neutral
57 The message is neither approved nor rejected by the sender signing
58 policy. It can be considered suspicious.
59
60 as_string()
61 The policy as a string.
62
63 Note that the string returned by this method will not necessarily have
64 the tags ordered the same as the text record found in DNS.
65
66 is_implied_default_policy()
67 Is this policy implied?
68
69 my $is_implied = $policy->is_implied_default_policy;
70
71 If you fetch the policy for a particular domain, but that domain does
72 not have a policy published, then the "default policy" is in effect.
73 Use this method to detect when that happens.
74
75 location()
76 Where the policy was fetched from.
77
78 This is generally a domain name, the domain name where the policy was
79 published.
80
81 If nothing is published for the domain, and the default policy was
82 returned instead, the location will be "undef".
83
84 name()
85 Identify what type of policy this is.
86
87 This currently returns strings like "sender", "author", and "ADSP". It
88 is subject to change in the next version of Mail::DKIM.
89
91 Mail::DKIM::DkPolicy - for RFC4870(historical) DomainKeys sender
92 signing policies
93
94 Mail::DKIM::DkimPolicy - for early draft DKIM sender signing policies
95
96 Mail::DKIM::AuthorDomainPolicy - for Author Domain Signing Practices
97 (ADSP)
98
100 • Jason Long <jason@long.name>
101
102 • Marc Bradshaw <marc@marcbradshaw.net>
103
104 • Bron Gondwana <brong@fastmailteam.com> (ARC)
105
107 Work on ensuring that this module passes the ARC test suite was
108 generously sponsored by Valimail (https://www.valimail.com/)
109
111 • Copyright (C) 2013 by Messiah College
112
113 • Copyright (C) 2010 by Jason Long
114
115 • Copyright (C) 2017 by Standcore LLC
116
117 • Copyright (C) 2020 by FastMail Pty Ltd
118
119 This library is free software; you can redistribute it and/or modify it
120 under the same terms as Perl itself, either Perl version 5.8.6 or, at
121 your option, any later version of Perl 5 you may have available.
122
123
124
125perl v5.36.0 2023-01-20 Mail::DKIM::Policy(3)