fix: harden backend synchronization
This commit is contained in:
@@ -49,7 +49,11 @@ final class DirectAdminVacationSyncService
|
||||
$next = [];
|
||||
foreach ($targets as $mailbox) {
|
||||
$email = strtolower((string)$mailbox['email']);
|
||||
$this->api->saveVacation($username, $email, $rule, isset($existing[$email]));
|
||||
$isTracked = isset($existing[$email]);
|
||||
if (!$isTracked && $this->api->vacationExists($username, $email)) {
|
||||
throw new RuntimeException('Untracked DirectAdmin vacation already exists for ' . $email);
|
||||
}
|
||||
$this->api->saveVacation($username, $email, $rule, $isTracked);
|
||||
$next[] = [
|
||||
'rule_id' => $ruleId,
|
||||
'domain' => (string)$mailbox['domain'],
|
||||
|
||||
Reference in New Issue
Block a user