Compare commits

...

9 Commits

Author SHA1 Message Date
Daniel Berteaud 6d99639d6d Spec file update 2014-06-26 06:53:38 +02:00
Daniel Berteaud 3c7d17a2e5 Define HOME so cron task works on EL6 2014-06-26 06:51:52 +02:00
Daniel Berteaud 432eaa8de8 update spec file 2013-05-15 09:38:00 +02:00
Daniel Berteaud e6b501d606 Only convert to InnoDB if not already done 2013-05-15 09:37:17 +02:00
Daniel Berteaud 52e7d7997c update spec file 2013-04-22 12:16:52 +02:00
Daniel Berteaud 8669325555 Fix a typo in SQL template 2013-04-22 12:16:21 +02:00
Daniel Berteaud c9f983db0d update spec file 2013-04-19 16:41:44 +02:00
Daniel Berteaud 3b05c5c5f6 Alter table to migrate existing databases to InnoDB 2013-04-19 16:40:58 +02:00
Daniel Berteaud f9260644a5 Use InnoDB engine 2013-04-19 14:54:42 +02:00
4 changed files with 29 additions and 5 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash
HOME=/root
LOG=$(/sbin/e-smith/db configuration getprop qpsmtpd Log2Sql || echo 'disabled')
if [ "$LOG" != "enabled" ]; then

View File

@ -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
@ -41,6 +47,10 @@ REPLACE INTO db (
'N', 'Y', 'Y');
FLUSH PRIVILEGES;
USE smtp_log;
$convertInnoDB
EOF
END
}

View File

@ -1,4 +1,4 @@
%define version 0.1.4
%define version 0.1.8
%define release 1
%define name smeserver-qpsmtpd-log2sql
@ -23,6 +23,18 @@ 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
* Fri Apr 19 2013 Daniel Berteaud <daniel@firewall-services.com> 0.1.5-1
- Use InnoDB instead of MyISAM
* Tue Oct 16 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.4-1
- purge old entries from the database
- log headers in a separate table

View File

@ -16,25 +16,25 @@ CREATE TABLE `messages` (
`deny_code` int(11) default '0',
`deny_msg` text,
PRIMARY KEY (`mail_id`)
) TYPE=MyISAM;
) TYPE=InnoDB;
CREATE TABLE `rcpts` (
`rcpt_id` int(11) NOT NULL auto_increment,
`mail_id` varchar(255) NOT NULL default '',
`recipient` varchar(255),
PRIMARY KEY (`rcpt_id`)
) TYPE=MyISAM;
) TYPE=InnoDB;
CREATE TABLE `message_body` (
`bdy_id` int(11) NOT NULL auto_increment,
`mail_id` varchar(255) NOT NULL default '',
`body` text,
PRIMARY KEY (`bdy_id`)
) TYPE=MyISAM;
) TYPE=InnoDB;
CREATE TABLE `message_headers` (
`header_id` int(11) NOT NULL auto_increment,
`mail_id` varchar(255) NOT NULL default '',
`header` text,
PRIMARY KEY (`header_id`)
) TYPE=MyISAM;
) TYPE=InnoDB;