feat: implement mail-login directadmin plugin
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
final class SourceAuthorizer
|
||||
{
|
||||
public static function assertAllowed(string $sourceHost, Settings $settings): void
|
||||
{
|
||||
$allowed = $settings->allowedSourceHosts();
|
||||
if ($allowed === []) {
|
||||
throw new RuntimeException('No source host allowlist configured');
|
||||
}
|
||||
if (!in_array(Settings::normalizeHost($sourceHost), $allowed, true)) {
|
||||
throw new RuntimeException('Source host is not allowed');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user