Hi again!

My little plugin isn't working as intended... :-( BTW, Peter, I looked 
more carefully at yours, but I don't really have an aliases list... 

On Monday 13 November 2006 21:34, Kjetil Kjernsmo wrote:
> Just checked it in:
>  http://svn.kjernsmo.net/qpsmtpd-check-rcptlist/trunk/check_rcptlist

But I poked around a bit, and now my plugin looks like this:

sub hook_rcpt {
  my ($self, $transaction, $recipient) = @_;
  my @addresses = $self->qp->config('validaddresses') || return 
DECLINED;
  foreach my $ok (@addresses) {
    $ok =~ s/^\s*(\S+).*/$1/;
    return DECLINED if (lc($recipient->user) eq lc($ok)); # That's a 
valid address
  }
  $transaction->notes('rcptlist', "Sorry, this address was not on my 
list of valid addresses"); # Then it doesn't exist
  return DENY;
}

This rejects everything... :-( I first thought that it might not load my 
list of addresses, but the DECLINED up there didn't take care of it, so 
then I figured it might not match anything, and that it might need 
chomping or something, or just remove all whitespace, and lowercase, so 
it does that. But it didn't help. And I tried stuffing that transaction 
note in there, hoping I would see that in the bounce or in the logs, 
but I don't. Also, I only have my real mail server to test this on 
atm... :-( I tried to insert a few usual warns in there to dump 
@addresses and $ok, but didn't see anything either. 

How do I debug something like this?

Cheers,

Kjetil
-- 
Kjetil Kjernsmo
Programmer / Astrophysicist / Ski-orienteer / Orienteer / Mountaineer
[EMAIL PROTECTED]
Homepage: http://www.kjetil.kjernsmo.net/     OpenPGP KeyID: 6A6A0BBC

Reply via email to