diff --git a/src/tests/Feature/Stories/GreylistTest.php b/src/tests/Feature/Stories/GreylistTest.php --- a/src/tests/Feature/Stories/GreylistTest.php +++ b/src/tests/Feature/Stories/GreylistTest.php @@ -458,6 +458,19 @@ ); $this->assertFalse($request->shouldDefer()); + + + // Ensure we also find the setting by alias + $aliases = $this->domainOwner->aliases()->orderBy('alias')->get(); + $request = new Greylist\Request( + [ + 'sender' => 'someone@sender.domain', + 'recipient' => $aliases[0]->alias, + 'client_address' => $this->clientAddress + ] + ); + + $this->assertFalse($request->shouldDefer()); } public function testUserEnabled() diff --git a/src/tests/TestCaseTrait.php b/src/tests/TestCaseTrait.php --- a/src/tests/TestCaseTrait.php +++ b/src/tests/TestCaseTrait.php @@ -389,11 +389,20 @@ ] ); + $this->getTestDomain( + 'test2.domain2', + [ + 'type' => \App\Domain::TYPE_EXTERNAL, + 'status' => \App\Domain::STATUS_ACTIVE | \App\Domain::STATUS_CONFIRMED | \App\Domain::STATUS_VERIFIED + ] + ); + $packageKolab = \App\Package::where('title', 'kolab')->first(); $this->domainOwner = $this->getTestUser('john@test.domain', ['password' => $this->userPassword]); $this->domainOwner->assignPackage($packageKolab); $this->domainOwner->setSettings($this->domainOwnerSettings); + $this->domainOwner->setAliases(['alias1@test2.domain2']); // separate for regular user $this->jack = $this->getTestUser('jack@test.domain', ['password' => $this->userPassword]);