1 |
--- qpsmtpd-0.83/lib/Qpsmtpd/TcpServer.pm.peer_hooks 2009-09-22 04:49:27.000000000 -0600 |
2 |
+++ qpsmtpd-0.83/lib/Qpsmtpd/TcpServer.pm 2009-10-29 10:55:19.000000000 -0600 |
3 |
@@ -72,7 +72,7 @@ sub run { |
4 |
# Set local client_socket to passed client object for testing socket state on writes |
5 |
$self->{__client_socket} = $client; |
6 |
|
7 |
- $self->load_plugins; |
8 |
+ $self->load_plugins unless $self->{hooks}; |
9 |
|
10 |
my $rc = $self->start_conversation; |
11 |
return if $rc != DONE; |
12 |
--- qpsmtpd-0.40/lib/Qpsmtpd/SMTP.pm.peer_hooks 2007-06-14 11:57:27.000000000 -0600 |
13 |
+++ qpsmtpd-0.40/lib/Qpsmtpd/SMTP.pm 2007-06-14 13:44:52.000000000 -0600 |
14 |
@@ -95,6 +95,11 @@ |
15 |
my $self = shift; |
16 |
# this should maybe be called something else than "connect", see |
17 |
# lib/Qpsmtpd/TcpServer.pm for more confusion. |
18 |
+ my ($rc, $msg) = $self->run_hooks("set_hooks"); |
19 |
+ if ($rc == DENY) { |
20 |
+ $self->respond(550, ($msg || 'Connection from you denied, bye bye.')); |
21 |
+ return $rc; |
22 |
+ } |
23 |
$self->run_hooks("connect"); |
24 |
return DONE; |
25 |
} |
26 |
@@ -277,7 +282,9 @@ |
27 |
|
28 |
# if we don't have a plugin implementing this auth mechanism, 504 |
29 |
if( exists $auth_mechanisms{uc($mechanism)} ) { |
30 |
- return $self->{_auth} = Qpsmtpd::Auth::SASL( $self, $mechanism, @stuff ); |
31 |
+ $self->{_auth} = Qpsmtpd::Auth::SASL( $self, $mechanism, @stuff ); |
32 |
+ $self->run_hooks("valid_auth") if $self->{_auth} == OK; |
33 |
+ return $self->{_auth}; |
34 |
} else { |
35 |
$self->respond( 504, "Unimplemented authentification mechanism: $mechanism" ); |
36 |
return DENY; |
37 |
--- qpsmtpd-0.40/lib/Qpsmtpd/Plugin.pm.peer_hooks 2007-06-14 11:57:27.000000000 -0600 |
38 |
+++ qpsmtpd-0.40/lib/Qpsmtpd/Plugin.pm 2007-06-14 13:43:53.000000000 -0600 |
39 |
@@ -6,7 +6,7 @@ |
40 |
our @hooks = qw( |
41 |
logging config post-fork pre-connection connect ehlo_parse ehlo |
42 |
helo_parse helo auth_parse auth auth-plain auth-login auth-cram-md5 |
43 |
- rcpt_parse rcpt_pre rcpt mail_parse mail mail_pre |
44 |
+ valid_auth set_hooks rcpt_parse rcpt_pre rcpt mail_parse mail mail_pre |
45 |
data data_headers_end data_post queue_pre queue queue_post vrfy noop |
46 |
quit reset_transaction disconnect post-connection |
47 |
unrecognized_command deny ok received_line help |