--- qpsmtpd-0.40/lib/Qpsmtpd/SMTP.pm.peer_hooks 2007-06-14 11:57:27.000000000 -0600 +++ qpsmtpd-0.40/lib/Qpsmtpd/SMTP.pm 2007-06-14 13:44:52.000000000 -0600 @@ -95,6 +95,11 @@ my $self = shift; # this should maybe be called something else than "connect", see # lib/Qpsmtpd/TcpServer.pm for more confusion. + my ($rc, $msg) = $self->run_hooks("set_hooks"); + if ($rc == DENY) { + $self->respond(550, ($msg || 'Connection from you denied, bye bye.')); + return $rc; + } $self->run_hooks("connect"); return DONE; } @@ -279,7 +284,9 @@ # if we don't have a plugin implementing this auth mechanism, 504 if( exists $auth_mechanisms{uc($mechanism)} ) { - return $self->{_auth} = Qpsmtpd::Auth::SASL( $self, $mechanism, @stuff ); + $self->{_auth} = Qpsmtpd::Auth::SASL( $self, $mechanism, @stuff ); + $self->run_hooks("valid_auth") if $self->{_auth} == OK; + return $self->{_auth}; } else { $self->respond( 504, "Unimplemented authentification mechanism: $mechanism" ); return DENY; --- qpsmtpd-0.40/lib/Qpsmtpd/Plugin.pm.peer_hooks 2007-06-14 11:57:27.000000000 -0600 +++ qpsmtpd-0.40/lib/Qpsmtpd/Plugin.pm 2007-06-14 13:43:53.000000000 -0600 @@ -6,7 +6,7 @@ our @hooks = qw( logging config post-fork pre-connection connect ehlo_parse ehlo helo_parse helo auth_parse auth auth-plain auth-login auth-cram-md5 - rcpt_parse rcpt_pre rcpt mail_parse mail mail_pre + valid_auth set_hooks rcpt_parse rcpt_pre rcpt mail_parse mail mail_pre data data_headers_end data_post queue_pre queue queue_post vrfy noop quit reset_transaction disconnect post-connection unrecognized_command deny ok received_line help