diff --git a/model/AliasHandler.php b/model/AliasHandler.php index d729461d..3d18d495 100644 --- a/model/AliasHandler.php +++ b/model/AliasHandler.php @@ -434,6 +434,13 @@ class AliasHandler extends PFAHandler $errors = array(); foreach ($val as $singlegoto) { + # setmore() removes this internal target and restores it only from + # the stored vacation state, so it must not be validated as a + # user-managed external destination first. + if (!$this->new && $singlegoto === $this->getVacationAlias()) { + continue; + } + if (substr($this->id, 0, 1) == '@' && substr($singlegoto, 0, 1) == '@') { # domain-wide forward - check only the domain part # only allowed if $this->id is a catchall # Note: alias domains are better, but we should keep this way supported for backward compatibility diff --git a/tests/AliasHandlerTest.php b/tests/AliasHandlerTest.php index f80cc637..620b819d 100644 --- a/tests/AliasHandlerTest.php +++ b/tests/AliasHandlerTest.php @@ -210,7 +210,7 @@ class AliasHandlerTest extends \PHPUnit\Framework\TestCase 'forward@example.net', ], 'goto_mailbox' => 1, - ])); + ]), json_encode($handler->errormsg)); $this->assertTrue($handler->save(), json_encode($handler->errormsg)); $stored = new AliasHandler();