Sync global-autoresponder current state

This commit is contained in:
Marek Miklewicz
2026-07-04 15:16:50 +02:00
parent 196ee224fe
commit af775ce976
47 changed files with 1165 additions and 1037 deletions
-10
View File
@@ -6,7 +6,6 @@ final class Settings
public const BASE_DIR = '/usr/local/hitme_plugins/global-autoresponders';
public const CONFIG_DIR = self::BASE_DIR . '/config';
public const DATA_DIR = self::BASE_DIR . '/data';
public const STATE_DIR = self::BASE_DIR . '/state';
public const LOG_DIR = self::BASE_DIR . '/logs';
public const AUDIT_LOG = self::LOG_DIR . '/audit.log';
public const EXTERNAL_SETTINGS = self::CONFIG_DIR . '/plugin-settings.conf';
@@ -51,7 +50,6 @@ final class Settings
'DEFAULT_PLUGIN_LANGUAGE' => 'pl',
'DEFAULT_ENABLE' => 'true',
'GLOBAL_AUTORESPONDER_TIMEZONE' => 'Europe/Warsaw',
'GLOBAL_AUTORESPONDER_BACKEND' => 'da',
'GLOBAL_AUTORESPONDER_DYNAMIC_MAILBOX_SCOPE' => 'true',
'GLOBAL_AUTORESPONDER_MAX_SUBJECT_BYTES' => '255',
'GLOBAL_AUTORESPONDER_MAX_BODY_BYTES' => '20000',
@@ -91,11 +89,6 @@ final class Settings
return $this->getString('GLOBAL_AUTORESPONDER_TIMEZONE', 'Europe/Warsaw');
}
public function backendMode(): string
{
return $this->getString('GLOBAL_AUTORESPONDER_BACKEND', 'da');
}
public function scheduleMode(): string
{
return 'exact_hour';
@@ -141,9 +134,6 @@ final class Settings
} catch (Throwable) {
throw new InvalidArgumentException('Invalid timezone: ' . $this->timezone());
}
if (!in_array($this->backendMode(), ['da', 'exim'], true)) {
throw new InvalidArgumentException('Invalid backend mode: ' . $this->backendMode());
}
if ($this->maxSubjectBytes() < 1 || $this->maxBodyBytes() < 1) {
throw new InvalidArgumentException('Invalid size limits');
}