From: Florent Bruneau Date: Mon, 10 Nov 2008 21:44:33 +0000 (+0100) Subject: Add new option 'cleanup_period' to the greylister. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=ab63bac4ae37d7cde03d5b8860533c0de6383a60;p=apps%2Fpfixtools.git Add new option 'cleanup_period' to the greylister. Signed-off-by: Florent Bruneau --- diff --git a/example/postlicyd.conf b/example/postlicyd.conf index dbfb523..61b2c2c 100644 --- a/example/postlicyd.conf +++ b/example/postlicyd.conf @@ -216,6 +216,11 @@ client_whitelist { # - max_age: number (default: 30 * 3600) # lifetime of a greylist/whitelist session: ie, if a client does ne reappear during # max_age seconds, the entries associated to this client are invalidated. +# - cleanup_period: number (default: 86400) +# minimum time between two cleanup of the database. You must keep in mind that cleanup +# is important since it remove useless entries from the database and thus help +# speeding up the lookups. A cleanup can take a few minutes if the database contains +# a lot of entries. # Return value: # - if the client is whitelisted, returns whitelist # - if the client is greylisted, returns greylist diff --git a/postlicyd/data/test.conf b/postlicyd/data/test.conf index 8f4c9a0..f2cc3c4 100644 --- a/postlicyd/data/test.conf +++ b/postlicyd/data/test.conf @@ -130,6 +130,7 @@ greylist1 { retry_window = 4; client_awl = 2; max_age = 8; + cleanup_period = 1; on_greylist = postfix:OK; on_whitelist = postfix:OK; diff --git a/postlicyd/greylist.c b/postlicyd/greylist.c index a7fedc6..7d4f282 100644 --- a/postlicyd/greylist.c +++ b/postlicyd/greylist.c @@ -516,6 +516,7 @@ static bool greylist_filter_constructor(filter_t *filter) FILTER_PARAM_PARSE_INT(CLIENT_AWL, config->client_awl); FILTER_PARAM_PARSE_INT(DELAY, config->delay); FILTER_PARAM_PARSE_INT(MAX_AGE, config->max_age); + FILTER_PARAM_PARSE_INT(CLEANUP_PERIOD, config->cleanup_period); default: break; } @@ -576,6 +577,7 @@ static int greylist_init(void) (void)filter_param_register(type, "retry_window"); (void)filter_param_register(type, "client_awl"); (void)filter_param_register(type, "max_age"); + (void)filter_param_register(type, "cleanup_period"); (void)filter_param_register(type, "path"); (void)filter_param_register(type, "prefix"); return 0;