Robin Bowes wrote:
> Gordon Rowell wrote:
>> --- plugins/dnsbl.orig  2005-07-02 12:17:32.000000000 +1000
>> +++ plugins/dnsbl       2005-07-02 17:17:00.000000000 +1000
>> @@ -17,6 +17,8 @@
>>  sub connect_handler {
>>    my ($self, $transaction) = @_;
>>
>> +  return (DECLINED) if $self->qp->connection->relay_client();
>> +
>>    my $remote_ip = $self->qp->connection->remote_ip;
>>
>>    # perform RBLSMTPD checks to mimic Dan Bernstein's rblsmtpd
>> @@ -155,6 +157,8 @@
>>    my ($self, $transaction, $rcpt) = @_;
>>    my $connection = $self->qp->connection;
>>
>> +  return (DECLINED) if $self->qp->connection->relay_client();
>> +
>>    # RBLSMTPD being non-empty means it contains the failure message to
>> return
>>    if (defined ($ENV{'RBLSMTPD'}) && $ENV{'RBLSMTPD'} ne '') {
>>      my $result = $ENV{'RBLSMTPD'};
>>
> 
> Is there any reason that this patch never made into core?
> 
> Here's a revised version for trunk:
> 
>> --- dnsbl.orig  2007-05-25 01:44:31.000000000 -0700
>> +++ dnsbl       2007-05-25 01:51:34.000000000 -0700
>> @@ -25,6 +25,12 @@
>>  sub hook_connect {
>>    my ($self, $transaction) = @_;
>>  
>> +  # Don't do dnsbl lookups if relaying
>> +  if ( $self->qp->connection->relay_client() ) {
>> +    $self->log(LOGINFO, "Relaying detected. Skipping dnsbl checks.");
>> +    return DECLINED;
>> +  }
>> +
>>    my $remote_ip = $self->qp->connection->remote_ip;
>>  
>>    # perform RBLSMTPD checks to mimic Dan Bernstein's rblsmtpd
> 
> I don't think it needs patching anywhere else.

OK, it's early - that's my excuse.

1. I didn't see the rest of the thread so didn't see John's response.
2. It obviously needs patching in hook_rcpt too.

I'll investigate the relay_ok approach recommended by John.

R.

Reply via email to