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: disable greylisting for forwarding hosts
a4ccd780
data/conf/rspamd/dynmaps/forwardinghosts.php | 31 +++++++++++++++++++---------
data/conf/rspamd/local.d/greylist.conf | 1 +
2 files changed, 22 insertions(+), 10 deletions(-)
create mode 100644 data/conf/rspamd/local.d/greylist.conf
Diff
diff --git a/data/conf/rspamd/dynmaps/forwardinghosts.php b/data/conf/rspamd/dynmaps/forwardinghosts.php
index cbc82ee7..522a21f9 100644
--- a/data/conf/rspamd/dynmaps/forwardinghosts.php
+++ b/data/conf/rspamd/dynmaps/forwardinghosts.php
@@ -28,17 +28,28 @@ function in_net($addr, $net) {
return substr($addr_bin, 0, $mask) == substr($net_bin, 0, $mask);
}
-try {
- foreach ($redis->hGetAll('WHITELISTED_FWD_HOST') as $host => $source) {
- if (in_net($_GET['host'], $host)) {
- echo '200 PERMIT';
- exit;
+if (isset($_GET['host'])) {
+ try {
+ foreach ($redis->hGetAll('WHITELISTED_FWD_HOST') as $host => $source) {
+ if (in_net($_GET['host'], $host)) {
+ echo '200 PERMIT';
+ exit;
+ }
}
+ echo '200 DUNNO';
+ }
+ catch (RedisException $e) {
+ echo '200 DUNNO';
+ exit;
+ }
+} else {
+ try {
+ foreach ($redis->hGetAll('WHITELISTED_FWD_HOST') as $host => $source) {
+ echo $host . "\n";
+ }
+ }
+ catch (RedisException $e) {
+ exit;
}
- echo '200 DUNNO';
-}
-catch (RedisException $e) {
- echo '200 DUNNO';
- exit;
}
?>
diff --git a/data/conf/rspamd/local.d/greylist.conf b/data/conf/rspamd/local.d/greylist.conf
new file mode 100644
index 00000000..9acf6f28
--- /dev/null
+++ b/data/conf/rspamd/local.d/greylist.conf
@@ -0,0 +1 @@
+whitelisted_ip = "http://172.22.1.251:8081/forwardinghosts.php";