John

The code I have added are:



  my $connection = $self->qp->connection;

  # hans 2005-06-08
  if ( $connection->relay_client() ) {
     $self->log(LOGDEBUG, "RELAYCLIENT set, or authenticated");
     return DECLINED;
  } else {
     $self->log(LOGDEBUG, "RELAYCLIENT NOT set and NOT authenticated");
  }

The test "$connection->relay_client()" is never true? Messages in the log are always

   dnsbl plugin: RELAYCLIENT NOT set and NOT authenticated

Any ideas?

John Peacock wrote:
Keith Ivey wrote:

Why doesn't ->relay_client() check for $ENV{RELAYCLIENT}? Without that, it seems you have to add ' || exists($ENV{RELAYCLIENT}' every time you use it.


My bad, I shouldn't have included that at all!  This is sufficient:

    if ( $connection->relay_client() )

because of the code in plugin/check_relay (which is presumed to be run before other connect plugins anyways):

  while ($client_ip) {
    if (exists($ENV{RELAYCLIENT}) or
        exists($relay_clients{$client_ip}) or
        exists($more_relay_clients->{$client_ip}))
    {
      $connection->relay_client(1);
      last;
    }


There is no reason to set the %ENV variable once you are inside Qpsmtpd itself (for example if you were using tcpserver to set the $RELAYCLIENT).

John





--
/---------------------------------
/ Hans Sandsdalen - System Manager
/ http://www.spacetec.no
/ http://www.sandsdalen.net
/---------------------------------

Reply via email to