Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Daniel Berteaud | 6d99639d6d | |
Daniel Berteaud | 3c7d17a2e5 | |
Daniel Berteaud | 432eaa8de8 | |
Daniel Berteaud | e6b501d606 |
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
HOME=/root
|
||||
|
||||
LOG=$(/sbin/e-smith/db configuration getprop qpsmtpd Log2Sql || echo 'disabled')
|
||||
|
||||
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 $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";
|
||||
#! /bin/sh
|
||||
if [ ! -d /var/lib/mysql/$db ]; then
|
||||
|
@ -43,11 +49,7 @@ REPLACE INTO db (
|
|||
FLUSH PRIVILEGES;
|
||||
|
||||
USE smtp_log;
|
||||
|
||||
ALTER TABLE messages ENGINE=InnoDB;
|
||||
ALTER TABLE message_headers ENGINE=InnoDB;
|
||||
ALTER TABLE message_body ENGINE=InnoDB;
|
||||
ALTER TABLE rcpts ENGINE=InnoDB;
|
||||
$convertInnoDB
|
||||
|
||||
EOF
|
||||
END
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
%define version 0.1.6
|
||||
%define version 0.1.8
|
||||
%define release 1
|
||||
%define name smeserver-qpsmtpd-log2sql
|
||||
|
||||
|
@ -23,6 +23,12 @@ Requires: perl(DBI)
|
|||
Log every smtp transaction in a database
|
||||
|
||||
%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
|
||||
|
||||
|
|
Loading…
Reference in New Issue