Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6d99639d6d | ||
|
3c7d17a2e5 | ||
|
432eaa8de8 | ||
|
e6b501d606 | ||
|
52e7d7997c | ||
|
8669325555 |
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
HOME=/root
|
||||||
|
|
||||||
LOG=$(/sbin/e-smith/db configuration getprop qpsmtpd Log2Sql || echo 'disabled')
|
LOG=$(/sbin/e-smith/db configuration getprop qpsmtpd Log2Sql || echo 'disabled')
|
||||||
|
|
||||||
if [ "$LOG" != "enabled" ]; then
|
if [ "$LOG" != "enabled" ]; then
|
||||||
|
|
|
@ -5,6 +5,12 @@ my $pass = ${'qpsmtpd'}{'DbPassword'} || 'secret';
|
||||||
|
|
||||||
my $dbstruct = `rpm -qd smeserver-qpsmtpd-log2sql | grep smtp_log.sql`;
|
my $dbstruct = `rpm -qd smeserver-qpsmtpd-log2sql | grep smtp_log.sql`;
|
||||||
|
|
||||||
|
my $convertInnoDB = '';
|
||||||
|
foreach my $table qw(messages message_headers message_body rcpts){
|
||||||
|
$convertInnoDB .= "ALTER TABLE $table ENGINE=InnoDB;\n"
|
||||||
|
if (-e "/var/lib/mysql/$db/$table.MYD");
|
||||||
|
}
|
||||||
|
|
||||||
$OUT .= <<"END";
|
$OUT .= <<"END";
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
if [ ! -d /var/lib/mysql/$db ]; then
|
if [ ! -d /var/lib/mysql/$db ]; then
|
||||||
|
@ -43,11 +49,7 @@ REPLACE INTO db (
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
|
|
||||||
USE smtp_log;
|
USE smtp_log;
|
||||||
|
$convertInnoDB
|
||||||
ALTER TABLE messages ENGINE=InnodDB;
|
|
||||||
ALTER TABLE message_headers ENGINE=InnodDB;
|
|
||||||
ALTER TABLE message_body ENGINE=InnodDB;
|
|
||||||
ALTER TABLE rcpts ENGINE=InnodDB;
|
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
END
|
END
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%define version 0.1.5
|
%define version 0.1.8
|
||||||
%define release 1
|
%define release 1
|
||||||
%define name smeserver-qpsmtpd-log2sql
|
%define name smeserver-qpsmtpd-log2sql
|
||||||
|
|
||||||
|
@ -23,6 +23,15 @@ Requires: perl(DBI)
|
||||||
Log every smtp transaction in a database
|
Log every smtp transaction in a database
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jun 26 2014 Daniel Berteaud <daniel@firewall-services.com> 0.1.8-1
|
||||||
|
- Define HOME in cron task so it works on EL6
|
||||||
|
|
||||||
|
* Wed May 15 2013 Daniel Berteaud <daniel@firewall-services.com> 0.1.7-1
|
||||||
|
- Only convert to InnoDB if not already done
|
||||||
|
|
||||||
|
* Mon Apr 22 2013 Daniel Berteaud <daniel@firewall-services.com> 0.1.6-1
|
||||||
|
- Fix a typo in MySQL template
|
||||||
|
|
||||||
* Fri Apr 19 2013 Daniel Berteaud <daniel@firewall-services.com> 0.1.5-1
|
* Fri Apr 19 2013 Daniel Berteaud <daniel@firewall-services.com> 0.1.5-1
|
||||||
- Use InnoDB instead of MyISAM
|
- Use InnoDB instead of MyISAM
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user