[Web] Mail policies: store list entries the way they are compared, refuse unknown modes

This commit is contained in:
FreddleSpl0it committed 2026-11-09 03:06:19 +01:00
1 parent 7a1b68c5e2
commit c304040140
4 files changed
+25 -3

No files matched your search

@@ -58,6 +58,13 @@ class PolicyEngineTest extends TestCase
$this->assertSame('DUNNO', $this->engine->check('azubi@firma.de', 'x@extern.example', 'azubi@firma.de')->action());
}
public function testUnknownModeLetsNothingThrough(): void
{
$this->lookup->mailboxPolicies['azubi@firma.de'] = [self::policy(1, ['sendMode' => 'nobody', 'receiveMode' => ''])];
$this->assertSame([false, 'send'], $this->check('azubi@firma.de', 'kollege@firma.de', 'azubi@firma.de'));
$this->assertSame([false, 'receive'], $this->check('kollege@firma.de', 'azubi@firma.de', 'kollege@firma.de'));
}
public function testSendOnlyInternalWithAllowedAndBlockedEntries(): void
{
$this->lookup->mailboxPolicies['azubi@firma.de'] = [self::policy(1, [