qmail_deliverable: smite null sender to email list

This commit is contained in:
Matt Simerson 2013-04-22 02:29:29 -04:00
parent ca678ba736
commit f9fb0acee7
2 changed files with 18 additions and 6 deletions

View File

@ -328,8 +328,11 @@ sub rcpt_handler {
my $recipients = scalar $self->transaction->recipients; my $recipients = scalar $self->transaction->recipients;
return DECLINED if $recipients < 2; # only one recipient return DECLINED if $recipients < 2; # only one recipient
my $karma = $self->connection->notes('karma_history'); my $history = $self->connection->notes('karma_history');
return DECLINED if $karma > 0; # good karma, no limit return DECLINED if $history > 0; # good history, no limit
my $karma = $self->connection->notes('karma');
return DECLINED if $karma > 0; # good connection, no limit
# limit # of recipients if host has negative or unknown karma # limit # of recipients if host has negative or unknown karma
return $self->get_reject("too many recipients"); return $self->get_reject("too many recipients");
@ -337,9 +340,16 @@ sub rcpt_handler {
sub data_handler { sub data_handler {
my ($self, $transaction) = @_; my ($self, $transaction) = @_;
return DECLINED if !$self->qp->connection->relay_client;
if ( $self->qp->connection->relay_client ) {
$self->adjust_karma(5); # big karma boost for authenticated user/IP $self->adjust_karma(5); # big karma boost for authenticated user/IP
};
my $karma = $self->connection->notes('karma');
if ( $karma < -3 ) { # bad karma
return $self->get_reject("very bad karma: $karma");
};
return DECLINED; return DECLINED;
} }

View File

@ -201,8 +201,10 @@ sub rcpt_handler {
$self->log(LOGINFO, "pass, bouncesaying with program"), $k++ if $rv == 0x13; $self->log(LOGINFO, "pass, bouncesaying with program"), $k++ if $rv == 0x13;
if ($rv == 0x14) { if ($rv == 0x14) {
my $s = $transaction->sender->address; my $s = $transaction->sender->address;
return (DENY, "mailing lists do not accept null senders") if (!$s || $s eq '<>') {
if (!$s || $s eq '<>'); $self->adjust_karma(-1);
return (DENY, "mailing lists do not accept null senders");
};
$self->log(LOGINFO, "pass, ezmlm list"); $self->log(LOGINFO, "pass, ezmlm list");
$k++; $k++;
} }