| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::SMTP::Verify::Result; |
|
2
|
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
15
|
use Moose; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
29
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.03'; # VERSION |
|
6
|
|
|
|
|
|
|
# ABSTRACT: address verification result for a recipient |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has 'address' => ( is => 'rw', isa => 'Str', required => 1 ); |
|
10
|
|
|
|
|
|
|
has 'host' => ( is => 'rw', isa => 'Maybe[Str]' ); |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'has_starttls' => ( is => 'rw', isa => 'Maybe[Bool]' ); |
|
13
|
|
|
|
|
|
|
has 'has_tlsa' => ( is => 'rw', isa => 'Maybe[Bool]' ); |
|
14
|
|
|
|
|
|
|
has 'has_openpgpkey' => ( is => 'rw', isa => 'Maybe[Bool]' ); |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has 'smtp_message' => ( is => 'rw', isa => 'Maybe[Str]' ); |
|
17
|
|
|
|
|
|
|
has 'smtp_code' => ( is => 'rw', isa => 'Maybe[Int]' ); |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has 'error' => ( is => 'rw', isa => 'Maybe[Str]' ); |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub is_success { |
|
23
|
18
|
|
|
18
|
1
|
30
|
my $self = shift; |
|
24
|
18
|
100
|
66
|
|
|
780
|
if( defined $self->smtp_code && $self->smtp_code =~ /^2/) { |
|
25
|
12
|
|
|
|
|
80
|
return 1; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
6
|
|
|
|
|
33
|
return 0; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
sub is_error { |
|
30
|
0
|
|
|
0
|
1
|
0
|
return ! shift->is_success; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
sub is_temp_error { |
|
33
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
34
|
0
|
0
|
0
|
|
|
0
|
if( defined $self->smtp_code && $self->smtp_code =~ /^4/) { |
|
35
|
0
|
|
|
|
|
0
|
return 1; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
0
|
|
|
|
|
0
|
return 0; |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
sub is_perm_error { |
|
40
|
6
|
|
|
6
|
1
|
14
|
my $self = shift; |
|
41
|
6
|
100
|
66
|
|
|
293
|
if( defined $self->smtp_code && $self->smtp_code =~ /^5/) { |
|
42
|
4
|
|
|
|
|
31
|
return 1; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
2
|
|
|
|
|
16
|
return 0; |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
1; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=pod |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=encoding UTF-8 |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 NAME |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Net::SMTP::Verify::Result - address verification result for a recipient |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 VERSION |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
version 1.03 |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
my $result = Net::SMTP::Verify::Result->new( |
|
65
|
|
|
|
|
|
|
address => 'rcpt@domain.de', |
|
66
|
|
|
|
|
|
|
host => 'mx.domain.de', |
|
67
|
|
|
|
|
|
|
has_starttls => 1, |
|
68
|
|
|
|
|
|
|
has_tlsa => 1, |
|
69
|
|
|
|
|
|
|
has_openpgpkey => 1, |
|
70
|
|
|
|
|
|
|
smtp_code => 250, |
|
71
|
|
|
|
|
|
|
smtp_message => '2.1.5 Ok', |
|
72
|
|
|
|
|
|
|
); |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
$result->is_success # returns 1 |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
A result class for Net::SMTP::Verify recipient checks. |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 address ( required ) |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
The smtp address checked. |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 host |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
The MTA that returned queried. |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 has_starttls |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
If STARTTLS is available. |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 has_tlsa |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
If a TLSA record for the host exists. |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 has_openpgpkey |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
If a OPENPGPKEY record for the address exists. |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head2 smtp_code |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
The SMTP code returned. |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head2 smtp_message |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
The SMTP message returned. |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head2 error |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Set if an error occured during the check. |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 METHODS |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head2 is_success() |
|
117
|
|
|
|
|
|
|
=head2 is_error() |
|
118
|
|
|
|
|
|
|
=head2 is_temp_error() |
|
119
|
|
|
|
|
|
|
=head2 is_perm_error() |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Returns 1 if the result is an success,error,temporary error or permanent error. |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head1 AUTHOR |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Markus Benning <ich@markusbenning.de> |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
This software is Copyright (c) 2015 by Markus Benning <ich@markusbenning.de>. |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
This is free software, licensed under: |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
The GNU General Public License, Version 2, June 1991 |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=cut |