1Mail::DKIM::DkPolicy(3)User Contributed Perl DocumentatioMnail::DKIM::DkPolicy(3)
2
3
4
6 Mail::DKIM::DkPolicy - represents a DomainKeys Sender Signing Policy
7 record
8
10 DomainKeys sender signing policies are described in
11 RFC4870(historical). It is a record published in the message sender's
12 (i.e. the person who transmitted the message) DNS that describes how
13 they sign messages.
14
16 fetch() - fetch a sender signing policy from DNS
17 my $policy = Mail::DKIM::DkPolicy->fetch(
18 Protocol => 'dns',
19 Sender => 'joe@example.org',
20 );
21
22 The following named arguments are accepted:
23
24 Protocol
25 always specify "dns"
26
27 Author
28 the "author" of the message for which policy is being checked.
29 This is the first email address in the "From" header. According to
30 RFC 2822, section 3.6.2, the "From" header lists who is responsible
31 for writing the message.
32
33 Sender
34 the "sender" of the message for which policy is being checked.
35 This is the first email address in the "Sender" header, or if there
36 is not a "Sender" header, the "From" header. According to RFC
37 2822, section 3.6.2, the "Sender" header lists who is responsible
38 for transmitting the message.
39
40 Depending on what type of policy is being checked, both the Sender and
41 Author fields may need to be specified.
42
43 If a DNS error or timeout occurs, an exception is thrown.
44
45 Otherwise, a policy object of some sort will be returned. If no policy
46 is actually published, then the "default policy" will be returned. To
47 check when this happens, use
48
49 my $is_default = $policy->is_implied_default_policy;
50
51 new() - construct a default policy object
52 my $policy = Mail::DKIM::DkPolicy->new;
53
54 parse() - gets a policy object by parsing a string
55 my $policy = Mail::DKIM::DkPolicy->parse(
56 String => 'o=~; t=y'
57 );
58
60 apply() - apply the policy to the results of a DKIM verifier
61 my $result = $policy->apply($dkim_verifier);
62
63 The caller must provide an instance of Mail::DKIM::Verifier, one which
64 has already been fed the message being verified.
65
66 Possible results are:
67
68 accept
69 The message is approved by the sender signing policy.
70
71 reject
72 The message is rejected by the sender signing policy.
73
74 neutral
75 The message is neither approved nor rejected by the sender signing
76 policy. It can be considered suspicious.
77
78 flags() - get or set the flags (t=) tag
79 A vertical-bar separated list of flags.
80
81 is_implied_default_policy() - is this policy implied?
82 my $is_implied = $policy->is_implied_default_policy;
83
84 If you fetch the policy for a particular domain, but that domain does
85 not have a policy published, then the "default policy" is in effect.
86 Use this method to detect when that happens.
87
88 location() - where the policy was fetched from
89 DomainKeys policies only have per-domain policies, so this will be the
90 domain where the policy was published.
91
92 If nothing is published for the domain, and the default policy was
93 returned instead, the location will be "undef".
94
95 note() - get or set the human readable notes (n=) tag
96 Human readable notes regarding the record. Undef if no notes specified.
97
98 policy() - get or set the outbound signing policy (o=) tag
99 my $sp = $policy->policy;
100
101 Outbound signing policy for the entity. Possible values are:
102
103 "~" The default. The domain may sign some (but not all) email.
104
105 "-" The domain signs all email.
106
107 signall() - true if policy is /-"
108 testing() - checks the testing flag
109 my $testing = $policy->testing;
110
111 If nonzero, the testing flag is set on the signing policy, and the
112 verify should not consider a message suspicious based on this policy.
113
115 Jason Long, <jlong@messiah.edu>
116
118 Copyright (C) 2006-2009 by Messiah College
119
120 This library is free software; you can redistribute it and/or modify it
121 under the same terms as Perl itself, either Perl version 5.8.6 or, at
122 your option, any later version of Perl 5 you may have available.
123
124
125
126perl v5.28.1 2018-10-13 Mail::DKIM::DkPolicy(3)