develooper Front page | perl.qpsmtpd | Postings from September 2007

Re: Does the received_line hook work in 0.40?

Thread Previous | Thread Next
From:
Matt Sergeant
Date:
September 14, 2007 16:48
Subject:
Re: Does the received_line hook work in 0.40?
Message ID:
D0B1CCF5-008F-489F-87E3-112B5165380E@sergeant.org
On 14-Sep-07, at 8:10 AM, John L wrote:

>> How/what do you return from your hook_received_line()? The first  
>> value
>> should be the "OK" constant, the second the received line. Any other
>> value than OK, will ignore the results from your hook.
>
> It's clearly returning OK.  Here's what the debug log says:
>
> 34169 Plugin messagelog, hook received_line returned OK, from  
> simone.iecc.com (HELO simone) (208.31.42.47)
>   by mail1.iecc.com with SMTP id 1 (qpsmtpd/0.40.1J) ; Thu, 13 Sep  
> 2007 23:19:57 -0400
>
> Looking at the code, I don't see how the hook can work without being
> split into two parts like all the other hooks.

Which bit of the code are you looking at? It's in hook_responder:

sub hook_responder {
   my ($self, $hook, $msg, $args) = @_;

   my $code = shift @$msg;

   my $responder = $hook . '_respond';
   if (my $meth = $self->can($responder)) {
     return $meth->($self, $code, $msg, $args);
   }
# THIS BIT HERE...
   return $code, @$msg;
}


Of course that only means it *should* work, not that it does... I'll  
have a look when I have a bit more time.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About