mirror of
https://github.com/anonaddy/anonaddy
synced 2026-04-26 01:25:06 +02:00
Fixed parentDomain bug
This commit is contained in:
@@ -81,24 +81,26 @@ class ReceiveEmail extends Command
|
||||
})
|
||||
->first();
|
||||
|
||||
$subdomain = substr($recipient['domain'], 0, strrpos($recipient['domain'], '.'.$parentDomain));
|
||||
if ($parentDomain) {
|
||||
$subdomain = substr($recipient['domain'], 0, strrpos($recipient['domain'], '.'.$parentDomain));
|
||||
|
||||
if ($subdomain === 'unsubscribe') {
|
||||
$this->handleUnsubscribe($recipient);
|
||||
continue;
|
||||
}
|
||||
|
||||
$user = User::where('username', $subdomain)->first();
|
||||
|
||||
if (is_null($user)) {
|
||||
// Check if this is a custom domain.
|
||||
if ($customDomain = Domain::where('domain', $recipient['domain'])->first()) {
|
||||
$user = $customDomain->user;
|
||||
if ($subdomain === 'unsubscribe') {
|
||||
$this->handleUnsubscribe($recipient);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if this is an additional username.
|
||||
if ($additionalUsername = AdditionalUsername::where('username', $subdomain)->first()) {
|
||||
$user = $additionalUsername->user;
|
||||
} else {
|
||||
$user = User::where('username', $subdomain)->first();
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($user)) {
|
||||
// Check if this is a custom domain.
|
||||
if ($customDomain = Domain::where('domain', $recipient['domain'])->first()) {
|
||||
$user = $customDomain->user;
|
||||
}
|
||||
|
||||
// Check if this is a uuid generated alias.
|
||||
|
||||
Reference in New Issue
Block a user