diff --git a/plugins/karma b/plugins/karma index 6dce939..ae1bead 100644 --- a/plugins/karma +++ b/plugins/karma @@ -243,6 +243,7 @@ sub register { }; #$self->prune_db(); # keep the DB compact $self->register_hook('connect', 'connect_handler'); + $self->register_hook('data', 'data_handler' ); $self->register_hook('disconnect', 'disconnect_handler'); } @@ -316,6 +317,14 @@ sub connect_handler { return $self->get_reject( $mess, $karma ); } +sub data_handler { + my ($self, $transaction) = @_; + return DECLINED if ! $self->qp->connection->relay_client; + + $self->adjust_karma( 5 ); # big karma boost for authenticated user/IP + return DECLINED; +}; + sub disconnect_handler { my $self = shift; diff --git a/plugins/relay b/plugins/relay index 979ef94..7cba450 100644 --- a/plugins/relay +++ b/plugins/relay @@ -241,7 +241,6 @@ sub hook_connect { # 95586 (connect) relay: pass, octet match in relayclients (127.0.0.) if ( $self->is_in_cidr_block() || $self->is_octet_match() ) { - $self->adjust_karma( 2 ); # big karma boost! $self->qp->connection->relay_client(1); return (DECLINED); };