develooper Front page | perl.cvs.qpsmtpd | Postings from January 2006

[svn:qpsmtpd] r608 - trunk/plugins/auth

From:
jpeacock
Date:
January 27, 2006 13:13
Subject:
[svn:qpsmtpd] r608 - trunk/plugins/auth
Message ID:
20060127211344.17708.qmail@x1.develooper.com
Author: jpeacock
Date: Fri Jan 27 13:13:43 2006
New Revision: 608

Modified:
   trunk/plugins/auth/auth_vpopmail_sql
Log:
Make DBI->connect() failure more obvious, but don't prevent mail 
being sent by other rules (if the client will fall back).

Modified: trunk/plugins/auth/auth_vpopmail_sql
==============================================================================
--- trunk/plugins/auth/auth_vpopmail_sql	(original)
+++ trunk/plugins/auth/auth_vpopmail_sql	Fri Jan 27 13:13:43 2006
@@ -60,7 +60,8 @@ sub authsql {
     use DBI;
     use Qpsmtpd::Constants;
     use Digest::HMAC_MD5 qw(hmac_md5_hex);
-
+    my ( $self, $transaction, $method, $user, $passClear, $passHash, $ticket )
+    	= @_; 
 #    $DB::single = 1;
 
     my $connect  = "dbi:mysql:dbname=vpopmail";
@@ -69,10 +70,11 @@ sub authsql {
 
     my $dbh = DBI->connect( $connect, $dbuser, $dbpasswd, 
     	{ PrintError => 0, } )
-    	or return DECLINED;
+    	or (
+	    $self->log(LOGERROR, $DBI::errstr)
+	    and return DECLINED
+	);
 
-    my ( $self, $transaction, $method, $user, $passClear, $passHash, $ticket ) =
-      @_;
     my ( $pw_name, $pw_domain ) = split "@", lc($user);
 
     unless ( defined $pw_domain ) {



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