diff -ur qpsmtpd-dist/lib/Qpsmtpd/Auth.pm qpsmtpd/lib/Qpsmtpd/Auth.pm
--- qpsmtpd-dist/lib/Qpsmtpd/Auth.pm	2006-02-26 07:22:16.000000000 -0500
+++ qpsmtpd/lib/Qpsmtpd/Auth.pm	2006-09-20 04:17:01.000000000 -0400
@@ -287,7 +287,8 @@
         ( $user, $passHash ) = split( ' ', decode_base64($line) );
     }
     else {
-        $session->respond( 500, "Unrecognized authentification mechanism" );
+        #this error is now caught in SMTP.pm's sub auth
+        $session->respond( 500, "Internal server error" );
         return DECLINED;
     }
 
diff -ur qpsmtpd-dist/lib/Qpsmtpd/SMTP.pm qpsmtpd/lib/Qpsmtpd/SMTP.pm
--- qpsmtpd-dist/lib/Qpsmtpd/SMTP.pm	2006-02-26 07:22:16.000000000 -0500
+++ qpsmtpd/lib/Qpsmtpd/SMTP.pm	2006-09-20 04:20:07.000000000 -0400
@@ -213,6 +213,7 @@
     if ( %auth_mechanisms ) {
         push @capabilities, 'AUTH '.join(" ",keys(%auth_mechanisms));    
         $self->{_commands}->{'auth'} = "";
+        @{$self->{_auth_mechanisms}} = keys %auth_mechanisms;
     }
 
     $self->respond(250,
@@ -235,7 +236,14 @@
     return $self->respond( 503, "AUTH not defined for HELO" )
       if ( $self->connection->hello eq "helo" );
 
-    return $self->{_auth} = Qpsmtpd::Auth::SASL( $self, $arg, @stuff );
+    # if we don't have a plugin implementing this auth mechanism, 504
+    if(grep(/^$arg$/i, @{$self->{_auth_mechanisms}})) {
+      return $self->{_auth} = Qpsmtpd::Auth::SASL( $self, $arg, @stuff );
+    } else {
+      $self->respond( 504, "Unimplemented authentification mechanism: $arg" );
+      return DENY;
+    } 
+
 }
 
 sub mail {
