Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117761571
D5487.1775214744.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D5487.1775214744.diff
View Options
diff --git a/src/app/Policy/SmtpAccess.php b/src/app/Policy/SmtpAccess.php
--- a/src/app/Policy/SmtpAccess.php
+++ b/src/app/Policy/SmtpAccess.php
@@ -81,6 +81,11 @@
return true;
}
+ // Service accounts may impersonate all local users
+ if ($user->role == User::ROLE_SERVICE) {
+ return true;
+ }
+
// Is it one of user's aliases?
$alias = $user->aliases()->where('alias', $email)->first();
diff --git a/src/tests/Feature/Policy/SmtpAccessTest.php b/src/tests/Feature/Policy/SmtpAccessTest.php
--- a/src/tests/Feature/Policy/SmtpAccessTest.php
+++ b/src/tests/Feature/Policy/SmtpAccessTest.php
@@ -43,6 +43,9 @@
{
$john = $this->getTestUser('john@kolab.org');
$jack = $this->getTestUser('jack@kolab.org');
+ $noreply = $this->getTestUser('noreply@kolab.org');
+ $noreply->role = User::ROLE_SERVICE;
+ $noreply->save();
// Test main email address
$this->assertTrue(SmtpAccess::verifySender($john, ucfirst($john->email)));
@@ -76,5 +79,8 @@
// Test suspended user
$jack->suspend();
$this->assertFalse(SmtpAccess::verifySender($jack, $jack->email));
+
+ // Test noreply impersonation
+ $this->assertTrue(SmtpAccess::verifySender($noreply, $john->email));
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 11:12 AM (21 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18823786
Default Alt Text
D5487.1775214744.diff (1 KB)
Attached To
Mode
D5487: Allow service accounts to impersonate local users
Attached
Detach File
Event Timeline