Skip to content
This repository was archived by the owner on Jan 27, 2024. It is now read-only.

Commit c236dc8

Browse files
author
shawniverson
committed
Fix database build failures
1 parent 4a004e7 commit c236dc8

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

build/MYSQL/create.sql

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ CREATE TABLE IF NOT EXISTS `maillog` (
124124
`time` time DEFAULT NULL,
125125
`headers` mediumtext COLLATE utf8_unicode_ci,
126126
`quarantined` tinyint(1) DEFAULT '0',
127+
`rblspamreport` mediumtext COLLATE utf8_unicode_ci DEFAULT NULL,
128+
`token` CHAR(64) COLLATE utf8_unicode_ci DEFAULT NULL,
127129
PRIMARY KEY (`maillog_id`),
128130
KEY `maillog_datetime_idx` (`date`,`time`),
129131
KEY `maillog_id_idx` (`id`(20)),
@@ -134,8 +136,8 @@ CREATE TABLE IF NOT EXISTS `maillog` (
134136
KEY `from_domain_idx` (`from_domain`(50)),
135137
KEY `to_domain_idx` (`to_domain`(50)),
136138
KEY `maillog_quarantined` (`quarantined`),
137-
KEY `timestamp_idx` (`timestamp`),
138-
FULLTEXT KEY `subject_idx` (`subject`)
139+
KEY `timestamp_idx` (`timestamp`)
140+
/*!50604 , FULLTEXT KEY `subject_idx` (`subject`) */
139141
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
140142

141143
-- --------------------------------------------------------
@@ -258,6 +260,9 @@ CREATE TABLE IF NOT EXISTS `users` (
258260
`resetid` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
259261
`resetexpire` bigint(20) COLLATE utf8_unicode_ci DEFAULT NULL,
260262
`lastreset` bigint(20) COLLATE utf8_unicode_ci DEFAULT NULL,
263+
`login_expiry` bigint(20) COLLATE utf8_unicode_ci DEFAULT '-1',
264+
`last_login` bigint(20) COLLATE utf8_unicode_ci DEFAULT '-1',
265+
`login_timeout` smallint(5) COLLATE utf8_unicode_ci DEFAULT '-1',
261266
PRIMARY KEY (`username`)
262267
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
263268

build/build.bash

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,10 +763,9 @@ EOF
763763
rm -rf docs
764764

765765
cp conf.php.example conf.php
766-
# Issue #66 grab all passwords from EFA-Config
767-
sed -i "/^define('DB_PASS',/ c\$efa_config = preg_grep('/^MAILWATCHSQLPWD/', file('/etc/EFA-Config'));\nforeach(\$efa_config as \$num => \$line) {\n if (\$line) {\n \$db_pass_tmp = chop(preg_replace('/^MAILWATCHSQLPWD:(.*)/','\$1', \$line));\n }\n}\ndefine('DB_PASS', \$db_pass_tmp);" conf.php
766+
# Issue #66 grab all passwords from EFA-Config
768767
sed -i "/^define('DB_USER',/ c\define('DB_USER', 'mailwatch');" conf.php
769-
#sed -i "/^define('DB_PASS',/ c\define('DB_PASS', '$password');" conf.php
768+
sed -i "/^define('DB_PASS',/ c\define('DB_PASS', '$password');" conf.php
770769
sed -i "/^define('TIME_ZONE',/ c\define('TIME_ZONE', 'Etc/UTC');" conf.php
771770
sed -i "/^define('QUARANTINE_USE_FLAG',/ c\define('QUARANTINE_USE_FLAG', true);" conf.php
772771
sed -i "/^define('QUARANTINE_REPORT_FROM_NAME',/ c\define('QUARANTINE_REPORT_FROM_NAME', 'EFA - Email Filter Appliance');" conf.php
@@ -846,6 +845,9 @@ EOF
846845

847846
/usr/bin/php /usr/src/EFA/MailWatch-$MAILWATCHBRANCH/upgrade.php --skip-user-confirm /var/www/html/mailscanner/functions.php
848847

848+
# Update conf.php to grab password from EFA-Config after running upgrade.php
849+
sed -i "/^define('DB_PASS',/ c\$efa_config = preg_grep('/^MAILWATCHSQLPWD/', file('/etc/EFA-Config'));\nforeach(\$efa_config as \$num => \$line) {\n if (\$line) {\n \$db_pass_tmp = chop(preg_replace('/^MAILWATCHSQLPWD:(.*)/','\$1', \$line));\n }\n}\ndefine('DB_PASS', \$db_pass_tmp);" /var/www/html/mailscanner/conf.php
850+
849851
# Issue #308 ClamAV Status Page blank
850852
usermod apache -G mtagroup
851853

0 commit comments

Comments
 (0)