|
|
|
@ -25,6 +25,8 @@ sub register { |
|
|
|
|
my (%args) = @_; |
|
|
|
|
|
|
|
|
|
$self->register_hook("connect", "connect_handler"); |
|
|
|
|
$self->register_hook("auth-plain", "auth_handler"); |
|
|
|
|
$self->register_hook("auth-login", "auth_handler"); |
|
|
|
|
$self->register_hook("mail", "mail_handler"); |
|
|
|
|
$self->register_hook("rcpt", "rcpt_handler"); |
|
|
|
|
$self->register_hook("data_post", "data_post_handler"); |
|
|
|
@ -92,6 +94,20 @@ sub connect_handler { |
|
|
|
|
return(DECLINED); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sub auth_handler { |
|
|
|
|
my ($self, $transaction, $method, $user) = @_; |
|
|
|
|
|
|
|
|
|
my ($statement) = "UPDATE ".$mail_table." SET auth_user=". |
|
|
|
|
$dbh->quote($user). |
|
|
|
|
" WHERE mail_id=".$mail_id; |
|
|
|
|
|
|
|
|
|
$self->log(LOGDEBUG,"auth_handler statement:".$statement); |
|
|
|
|
|
|
|
|
|
$dbh->do($statement) |
|
|
|
|
|| $self->log(LOGERROR,$dbh->errstr()); |
|
|
|
|
|
|
|
|
|
return(DECLINED); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sub mail_handler { |
|
|
|
|
my ($self, $transaction, $sender) = @_; |
|
|
|
|