]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Rework includes system in the configuration
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 10 Mar 2016 19:03:51 +0000 (19:03 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 10 Mar 2016 19:03:51 +0000 (19:03 +0000)
25 files changed:
conf/common.conf
conf/composites.conf
conf/metrics.conf
conf/modules.d/chartable.conf
conf/modules.d/dkim.conf
conf/modules.d/dmarc.conf
conf/modules.d/emails.conf
conf/modules.d/forged_recipients.conf
conf/modules.d/fuzzy_check.conf
conf/modules.d/hfilter.conf
conf/modules.d/ip_score.conf
conf/modules.d/maillist.conf
conf/modules.d/mime_types.conf
conf/modules.d/multimap.conf
conf/modules.d/once_received.conf
conf/modules.d/phishing.conf
conf/modules.d/ratelimit.conf
conf/modules.d/rbl.conf
conf/modules.d/rspamd_update.conf
conf/modules.d/spf.conf
conf/modules.d/surbl.conf
conf/modules.d/whitelist.conf
conf/rspamd.systemd.conf
conf/rspamd.sysvinit.conf
conf/statistic.conf

index 50accb406aa0e6a875ddaa7a62524d2cc6c160e4..b6ad9192a62bf7729e07ccfd8dd1268f223471c4 100644 (file)
@@ -10,9 +10,9 @@ lua = "$RULESDIR/rspamd.lua"
 .include "$CONFDIR/modules.conf"
 
 # User local settings
-.include(try=true) "$CONFDIR/rspamd.conf.local"
-.include(try=true,priority=10) "$CONFDIR/rspamd.conf.local.override"
-.include(try=true,priority=10) "$CONFDIR/rspamd.conf.override"
+.include(try=true) "$LOCAL_CONFDIR/rspamd.conf.local"
+.include(try=true,priority=10) "$LOCAL_CONFDIR/rspamd.conf.local.override"
+.include(try=true,priority=10) "$LOCAL_CONFDIR/rspamd.conf.override"
 
 modules {
     path = "$PLUGINSDIR/lua/"
index b964ff80f606729e05a45835dd68f76ad6d412ba..70021a7f024752883b205abac29dcdb2cdc8a78d 100644 (file)
@@ -17,5 +17,5 @@ composite {
     expression = "(-RBL_SPAMHAUS_XBL | -RBL_SPAMHAUS_XBL1 | -RBL_SPAMHAUS_XBL2 | -RBL_SPAMHAUS_XBL3) & RECEIVED_SPAMHAUS_XBL";
 }
 
-.include(try=true; priority=1) "$CONFDIR/local.d/composites.conf"
-.include(try=true; priority=10) "$CONFDIR/override.d/composites.conf"
\ No newline at end of file
+.include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/composites.conf"
+.include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/composites.conf"
\ No newline at end of file
index fb1751fb8661f13e60efbf165f243e4e60749841..b61b28bc20c8fe9484f6bab3175eaa8aada6b822 100644 (file)
@@ -1231,6 +1231,6 @@ metric {
         }
     }
 
-    .include(try=true; priority=1) "$CONFDIR/local.d/metrics.conf"
-    .include(try=true; priority=10) "$CONFDIR/override.d/metrics.conf"
+    .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/metrics.conf"
+    .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/metrics.conf"
 }
