Merge pull request #666 from mkuron/greylist
rspamd: fully disable greylisting for forwarding hosts
This commit is contained in:
		@@ -28,17 +28,28 @@ function in_net($addr, $net) {
 | 
				
			|||||||
  return substr($addr_bin, 0, $mask) == substr($net_bin, 0, $mask);
 | 
					  return substr($addr_bin, 0, $mask) == substr($net_bin, 0, $mask);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
try {
 | 
					if (isset($_GET['host'])) {
 | 
				
			||||||
  foreach ($redis->hGetAll('WHITELISTED_FWD_HOST') as $host => $source) {
 | 
					  try {
 | 
				
			||||||
    if (in_net($_GET['host'], $host)) {
 | 
					    foreach ($redis->hGetAll('WHITELISTED_FWD_HOST') as $host => $source) {
 | 
				
			||||||
      echo '200 PERMIT';
 | 
					      if (in_net($_GET['host'], $host)) {
 | 
				
			||||||
      exit;
 | 
					        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";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  echo '200 DUNNO';
 | 
					  catch (RedisException $e) {
 | 
				
			||||||
}
 | 
					    exit;
 | 
				
			||||||
catch (RedisException $e) {
 | 
					  }
 | 
				
			||||||
  echo '200 DUNNO';
 | 
					 | 
				
			||||||
  exit;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
?>
 | 
					?>
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								data/conf/rspamd/local.d/greylist.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								data/conf/rspamd/local.d/greylist.conf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					whitelisted_ip = "http://172.22.1.251:8081/forwardinghosts.php";
 | 
				
			||||||
		Reference in New Issue
	
	Block a user