fix: support database port
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-09-11 13:43:29 +02:00
parent 68e4b27300
commit 8d48d4d458
2 changed files with 7 additions and 3 deletions

View File

@ -15,10 +15,11 @@ use LockFile::Simple qw(lock trylock unlock);
# database backend - uncomment one of these
our $db_type=$ENV{'DATABASE_TYPE'};
our $db_host=$ENV{'DATABASE_HOST'};
our $db_name=$ENV{'DATABASE_NAME'};
our $db_username=$ENV{'DATABASE_USER'};
our $db_password=$ENV{'DATABASE_PASSWORD'};
our $db_host=$ENV{'DATABASE_HOST'};
our $db_port=$ENV{'DATABASE_PORT'};
our $db_name=$ENV{'DATABASE_NAME'};
# instead of changing this script, you can put your settings to /etc/mail/postfixadmin/fetchmail.conf
# just use perl syntax there to fill the variables listed above (without the "our" keyword). Example:
@ -60,7 +61,7 @@ if (-e $configfile) {
}
if($db_type eq "Pg" || $db_type eq "mysql") {
$dsn = "DBI:$db_type:database=$db_name;host=$db_host";
$dsn = "DBI:$db_type:database=$db_name;host=$db_host;port=$db_port";
} else {
log_and_die "unsupported db_type $db_type";
}