diff --git a/plugins/auth/auth_vpopmail_sql b/plugins/auth/auth_vpopmail_sql index b561cd3..4c1d6a1 100644 --- a/plugins/auth/auth_vpopmail_sql +++ b/plugins/auth/auth_vpopmail_sql @@ -94,8 +94,11 @@ sub get_db_handle { my $dbuser = $self->qp->config("vpopmail_mysql_user") || "vpopmailuser"; my $dbpass = $self->qp->config("vpopmail_mysql_pass") || "vpoppasswd"; - my $dbh = DBI->connect($dsn, $dbuser, $dbpass) or do { - $self->log(LOGERROR, "skip: db connection failed"); + my $dbh; + eval { $dbh = DBI->connect($dsn, $dbuser, $dbpass); }; + if (!$dbh) { + $self->log(LOGERROR, "skip: db connection failed: $!"); + $self->log(LOGERROR, $@) if $@; return; }; $dbh->{ShowErrorStatement} = 1;