line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Haineko::SMTPD::RFC5321; |
2
|
2
|
|
|
2
|
|
2151
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
80
|
|
3
|
2
|
|
|
2
|
|
19
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
94
|
|
4
|
2
|
|
|
2
|
|
2600
|
use Haineko::SMTPD::RFC5322; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1645
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub is8bit { |
7
|
10
|
|
|
10
|
1
|
580
|
my $class = shift; |
8
|
10
|
|
50
|
|
|
31
|
my $argvs = shift || return 0; # (String) Any text |
9
|
|
|
|
|
|
|
|
10
|
10
|
100
|
|
|
|
51
|
return 1 unless $$argvs =~ m/\A[\x00-\x7f]+\z/; |
11
|
9
|
|
|
|
|
36
|
return 0; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub check_ehlo { |
15
|
13
|
|
|
13
|
1
|
35
|
my $class = shift; |
16
|
13
|
|
100
|
|
|
84
|
my $argvs = shift || return 0; # (String) The value of EHLO/HELO |
17
|
11
|
|
|
|
|
73
|
my $valid = Haineko::SMTPD::RFC5322->is_domainpart( $argvs ); |
18
|
11
|
|
|
|
|
26
|
my $octet = []; |
19
|
|
|
|
|
|
|
|
20
|
11
|
100
|
|
|
|
59
|
return 1 if $valid; |
21
|
2
|
|
|
|
|
7
|
$argvs =~ y/[] //d; |
22
|
2
|
|
|
|
|
8
|
$octet = [ split( /[.]/, $argvs ) ]; |
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
|
|
5
|
for my $e ( @$octet ) { |
25
|
|
|
|
|
|
|
# Check each octet |
26
|
5
|
100
|
|
|
|
19
|
last unless $e =~ m/\A\d+\z/; |
27
|
4
|
50
|
|
|
|
12
|
last if $e < 0; |
28
|
4
|
50
|
|
|
|
8
|
last if $e > 255; |
29
|
4
|
|
|
|
|
7
|
$valid++; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
2
|
100
|
|
|
|
10
|
return 1 if $valid == 4; |
33
|
1
|
|
|
|
|
6
|
return 0; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |