techsneeze / dmarcts-report-parser

A Perl based tool to parse DMARC reports from an IMAP mailbox or from the filesystem, and insert the information into a database. ( Formerly known as imap-dmarcts )
http://www.techsneeze.com/how-parse-dmarc-reports-imap/
GNU General Public License v3.0
223 stars 62 forks source link

Make it easier to connect to a local socket #111

Open dirkx opened 1 year ago

dirkx commented 1 year ago

Currently it is a bit hard to default to a socket connection (e.g. if he DB is local and not TCP reachable).

Below change to line 776 makes this easier.

Ta!

    my $dsn = "DBI:$dbtype:database=$dbname";
    $dsn .= ";host=$dbhost" if length($dbhost);
    $dsn .= ";port=$dbport" if length($dbport);

    my $dbh = DBI->connect($dsn,$dbuser, $dbpass)
            or die "$scriptname: Cannot connect to database\n";