The count_unrecognized_commands plugin seems to have been broken since
CVS revision 1.5 (http://tinyurl.com/52ux4) when the return code issued
when the number of unrecognized commands has been exceeded was changed
from DENY to DENYHARD.  Unfortunately, DENYHARD isn't a valid return
code for the unrecognized_command hook.  Quoth the README.plugins file:

        DENY - Return 521 and disconnect the client
        DONE - Qpsmtpd won't do anything; the plugin responded
        Anything else - Return '500 Unrecognized command'

Patch attached which reverts the return value to what it was in 1.4.

Perhaps Qpsmtpd::SMTP::dispatch should also be changed so that for the
unrecognized_command hook DENY_DISCONNECT will behave the same as DENY?

Thanks,
-mct

-- 
perl -e'$u="\4\5\6";sub H{8*($_[1]%79)+($_[0]%8)}sub G{vec$u,H(@_),1}sub S{vec
($n,H(@_),1)=$_[2]}$_=q^{P`clear`;for$iX){PG($iY)?"O":" "forX8);P"\n"}for$iX){
forX8){$c=scalar [EMAIL PROTECTED];S$iY,G(
$iY)?$c=~/[23]/?1:0:$c==3?1:0}}$u=$n;select$M,$C,$T,.2;redo}^;s/Z/],[\$i/g;s/Y
/,\$_/xg;s/X/(0..7/g;s/P/print+/g;eval' #     Michael C. Toren <[EMAIL 
PROTECTED]>

--- qpsmtpd-cvs/plugins/count_unrecognized_commands     Sat Jan 15 15:48:46 2005
+++ qpsmtpd-production/plugins/count_unrecognized_commands      Sat Jan 15 
15:42:39 2005
@@ -42,7 +42,7 @@
 
   if ($badcmdcount >= $self->{_unrec_cmd_max}) {
     $self->log(LOGINFO, "Closing connection. Too many unrecognized commands.");
-    return (DENY_DISCONNECT, "Closing connection. $badcmdcount unrecognized 
commands.  Perhaps you should read RFC 2821?");
+    return (DENY, "Closing connection. $badcmdcount unrecognized commands.  
Perhaps you should read RFC 2821?");
   }
 
   return DECLINED;

Reply via email to