Fix: Mailbox Stats über Dovecot mit config/mailpool.php

main v1.0.119
boban 2025-10-31 04:13:39 +01:00
parent 2f390af9ed
commit a3a4ec4d06
1 changed files with 3 additions and 10 deletions

View File

@ -248,23 +248,16 @@ class Fail2BanJailModal extends ModalComponent
private function isStillBanned(string $jail, string $ip): bool
{
// 1) Direkt: banip
// 1) Direktcheck: liefert 1/0 je nach Version, ist harmlos wenn 0
[, $out1] = $this->f2b('get '.escapeshellarg($jail).' banip '.escapeshellarg($ip));
if (preg_match('/\b1\b/', $out1)) return true;
// 2) Liste: banlist (Rohliste, whitespace-separiert)
[, $out2] = $this->f2b('get '.escapeshellarg($jail).' banlist');
if ($out2 !== '') {
$list = array_filter(array_map('trim', preg_split('/\s+/', trim($out2))));
if (in_array($ip, $list, true)) return true;
}
// 3) Notfall: status-Parsing
// 2) Fallback: aus `status <jail>` die Liste parsen (das hast du ohnehin)
[, $out3] = $this->f2b('status '.escapeshellarg($jail));
$ipList = $this->firstMatch('/Banned IP list:\s*(.+)$/mi', $out3) ?: '';
return $ipList !== '' && preg_match('/(^|\s)'.preg_quote($ip,'/').'(\s|$)/', $ipList) === 1;
}
private function getBantime(string $jail): int
{
[, $out] = $this->f2b('get '.escapeshellarg($jail).' bantime');