aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-16 13:15:16 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-16 13:15:16 +0100
commit92f71e385436e8b33072fd9ee7638b93129f9551 (patch)
tree14fb4f13488db1e25ceb2da210c85b3e602684d0 /src
parent006ac63208cdba554688083ecd1a5fc4031ba987 (diff)
downloadrspamd-92f71e385436e8b33072fd9ee7638b93129f9551.tar.gz
rspamd-92f71e385436e8b33072fd9ee7638b93129f9551.zip
Restore rspamd -t for compatibility
Diffstat (limited to 'src')
-rw-r--r--src/rspamd.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/rspamd.c b/src/rspamd.c
index 2377f8892..bef6df014 100644
--- a/src/rspamd.c
+++ b/src/rspamd.c
@@ -905,8 +905,34 @@ main (gint argc, gchar **argv, gchar **env)
}
if (rspamd_main->cfg->config_test || dump_cache) {
- rspamd_fprintf (stderr, "use rspamadm configtest for this operation\n");
- exit (EXIT_FAILURE);
+ if (!load_rspamd_config (rspamd_main, rspamd_main->cfg, FALSE)) {
+ exit (EXIT_FAILURE);
+ }
+
+ res = TRUE;
+
+ rspamd_symbols_cache_init (rspamd_main->cfg->cache);
+
+ if (!rspamd_init_filters (rspamd_main->cfg, FALSE)) {
+ res = FALSE;
+ }
+
+ /* Insert classifiers symbols */
+ rspamd_config_insert_classify_symbols (rspamd_main->cfg);
+
+ if (!rspamd_symbols_cache_validate (rspamd_main->cfg->cache,
+ rspamd_main->cfg,
+ FALSE)) {
+ res = FALSE;
+ }
+
+ if (dump_cache) {
+ msg_err_main ("Use rspamc counters for dumping cache");
+ exit (EXIT_FAILURE);
+ }
+
+ fprintf (stderr, "syntax %s\n", res ? "OK" : "BAD");
+ return res ? EXIT_SUCCESS : EXIT_FAILURE;
}
/* Load config */