Add new option 'cleanup_period' to the greylister.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 10 Nov 2008 21:44:33 +0000 (22:44 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 10 Nov 2008 21:44:33 +0000 (22:44 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
example/postlicyd.conf
postlicyd/data/test.conf
postlicyd/greylist.c

index dbfb523..61b2c2c 100644 (file)
@@ -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
index 8f4c9a0..f2cc3c4 100644 (file)
@@ -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;
index a7fedc6..7d4f282 100644 (file)
@@ -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;