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
224 stars 65 forks source link

CentOS 7 - The script cannot parse a config in the same folder #48

Closed SeLLeRoNe closed 6 years ago

SeLLeRoNe commented 6 years ago

Hi everyone, I have a strange issue today. I had to re-install the server so I did chose to install CentOS 7 instead of the previously installed CentOS 6 and I am having a strange issue.

I did restore the DMARC Parser from a backup and now the script cannot "see" the configuration file which is in the same folder with the same name as before the new installation.

I have checked all the pre-requisites and all the packages are already there.

Here some details:

>yum install perl-Mail-IMAPClient perl-MIME-tools perl-XML-Simple perl-DBI  perl-Socket6 perl-PerlIO-gzip perl-DBD-MySQL unzip perl-Mail-Mbox-MessageParser
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.crazynetwork.it
 * epel: mirror.23media.de
 * extras: mirror.crazynetwork.it
 * rpmforge: mirror.de.leaseweb.net
 * updates: mirror.crazynetwork.it
Package perl-Mail-IMAPClient-3.37-1.el7.noarch already installed and latest version
Package perl-MIME-tools-5.505-1.el7.noarch already installed and latest version
Package perl-XML-Simple-2.20-5.el7.noarch already installed and latest version
Package perl-DBI-1.627-4.el7.x86_64 already installed and latest version
Package perl-Socket6-0.23-15.el7.x86_64 already installed and latest version
Package perl-PerlIO-gzip-0.19-1.el7.x86_64 already installed and latest version
Package perl-DBD-MySQL-4.023-5.el7.x86_64 already installed and latest version
Package unzip-6.0-16.el7.x86_64 already installed and latest version
Package perl-Mail-Mbox-MessageParser-1.5002-15.el7.noarch already installed and latest version
Nothing to do
>ls -l
total 36
-rw------- 1 dmarc dmarc  1973 Feb  3 14:22 dmarcts-report-parser.conf
-rwx------ 1 dmarc dmarc 29414 Feb  2 13:28 dmarcts-report-parser.pl
>./dmarcts-report-parser.pl

 Usage:
    ./dmarcts-report-parser.pl [OPTIONS] [PATH]

 This script needs a configuration file called <dmarcts-report-parser.conf> in
 the current working directory, which defines a database server with credentials
 and (if used) an IMAP server with credentials.

 Additionaly, one of the following source options must be provided:
        -i : Read reports from messages on IMAP server as defined in the
             config file.
        -m : Read reports from mbox file(s) provided in PATH.
        -e : Read reports from MIME email file(s) provided in PATH.
        -x : Read reports from xml file(s) provided in PATH.

 The following optional options are allowed:
        -d : Print debug info.
        -r : Replace existing reports rather than skipping them.
  --delete : Delete processed message files (the XML is stored in the
             database for later reference).

Please provide a source option (-i, -x, -m or -e).

>head -10 dmarcts-report-parser.conf
################################################################################
### configuration ##############################################################
################################################################################

# If IMAP access is not used, config options starting with $imap do not need to
# be set and are ignored.

$debug = 0;
$delete_reports = 0;

So, packages are there, the script doesn't seems to be able to find the config, the config is there and data are inside the config.

Do you have any idea on what I can do more? :D I also thought to pass the configuration file to the command line with a full path but I don't see any option that allow me to do that.

Thanks Best regards Andrea

SeLLeRoNe commented 6 years ago

Nevermind, I must be drunk or something... I had to pass -i to start the process.. strange thing I did not use that before.. but I figured it out, I was using another parser before that didn't need the -i (or an older versioin maybe?)

Anyway, I will close this ticket now.

Thanks