Merge branch 'master' of github.com:msimerson/qpsmtpd-dev

This commit is contained in:
Matt Simerson 2012-06-27 19:25:16 -04:00
commit d6402b47b3
2 changed files with 10 additions and 4 deletions

View File

@ -288,7 +288,7 @@ sub hook_rcpt {
$self->log(LOGWARN, "skip, don't blacklist special account: ".$rcpt->user); $self->log(LOGWARN, "skip, don't blacklist special account: ".$rcpt->user);
# clear the naughty connection note here, if desired. # clear the naughty connection note here, if desired.
#$self->connection->notes('naughty', 0 ); $self->connection->notes('naughty', 0 );
} }
return DECLINED; return DECLINED;

View File

@ -213,6 +213,12 @@ sub register {
$self->{_args} = { @_ }; $self->{_args} = { @_ };
$self->{_args}{reject} = 1 if ! defined $self->{_args}{reject}; $self->{_args}{reject} = 1 if ! defined $self->{_args}{reject};
$self->{_args}{reject_type} ||= 'perm'; $self->{_args}{reject_type} ||= 'perm';
$self->{_args}{dspam_bin} ||= '/usr/local/bin/dspam';
if ( ! -x $self->{_args}{dspam_bin} ) {
$self->log(LOGERROR, "dspam not found: ");
return DECLINED;
};
$self->register_hook('data_post', 'data_post_handler'); $self->register_hook('data_post', 'data_post_handler');
} }
@ -228,9 +234,9 @@ sub data_post_handler {
return (DECLINED); return (DECLINED);
}; };
my $username = $self->select_username( $transaction ); my $user = $self->select_username( $transaction );
my $dspam_bin = $self->{_args}{dspam_bin} || '/usr/local/bin/dspam'; my $bin = $self->{_args}{dspam_bin};
my $filtercmd = "$dspam_bin --user $username --mode=tum --process --deliver=summary --stdout"; my $filtercmd = "$bin --user $user --mode=tum --process --deliver=summary --stdout";
$self->log(LOGDEBUG, $filtercmd); $self->log(LOGDEBUG, $filtercmd);
my $response = $self->dspam_process( $filtercmd, $transaction ); my $response = $self->dspam_process( $filtercmd, $transaction );