line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Haineko::SMTPD::Relay; |
2
|
10
|
|
|
10
|
|
10454
|
use strict; |
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
378
|
|
3
|
10
|
|
|
10
|
|
55
|
use warnings; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
441
|
|
4
|
10
|
|
|
10
|
|
13133
|
use Class::Accessor::Lite; |
|
10
|
|
|
|
|
18982
|
|
|
10
|
|
|
|
|
78
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my $rwaccessors = [ |
7
|
|
|
|
|
|
|
'time', # (Time::Piece) |
8
|
|
|
|
|
|
|
'mail', # (String) Envelope from |
9
|
|
|
|
|
|
|
'rcpt', # (String) Envelope to |
10
|
|
|
|
|
|
|
'head', # (ArrayRef) Email headers |
11
|
|
|
|
|
|
|
'body', # (ScalarRef) Body part |
12
|
|
|
|
|
|
|
'attr', # (HashRef) Email::MIME attributes |
13
|
|
|
|
|
|
|
'host', # (String) Relay server hostname |
14
|
|
|
|
|
|
|
'port', # (String) Relay server port |
15
|
|
|
|
|
|
|
'auth', # (Integer) Rerquire SMTP-AUTH or not |
16
|
|
|
|
|
|
|
'retry', # (Integer) Retry count when an SMTP server returns 4XX. |
17
|
|
|
|
|
|
|
'sleep', # (Integer) Sleep for specified seconds until the next retrying |
18
|
|
|
|
|
|
|
'debug', # (Integer) 1 = Debug mode(Net::SMTP) |
19
|
|
|
|
|
|
|
'timeout', # (Integer) Timeout |
20
|
|
|
|
|
|
|
'username', # (String) Username for SMTP-AUTH |
21
|
|
|
|
|
|
|
'password', # (String) Password for SMTP-AUTH |
22
|
|
|
|
|
|
|
'response', # (Haineko::SMTPD::Response) ESMTP Replies from MTA |
23
|
|
|
|
|
|
|
'starttls', # (Integer) use STARTTLS or not |
24
|
|
|
|
|
|
|
]; |
25
|
|
|
|
|
|
|
my $roaccessors = []; |
26
|
|
|
|
|
|
|
my $woaccessors = []; |
27
|
|
|
|
|
|
|
Class::Accessor::Lite->mk_accessors( @$rwaccessors ); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub new { |
31
|
2
|
|
|
2
|
0
|
5187
|
my $class = shift; |
32
|
2
|
|
|
|
|
10
|
my $argvs = { @_ }; |
33
|
2
|
|
|
|
|
10
|
return bless $argvs, __PACKAGE__; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub defaulthub { |
37
|
1
|
|
|
1
|
0
|
6
|
my $class = shift; |
38
|
|
|
|
|
|
|
return { |
39
|
1
|
|
|
|
|
6
|
'host' => '127.0.0.1', |
40
|
|
|
|
|
|
|
'port' => 25, |
41
|
|
|
|
|
|
|
'auth' => 0, |
42
|
|
|
|
|
|
|
'mailer' => 'ESMTP', |
43
|
|
|
|
|
|
|
}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub sendmail { |
47
|
1
|
|
|
1
|
0
|
3728
|
my $self = shift; |
48
|
|
|
|
|
|
|
# Code for sending email at each class in Relay/*.pm |
49
|
1
|
|
|
|
|
5
|
return 0; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub getbounce { |
53
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
54
|
|
|
|
|
|
|
# Code for getting email bounce at each class in Relay/*.pm |
55
|
1
|
|
|
|
|
4
|
return 0; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
__END__ |