Matt Sergeant said the following on 10/01/2006 15:55:
> On 10 Jan 2006, at 10:42, Robin Bowes wrote:
> 
>>> What am I doing wrong?
>>
>>
>> Got it.
>>
>> Several things really...
>>
>> 1. Use $validrcptto not %validrcptto
>> 2. Don't specify the .cdb extension (can someone confirm how this works?
>> Does the code take the filename and append ".cdb" ?
> 
> 
> Yes. It's a bit strange, and really screws with caching unfortunately. I
> wish we could just re-write it all - there have been a number of
> suggestions to do so.
> 
>> 3. (and this is the main problem) The config object is under $self->qp,
>> e.g.:
>>
>>     # map to cdb file containing valid local email addresses
>>     my $validrcptto = $self->qp->config( 'validrcptto', 'map' )
>>       || return DECLINED;
> 
> 
> Ah, I adding a proxy to allow $self->config() in trunk, hence why I
> wrote what I wrote.

Ah, I see.

Anyway, it's still not working.

I've just had loads of mail bounce because I thought it was  - the joys
of testing in a live environment!

Here's what I'm currently using:

    # map to cdb file containing valid local email addresses
    my $validrcptto = $self->qp->config( 'validrcptto', 'map' )
      || return DECLINED;

    # build addresses to check:
    my $host = '@' . lc( $recipient->host );
    my ($user) = split $SEPARATOR, $recipient->user;
    my $to = lc($user) . $host;

    warn "$to not found in validrcptto"
        if (! exists $validrcptto->{$to} );
    warn "$host not found in validrcptto"
        if (! exists $validrcptto->{$host} );

This produces the following in the log file:

[EMAIL PROTECTED] not found in validrcptto at
./plugins/check_validrcptto_cdb line 54, <STDIN> line 173.
@robinbowes.com not found in validrcptto at
./plugins/check_validrcptto_cdb line 56, <STDIN> line 173.

I've added a "warn Dumper $validrcptto" which produces the following in
the log:

2006-01-10 16:34:11.612815500 $VAR1 = {};

So, it looks like the cdb is not getting read.

This is the cdb file in th config dir:

-rw-r--r--  1 root root 4013 Jan 10 16:23 validrcptto.cdb

Any ideas?

R.
-- 
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

Reply via email to