improved legal hold feature

This commit is contained in:
SJ 2015-03-29 09:59:41 +02:00
parent 46aec4feb2
commit aaa16d0151
4 changed files with 12 additions and 4 deletions

View File

@ -1 +1 @@
1.1.1
1.2.0-pre1

View File

@ -244,7 +244,7 @@ int purge_messages_round1(struct session_data *sdata, struct __data *data, char
snprintf(update_meta_sql, sizeof(update_meta_sql)-1, "%s", SQL_STMT_DELETE_FROM_META_TABLE);
snprintf(s, sizeof(s)-1, "SELECT `id`, `piler_id`, `size` FROM `%s` WHERE `deleted`=0 AND `retained` < %ld AND %s", SQL_METADATA_TABLE, sdata->now, attachment_condition);
snprintf(s, sizeof(s)-1, "SELECT `id`, `piler_id`, `size` FROM `%s` WHERE `deleted`=0 AND `retained` < %ld AND %s AND id NOT IN (SELECT id FROM `%s` WHERE `to` IN (SELECT email FROM `%s`)) AND id NOT IN (SELECT id FROM `%s` WHERE `from` IN (SELECT email FROM `%s`))", SQL_METADATA_TABLE, sdata->now, attachment_condition, SQL_RECIPIENT_TABLE, SQL_LEGAL_HOLD_TABLE, SQL_METADATA_TABLE, SQL_LEGAL_HOLD_TABLE);
if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "purge sql: *%s*", s);

View File

@ -55,8 +55,9 @@ create index metadata_idx4 on metadata(`bodydigest`);
create index metadata_idx5 on metadata(`deleted`);
create index metadata_idx6 on metadata(`arrived`);
create index metadata_idx7 on metadata(`retained`);
create index metadata_idx8 on metadata(`fromdomain`);
create index metadata_idx9 on metadata(`sent`);
create index metadata_idx8 on metadata(`fromdomain`);
create index metadata_idx9 on metadata(`from`);
create index metadata_idx10 on metadata(`sent`);
create table if not exists `rcpt` (
@ -423,3 +424,9 @@ create table if not exists `autosearch` (
`query` varchar(512) not null
) Engine=InnoDB;
create table if not exists `legal_hold` (
email varchar(128) default not null
) Engine=InnoDB;

View File

@ -9,4 +9,5 @@ alter table retention_rule add column `body` varchar(128) default null;
create unique index `entry` on archiving_rule (`domain`,`from`,`to`,`subject`,`body`,`_size`,`size`,`attachment_name`,`attachment_type`,`_attachment_size`,`attachment_size`,`spam`);
create unique index `entry` on retention_rule (`domain`,`from`,`to`,`subject`,`body`,`_size`,`size`,`attachment_name`,`attachment_type`,`_attachment_size`,`attachment_size`,`spam`);
create index metadata_idx10 on metadata(`from`);