From fa576db63fb43d41bd1fa17fb58afa2a99e45f05 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Mon, 15 Sep 2008 18:23:12 +0200 Subject: [PATCH] More logs in greylister... need tests. Signed-off-by: Florent Bruneau --- postlicyd/filter.c | 4 ++-- postlicyd/greylist.c | 5 ++++- postlicyd/main-postlicyd.c | 8 ++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/postlicyd/filter.c b/postlicyd/filter.c index aadc58c..7b0dee3 100644 --- a/postlicyd/filter.c +++ b/postlicyd/filter.c @@ -49,7 +49,7 @@ filter_type_t filter_register(const char *type, filter_constructor_t constructor filter_token tok = filter_tokenize(type, m_strlen(type)); CHECK_FILTER(tok); - syslog(LOG_INFO, "filter type %s registered", type); + syslog(LOG_DEBUG, "filter type %s registered", type); runners[tok] = runner; constructors[tok] = constructor; @@ -64,7 +64,7 @@ filter_result_t filter_hook_register(filter_type_t filter, CHECK_FILTER(filter); CHECK_HOOK(tok); - syslog(LOG_INFO, "hook %s registered for filter type %s", name, + syslog(LOG_DEBUG, "hook %s registered for filter type %s", name, ftokens[filter]); hooks[filter][tok] = true; diff --git a/postlicyd/greylist.c b/postlicyd/greylist.c index 108b02b..b5dcb7b 100644 --- a/postlicyd/greylist.c +++ b/postlicyd/greylist.c @@ -78,8 +78,8 @@ static bool greylist_initialize(greylist_config_t *config, if (!tcbdbopen(config->awl_db, path, BDBOWRITER | BDBOCREAT)) { tcbdbdel(config->awl_db); config->awl_db = NULL; + return false; } - return false; } snprintf(path, sizeof(path), "%s/%sgreylist.db", directory, prefix); @@ -216,6 +216,7 @@ static bool try_greylist(const greylist_config_t *config, /* OK. */ + syslog(LOG_INFO, "client whitelisted"); return true; } } @@ -259,11 +260,13 @@ static bool try_greylist(const greylist_config_t *config, /* OK */ + syslog(LOG_INFO, "client whitelisted"); return true; } /* DUNNO */ + syslog(LOG_INFO, "client greylisted"); return false; } diff --git a/postlicyd/main-postlicyd.c b/postlicyd/main-postlicyd.c index ad61029..a4241ff 100644 --- a/postlicyd/main-postlicyd.c +++ b/postlicyd/main-postlicyd.c @@ -277,6 +277,10 @@ int main(int argc, char *argv[]) || start_listener(port) < 0) { return EXIT_FAILURE; } - return server_loop(query_starter, (delete_client_t)query_delete, - policy_run, NULL); + { + int res = server_loop(query_starter, (delete_client_t)query_delete, + policy_run, config); + config_delete(&config); + return res; + } } -- 2.20.1