Use perl to read env vars

Extended $imapssl, $imaptls, $tlsverify to read env, with default values
This commit is contained in:
Sean Pearce 2019-01-03 10:58:15 -08:00
parent 7c6f81671b
commit 00621c10e3

View File

@ -8,26 +8,26 @@
$debug = 0;
$delete_reports = 0;
$dbname = '$$_REPORT_DB_NAME_$$';
$dbuser = '$$_REPORT_DB_USER_$$';
$dbpass = '$$_REPORT_DB_PASS_$$';
$dbhost = '$$_REPORT_DB_HOST_$$'; # Set the hostname if we can't connect to the local socket.
$dbname = $ENV{'REPORT_DB_NAME'};
$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.
$imapserver = '$$_PARSER_IMAP_SERVER_WITH_PORT_$$';
$imapuser = '$$_PARSER_IMAP_USER_$$';
$imappass = '$$_PARSER_IMAP_PASS_$$';
$imapssl = '0'; # If set to 1, remember to change server port to 993 and disable imaptls.
$imaptls = '1'; # Enabled as the default and best-practice.
$tlsverify = '0'; # Enable verify server cert as the default and best-practice.
$imapserver = $ENV{'PARSER_IMAP_SERVER_WITH_PORT'};
$imapuser = $ENV{'PARSER_IMAP_USER'};
$imappass = $ENV{'PARSER_IMAP_PASS'};
$imapssl = $ENV{'PARSER_IMAP_SSL'} // '0'; # If set to 1, remember to change server port to 993 and disable imaptls.
$imaptls = $ENV{'PARSER_IMAP_TLS'} // '1'; # Enabled as the default and best-practice.
$tlsverify = $ENV{'PARSER_IMAP_VERIFY'} // '0'; # Enable verify server cert as the default and best-practice.
$imapignoreerror = 0; # set it to 1 if you see an "ERROR: message_string()
# expected 119613 bytes but received 81873 you may
# need the IgnoreSizeErrors option" because of malfunction
# imap server as MS Exchange 2007, ...
$imapreadfolder = '$$_PARSER_IMAP_READ_FOLDER_$$';
$imapreadfolder = $ENV{'PARSER_IMAP_READ_FOLDER'};
# If $imapmovefolder is set, processed IMAP messages will be moved (overruled by
# the --delete option!)
$imapmovefolder = '$$_PARSER_IMAP_MOVE_FOLDER_$$';
$imapmovefolder = $ENV{'PARSER_IMAP_MOVE_FOLDER'};
# maximum size of XML files to store in database, long files can cause transaction aborts
$maxsize_xml = 50000;