gutmensch / docker-dmarc-report

211 stars 23 forks source link

Switching to pgsql isn't working #28

Closed madman-sf closed 1 year ago

madman-sf commented 1 year ago

Switching to psql isnt working the repo https://github.com/techsneeze/dmarcts-report-parser/blob/master/dmarcts-report-parser.conf.sample#L11 uses Pg as identifier for the type and not pgsql like in the repo of the viewer

attached is a patch. to get it fixed

diff --git a/manifest/usr/bin/dmarcts-report-parser.conf b/manifest/usr/bin/dmarcts-report-parser.conf
index 12bd5de..7bc8616 100644
--- a/manifest/usr/bin/dmarcts-report-parser.conf
+++ b/manifest/usr/bin/dmarcts-report-parser.conf
@@ -13,7 +13,7 @@ $dbuser = $ENV{'REPORT_DB_USER'};
 $dbpass = $ENV{'REPORT_DB_PASS'};
 $dbhost = $ENV{'REPORT_DB_HOST'}; # Set the hostname if we can't connect to the local socket.
 $dbport = $ENV{'REPORT_DB_PORT'} || 3306;
-$dbtype = $ENV{'REPORT_DB_TYPE'} || 'mysql';
+$dbtype = $ENV{'REPORT_DB_TYPE'} eq 'pgsql' ? 'Pg' : $ENV{'REPORT_DB_TYPE'} || 'mysql';

 if(exists $ENV{PARSER_IMAP_SERVER_WITH_PORT} && defined $ENV{PARSER_IMAP_SERVER_WITH_PORT}) {
   my @server_attr  = split ':', $ENV{PARSER_IMAP_SERVER_WITH_PORT};
madman-sf commented 1 year ago

haha just found out how to create a PR https://github.com/gutmensch/docker-dmarc-report/pull/29