From bc4433b4291db0e22abcde6696c51c6c59ed7214 Mon Sep 17 00:00:00 2001 From: Dominik Meyer Date: Tue, 2 Jan 2024 23:31:35 +0100 Subject: [PATCH] ADD: more tests --- plugins/rcpt_mysql | 8 +++----- plugins/registry.txt | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/rcpt_mysql b/plugins/rcpt_mysql index caa23fc..14e067d 100644 --- a/plugins/rcpt_mysql +++ b/plugins/rcpt_mysql @@ -34,12 +34,10 @@ sub init { sub createDSN { my $self = shift; - - my $dsn = "dbi:MariaDB(RaiseError=>0):database=" . $self->{database} . ";host=" . $self->{host} . ";port=" . $self->{port}; + #my $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port"; + my $dsn = "DBI:mariadb:database=" . $self->{database} . ";host=" . $self->{host} . ";port=" . $self->{port}; $self->{dsn} = $dsn; - $self->log(LOGDEBUG, "created DSN " . $self->{dsn}); - # try to parse the dsn to ensure it is valid my @data = DBI->parse_dsn($self->{dsn}); @@ -49,6 +47,7 @@ sub createDSN $self->{dsn}=""; } + $self->log(LOGDEBUG, "created DSN " . $self->{dsn}); } sub createQuery @@ -197,7 +196,6 @@ sub askDatabase } my $dsn = $self->{dsn}; - my $dbh = DBI::connect($dsn, $self->{user}, $self->{pass},{ RaiseError => 1, PrintError => 0 }); if ($dbh->err()) diff --git a/plugins/registry.txt b/plugins/registry.txt index 872a239..6e3b4d8 100644 --- a/plugins/registry.txt +++ b/plugins/registry.txt @@ -55,6 +55,8 @@ 605 rcpt_ok rok rcpok 608 bogus_bounce bog bogus check_bogus_bounce 609 greylisting gry greyl +610 rcpt_mysql rmy rcmys + # # Content Filters #