1 |
slords |
1.1 |
diff -Nur -x '*.orig' -x '*.rej' smeserver-qpsmtpd-1.2.1/root/usr/share/qpsmtpd/plugins/peers mezzanine_patched_smeserver-qpsmtpd-1.2.1/root/usr/share/qpsmtpd/plugins/peers |
2 |
|
|
--- smeserver-qpsmtpd-1.2.1/root/usr/share/qpsmtpd/plugins/peers 2007-01-11 13:51:37.000000000 -0700 |
3 |
|
|
+++ mezzanine_patched_smeserver-qpsmtpd-1.2.1/root/usr/share/qpsmtpd/plugins/peers 2007-01-11 13:51:33.000000000 -0700 |
4 |
|
|
@@ -46,9 +46,9 @@ |
5 |
|
|
sub _peer_plugins { |
6 |
|
|
my $qp = shift; |
7 |
|
|
my $config = shift; |
8 |
|
|
+ $qp->{hooks} = {}; |
9 |
|
|
my @plugins = $qp->config($config); |
10 |
|
|
- $qp->log(LOGNOTICE, "loading plugins @plugins from $config"); |
11 |
|
|
- |
12 |
|
|
+ $qp->log(LOGNOTICE, "loading plugin $_") foreach (@plugins); |
13 |
|
|
return $qp->_load_plugins($qp->plugin_dir, @plugins); |
14 |
|
|
} |
15 |
|
|
|
16 |
|
|
@@ -61,13 +61,28 @@ |
17 |
|
|
while ($client_ip) { |
18 |
|
|
if (-f "config/peers/$client_ip") { |
19 |
|
|
_peer_plugins($qp, "peers/$client_ip"); |
20 |
|
|
+ $self->register_hook("mail", "verify_auth", 1); |
21 |
|
|
return (DECLINED); |
22 |
|
|
} |
23 |
|
|
$client_ip =~ s/\.?\d+$//; # strip off another 8 bits |
24 |
|
|
} |
25 |
|
|
if (-f "config/peers/0") { |
26 |
|
|
_peer_plugins($qp, "peers/0"); |
27 |
|
|
+ $self->register_hook("mail", "verify_auth", 1); |
28 |
|
|
return (DECLINED); |
29 |
|
|
} |
30 |
|
|
return (DENY); |
31 |
|
|
} |
32 |
|
|
+ |
33 |
|
|
+sub verify_auth { |
34 |
|
|
+ my ( $self, $transaction, $method, $user, $passClear, $passHash, $ticket ) = @_; |
35 |
|
|
+ |
36 |
|
|
+ my $qp = $self->qp; |
37 |
|
|
+ |
38 |
|
|
+ if ( $qp->auth_mechanism() and $qp->auth_user() ) |
39 |
|
|
+ { |
40 |
|
|
+ _peer_plugins($qp, "peers/local") if (-f "config/peers/local"); |
41 |
|
|
+ } |
42 |
|
|
+ |
43 |
|
|
+ return (DECLINED); |
44 |
|
|
+} |