From 8d631d2ce89626f0f0f63113b8a681eb73fdab88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Cort=C3=A9s=20Cano?= <38475681+TrapoSAMA@users.noreply.github.com> Date: Sat, 18 Jul 2026 21:24:02 -0400 Subject: [PATCH] Skip internal vacation target validation --- model/AliasHandler.php | 7 +++++++ tests/AliasHandlerTest.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) 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();