index bf454f65aeb0818861701a42d10666f7bbdace95..0f4374fbbadc85a4ef26df836863d746d9352846 100644 (file)
@@ -1,5 +1,7 @@
 chartable {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/forged_recipients.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/chartable.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/chartable.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/chartable.conf"
     threshold = 0.300000;
     symbol = "R_MIXED_CHARSET";
-}
\ No newline at end of file
+}
index e148783ea655de5cde97b399781c3d8cf85e2b8a..189c13346f83e44d6840b46a221521aa103171b8 100644 (file)
@@ -1,8 +1,10 @@
 dkim {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/dkim.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/dkim.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/dkim.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/dkim.conf"
     dkim_cache_size = 2k;
     dkim_cache_expire = 1d;
     time_jitter = 6h;
     trusted_only = false;
     skip_multi = false;
-}
\ No newline at end of file
+}
index df984cfd2036a5f5d27e526d990a9a66372c5a21..fad8c9bf2c71ca45cb127936eef9e8d150d02669 100644 (file)
@@ -1,3 +1,5 @@
 dmarc {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/dmarc.conf"
-}
\ No newline at end of file
+    .include(try=true,priority=5) "${DBDIR}/dynamic/dmarc.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/dmarc.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/dmarc.conf"
+}
index 1adffca85695bcd15e8a6e5736b8bb44ea69a0dd..67263ec24bfad203a880e740c1f4c4fe048f7d75 100644 (file)
@@ -1,3 +1,5 @@
 emails {
-       .include(try=true,priority=1) "${DBDIR}/dynamic/emails.conf"
-}
\ No newline at end of file
+    .include(try=true,priority=5) "${DBDIR}/dynamic/emails.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/emails.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/emails.conf"
+}
index 6f66674b6785813d49f9672e0b9cb39535a44e39..e71d2ee240cde792576bd9fead30a40a346dc70d 100644 (file)
@@ -1,5 +1,7 @@
 forged_recipients {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/forged_recipients.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/forged_recipients.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/forged_recipients.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/forged_recipients.conf"
     symbol_sender = "FORGED_SENDER";
     symbol_rcpt = "FORGED_RECIPIENTS";
-}
\ No newline at end of file
+}
index e3c839cf50091397ee645a75a4c392eae6199814..eb347b6564446a009efef5d6f517e9c414c81e70 100644 (file)
@@ -1,6 +1,8 @@
 fuzzy_check {
     # Include dynamic conf for the rule
-    .include(try=true,priority=1) "${DBDIR}/dynamic/fuzzy_check.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/fuzzy_check.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/fuzzy_check.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/fuzzy_check.conf"
     min_bytes = 100;
     rule {
         servers = "rspamd.com:11335";
index 0d4ee107e71442045442da20734ddec814280566..46cc78cb436289aae8ab61778dbadb782034c736 100644 (file)
@@ -1,5 +1,7 @@
 hfilter {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/hfilter.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/hfilter.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/hfilter.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/hfilter.conf"
     helo_enabled = true;
     hostname_enabled = true;
     url_enabled = true;
index 949aee3331279a8d3bdd503199df26c6da879408..a37eef10045565d5acf689dd25c4fc83fd380853 100644 (file)
@@ -1,9 +1,11 @@
 ip_score {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/ip_score.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/ip_score.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/ip_score.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/ip_score.conf"
 #    servers = "localhost";
 #    treshold = 100;
 #    reject_score = 3;
 #    no_action_score = -2;
 #    add_header_score = 1;
 #    whitelist = "file:///ip_map";
-}
\ No newline at end of file
+}
index f6ee49c70ddebfa2057b433432dd3098487b6d52..59e24ad5db586519cbcaed5c18eadc39fad00232 100644 (file)
@@ -1,4 +1,6 @@
 maillist {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/maillist.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/maillist.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/maillist.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/maillist.conf"
     symbol = "MAILLIST";
-}
\ No newline at end of file
+}
index 4f3eb2e3d72a27d1094bcfd040d3c670520d38c1..fac9aa63b99d1c3e75f0d9ffb9aa93bba57a8994 100644 (file)
@@ -1,4 +1,6 @@
 mime_types {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/mime_types.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/mime_types.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/mime_types.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/mime_types.conf"
     file = "${CONFDIR}/mime_types.inc";
 }
index 4115f67c8b2da8f55533a97f0897d7e1c64b51aa..aeaaef5e56c130c5cae53f078d90c273fe231595 100644 (file)
@@ -1,3 +1,5 @@
 multimap {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/multimap.conf"
-}
\ No newline at end of file
+    .include(try=true,priority=5) "${DBDIR}/dynamic/multimap.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/multimap.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/multimap.conf"
+}
index e0f7cd2b2fd332f0cc3a2c7f14dcfdd957af93bc..84431888e4086a8eacfca20ee3d773e9c5a287b2 100644 (file)
@@ -1,5 +1,7 @@
 once_received {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/once_received.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/once_received.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/once_received.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/once_received.conf"
     good_host = "mail";
     bad_host = "static";
     bad_host = "dynamic";
index 810a0f1b7a770e450cf327d6c2187531088f5ea3..e48b13407a23f325addba61b23200c71207a5005 100644 (file)
@@ -1,4 +1,6 @@
 phishing {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/phishing.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/phishing.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/phishing.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/phishing.conf"
     symbol = "PHISHING";
-}
\ No newline at end of file
+}
index 317957ac48ed4b5b604d3ec142e4cd1621da9e1f..04654840ab0fc68d696aba1991deedfd1384c0de 100644 (file)
@@ -1,5 +1,7 @@
 ratelimit {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/ratelimit.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/ratelimit.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/ratelimit.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/ratelimit.conf"
     rates {
         # Limit for all mail per recipient (burst 100, rate 2 per minute)
         to = [100, 0.033333333];
index bcb47c4842243355f019862cbb85b0176e8b1980..27ecdc229142ae10c0a769a5c67b753f0f0eb995 100644 (file)
@@ -1,5 +1,7 @@
 rbl {
-
+    .include(try=true,priority=5) "${DBDIR}/dynamic/rbl.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/rbl.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/rbl.conf"
     default_from = true;
     default_received = false;
     default_exclude_users = true;
index df5e8e16a8bbb48d31b5aa9659f2d245d621150c..dde2100604ed8b17f17935ccd4fa0dd7e737635e 100644 (file)
@@ -1,5 +1,7 @@
 rspamd_update {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/rspamd_update.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/rspamd_update.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/rspamd_update.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/rspamd_update.conf"
     rules = "sign+http://rspamd.com/update/rspamd-${BRANCH_VERSION}.ucl";
     key = "qxuogdh5eghytji1utkkte1dn3n81c3y5twe61uzoddzwqzuxxyb";
 }
index 3d9a6939eb388fd6404c6f7c953089ec251e194e..d815902057ad9ea440ce78c446a6a87c44d6c845 100644 (file)
@@ -1,5 +1,7 @@
 spf {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/spf.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/spf.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/spf.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/spf.conf"
     spf_cache_size = 2k;
     spf_cache_expire = 1d;
-}
\ No newline at end of file
+}
index 69e500d0aee50c86190a7dfaf073d675083f39f8..bdcdc8f57fc0cafa4b0b4197e3a9c151e034a4aa 100644 (file)
@@ -1,5 +1,7 @@
 surbl {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/surbl.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/surbl.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/surbl.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/surbl.conf"
     whitelist = "file://$CONFDIR/surbl-whitelist.inc";
     exceptions = "file://$CONFDIR/2tld.inc";
 
index e9961292c8433e364b2751f25b8151398707af95..05f18847af28609a706b3bd939a6144ff4517540 100644 (file)
@@ -1,5 +1,7 @@
 whitelist {
-    .include(try=true,priority=1) "${DBDIR}/dynamic/whitelist.conf"
+    .include(try=true,priority=5) "${DBDIR}/dynamic/whitelist.conf"
+    .include(try=true,priority=1) "$LOCAL_CONFDIR/local.d/whitelist.conf"
+    .include(try=true,priority=10) "$LOCAL_CONFDIR/override.d/whitelist.conf"
     rules {
         "WHITELIST_SPF" = {
             valid_spf = true;
@@ -29,4 +31,4 @@ whitelist {
             description = "Mail comes from the whitelisted domain and has valid DMARC and DKIM policies";
         }
     }
-}
\ No newline at end of file
+}
index 4ca52afaf568ff3e5676eed8af451d9eb3a2859f..cf60b7c2118b4898122399a79228125370275fac 100644 (file)
@@ -2,28 +2,28 @@
 
 options {
     .include "$CONFDIR/options.inc"
-    .include(try=true; priority=1) "$CONFDIR/local.d/options.inc"
-    .include(try=true; priority=10) "$CONFDIR/override.d/options.inc"
+    .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/options.inc"
+    .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/options.inc"
 }
 
 logging {
     type = "console";
     systemd = true;
     .include "$CONFDIR/logging.inc"
-    .include(try=true; priority=1) "$CONFDIR/local.d/logging.inc"
-    .include(try=true; priority=10) "$CONFDIR/override.d/logging.inc"
+    .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/logging.inc"
+    .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/logging.inc"
 }
 
 worker {
     bind_socket = "systemd:0";
     .include "$CONFDIR/worker-normal.inc"
-    .include(try=true; priority=1) "$CONFDIR/local.d/worker-normal.inc"
-    .include(try=true; priority=10) "$CONFDIR/override.d/worker-normal.inc"
+    .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/worker-normal.inc"
+    .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-normal.inc"
 }
 
 worker {
     bind_socket = "systemd:1";
     .include "$CONFDIR/worker-controller.inc"
-    .include(try=true; priority=1) "$CONFDIR/local.d/worker-controller.inc"
-    .include(try=true; priority=10) "$CONFDIR/override.d/worker-controller.inc"
+    .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/worker-controller.inc"
+    .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-controller.inc"
 }
index 0360b1a17acf9a3570d4abb053895e608d8cbaee..e24fe89020af8eb1c47d6bbc6b381ebe61662053 100644 (file)
@@ -3,28 +3,28 @@
 options {
     pidfile = "$RUNDIR/rspamd.pid";
     .include "$CONFDIR/options.inc"
-    .include(try=true; priority=1) "$CONFDIR/local.d/options.inc"
-    .include(try=true; priority=10) "$CONFDIR/override.d/options.inc"
+    .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/options.inc"
+    .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/options.inc"
 }
 
 logging {
     type = "file";
     filename = "$LOGDIR/rspamd.log";
     .include "$CONFDIR/logging.inc"
-    .include(try=true; priority=1) "$CONFDIR/local.d/logging.inc"
-    .include(try=true; priority=10) "$CONFDIR/override.d/logging.inc"
+    .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/logging.inc"
+    .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/logging.inc"
 }
 
 worker {
     bind_socket = "*:11333";
     .include "$CONFDIR/worker-normal.inc"
-    .include(try=true; priority=1) "$CONFDIR/local.d/worker-normal.inc"
-    .include(try=true; priority=10) "$CONFDIR/override.d/worker-normal.inc"
+    .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/worker-normal.inc"
+    .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-normal.inc"
 }
 
 worker {
     bind_socket = "localhost:11334";
     .include "$CONFDIR/worker-controller.inc"
-    .include(try=true; priority=1) "$CONFDIR/local.d/worker-controller.inc"
-    .include(try=true; priority=10) "$CONFDIR/override.d/worker-controller.inc"
+    .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/worker-controller.inc"
+    .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-controller.inc"
 }
index 12abd89b07436532022c4106bdc9fb8141a70495..3cc2bfcda0e6eb8dcdf8438ed5867ca6ee1b9211 100644 (file)
@@ -25,6 +25,6 @@ classifier {
         path = "${DBDIR}/bayes.spam.sqlite";
         spam = true;
     }
-    .include(try=true; priority=1) "$CONFDIR/local.d/statistic.conf"
-    .include(try=true; priority=10) "$CONFDIR/override.d/statistic.conf"
+    .include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/statistic.conf"
+    .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/statistic.conf"
 }