From 57b0c1d650d833be7fc1c5a7e327d18b1ef0d1dd Mon Sep 17 00:00:00 2001 From: SJ Date: Tue, 24 Jan 2012 17:18:59 +0100 Subject: [PATCH] fixed a bug in the counter sql statement --- README | 43 +++++++++++++++++++++++++++++++++++++++++-- src/counters.c | 8 ++++---- 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/README b/README index 84402067..10fb75c9 100644 --- a/README +++ b/README @@ -2,10 +2,44 @@ piler is an open source email archival application. Features: -- ... +- built-in smtp server +- clamd support +- archival rules +- retention rules +- legal hold +- message and attachment deduplication +- message compression +- message encryption +- digital fingerprinting and verification + +- full text search +- simple and advanced search +- save search criteria +- tagging emails +- view, export, restore emails + +- bulk import/export messages + +- access control + +- AD / LDAP authentication + +- i18n +- customisable theme + +- audit logs +- search in audit logs + +- online status info + +- recognised formats: PST, EML, Maildir, mailbox -locales debian alatt: dpkg-reconfigure locales + + + + +locales under debian: dpkg-reconfigure locales init: @@ -16,3 +50,8 @@ init: indexer delta1 --rotate indexer --merge main1 delta1 --rotate --merge-dst-range deleted 0 0 + + +Enron dataset: http://www.cs.cmu.edu/~enron/ + + diff --git a/src/counters.c b/src/counters.c index 75dc2359..9ea28e96 100644 --- a/src/counters.c +++ b/src/counters.c @@ -16,7 +16,7 @@ struct __counters loadCounters(struct session_data *sdata, struct __config *cfg) bzero(&counters, sizeof(counters)); - snprintf(buf, SMALLBUFSIZE-1, "SELECT rcvd, virus, duplicate, ignore FROM %s", SQL_COUNTER_TABLE); + snprintf(buf, SMALLBUFSIZE-1, "SELECT `rcvd`, `virus`, `duplicate`, `ignore` FROM `%s`", SQL_COUNTER_TABLE); #ifdef NEED_MYSQL MYSQL_RES *res; @@ -79,8 +79,8 @@ void update_counters(struct session_data *sdata, struct __data *data, struct __c if(sdata->now - mc > cfg->memcached_to_db_interval && c.c_rcvd > 0 && c.c_rcvd >= rcvd){ snprintf(buf, SMALLBUFSIZE-1, "%ld", sdata->now); memcached_set(&(data->memc), MEMCACHED_COUNTERS_LAST_UPDATE, strlen(MEMCACHED_COUNTERS_LAST_UPDATE), buf, strlen(buf), 0, 0); - snprintf(buf, SMALLBUFSIZE-1, "UPDATE `%s` SET rcvd=%llu, virus=%llu, duplicate=%llu, ignore=%llu", SQL_COUNTER_TABLE, c.c_rcvd, c.c_virus, c.c_duplicate, c.c_ignore); - + snprintf(buf, SMALLBUFSIZE-1, "UPDATE `%s` SET `rcvd`=%llu, `virus`=%llu, `duplicate`=%llu, `ignore`=%llu", SQL_COUNTER_TABLE, c.c_rcvd, c.c_virus, c.c_duplicate, c.c_ignore); + //if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "%s: update counters: %s", sdata->ttmpfile, buf); goto EXEC_SQL; @@ -103,7 +103,7 @@ void update_counters(struct session_data *sdata, struct __data *data, struct __c } else { #endif - snprintf(buf, SMALLBUFSIZE-1, "UPDATE `%s` SET rcvd=rcvd+%llu, virus=virus+%llu, duplicate=duplicate+%llu, ignore=ignore+%llu", SQL_COUNTER_TABLE, counters->c_rcvd, counters->c_virus, counters->c_duplicate, counters->c_ignore); + snprintf(buf, SMALLBUFSIZE-1, "UPDATE `%s` SET `rcvd`=`rcvd`+%llu, `virus`=`virus`+%llu, `duplicate`=`duplicate`+%llu, `ignore`=`ignore`+%llu", SQL_COUNTER_TABLE, counters->c_rcvd, counters->c_virus, counters->c_duplicate, counters->c_ignore); //if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "%s: update counters: %s", sdata->ttmpfile, buf);