mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-10 06:58:27 +03:00
Improved Domain whitelist handling
This commit is contained in:
parent
7f94c26bee
commit
25214f2d87
2 changed files with 7 additions and 7 deletions
|
|
@ -108,16 +108,16 @@ class Domain implements \JsonSerializable
|
|||
{
|
||||
$sW = \trim($this->whiteList);
|
||||
if ($sW) {
|
||||
$sEmail = $this->IMAP->fixUsername($sEmail);
|
||||
$sEmail = $this->IMAP->fixUsername($sEmail, false);
|
||||
$sLogin = $this->IMAP->fixUsername($sLogin);
|
||||
$sUserPart = \MailSo\Base\Utils::getEmailAddressLocalPart($sLogin ?: $sEmail);
|
||||
$sUserDomain = \MailSo\Base\Utils::getEmailAddressDomain($sEmail);
|
||||
$sItem = \strtok($sW, " ;,\n");
|
||||
while (false !== $sItem) {
|
||||
$sItem = $this->IMAP->fixUsername(\trim($sItem));
|
||||
if ($sItem && (
|
||||
$sLogin === $sItem || $sEmail === $sItem
|
||||
|| $sUserPart === $sItem || \str_starts_with($sItem, "{$sUserPart}@")
|
||||
)) {
|
||||
$sItem = $this->IMAP->fixUsername(\trim($sItem), false);
|
||||
if ($sLogin === $sItem || $sEmail === $sItem
|
||||
|| $sUserPart === $sItem || "@{$sUserDomain}" === $sItem
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
$sItem = \strtok(" ;,\n");
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@
|
|||
<label for="tab-whitelist" role="tab" tabindex="0" data-icon="👥" data-i18n="POPUPS_DOMAIN/BUTTON_WHITE_LIST"></label>
|
||||
<div class="tab-content" role="tabpanel" aria-hidden="true">
|
||||
<div class="alert" data-i18n="POPUPS_DOMAIN/WHITE_LIST_ALERT"></div>
|
||||
<textarea class="input-xxlarge" style="width: 100%" rows="8" data-bind="value: whiteList" tabindex="-1"></textarea>
|
||||
<textarea class="input-xxlarge" style="width: 100%" rows="8" data-bind="value: whiteList" tabindex="-1" placeholder="@example.com user@example.org username"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue