public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
[Rspamd] Use redis master for RL operations in pipe_rl
ad55dd8f
data/conf/rspamd/meta_exporter/pipe_rl.php | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
Diff
diff --git a/data/conf/rspamd/meta_exporter/pipe_rl.php b/data/conf/rspamd/meta_exporter/pipe_rl.php
index 036bf881..5f7fd42c 100644
--- a/data/conf/rspamd/meta_exporter/pipe_rl.php
+++ b/data/conf/rspamd/meta_exporter/pipe_rl.php
@@ -7,7 +7,17 @@ require_once "vars.inc.php";
ini_set('error_reporting', 0);
// Init Redis
$redis = new Redis();
-$redis->connect('redis-mailcow', 6379);
+try {
+ if (!empty(getenv('REDIS_SLAVEOF_IP'))) {
+ $redis->connect(getenv('REDIS_SLAVEOF_IP'), getenv('REDIS_SLAVEOF_PORT'));
+ }
+ else {
+ $redis->connect('redis-mailcow', 6379);
+ }
+}
+catch (Exception $e) {
+ exit;
+}
$raw_data_content = file_get_contents('php://input');
$raw_data_decoded = json_decode($raw_data_content, true);