May 28, 20251 yr KSMG v2.1.1.8310. Пытаюсь обновить сертификат для TLS Параметры / Встроенные МТА / TLS шифрование / Создать сертификат в формате PFX. Выбираю pfx-сертификат, ввожу пароль, получаю невнятное "Ошибка выполнения команды". Спойлер Ошибка выполнения команды Error ID: RunCmdError Message: Failed to run ['/opt/kaspersky/ksmg-appliance-addon/libexec/set_postfix_config', '-t'] with error code=255 and msg=Traceback (most recent call last): File "/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py", line 120, in <module> main() File "/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py", line 110, in main render(in_file, out_file, render_mode) File "/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py", line 101, in render render_func() File "/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py", line 99, in <lambda> render_func = {"main_cf": lambda: render_main_config(params, out_file), "master_cf": lambda: render_template(params, out_file, "master.cf.template"), "virtual": lambda: render_template(params, out_file, "virtual.template"), "transport": lambda: render_template(params, out_file, "transport.template"), "tls_policy": lambda: render_template(params, out_file, "tls_policy.template"), "smtp_tls_crt": lambda: render_string(client_tls_cert, out_file), "smtp_tls_key": lambda: render_string(client_tls_pkey, out_file), "smtpd_tls_crt": lambda: render_string(server_tls_cert, out_file), "smtpd_tls_key": lambda: render_string(server_tls_pkey, out_file), "recipient_access": lambda: render_template(params, out_file, "recipient_access.template"), "dhparam_pem": lambda: render_string(dhparam_pem, out_file),}[render_mode] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py", line 76, in render_main_config render_template(params, out_file, "main.cf.template") File "/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py", line 58, in render_template template = environment.get_template(template_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/environment.py", line 1013, in get_template return self._load_template(name, globals) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/environment.py", line 972, in _load_template template = self.loader.load(self, name, self.make_globals(globals)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/loaders.py", line 126, in load source, filename, uptodate = self.get_source(environment, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/loaders.py", line 210, in get_source contents = f.read() ^^^^^^^^ File "<frozen codecs>", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 3240: invalid continuation byte ERROR [217] /opt/kaspersky/ksmg/libexec/python3 exit code: 1 ERROR [336] script /opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py failed ERROR [242] render script for main_cf failed ERROR [480] render_postfix_configs() failed ERROR [541] test_postfix_config() failed Params: {"command":["/opt/kaspersky/ksmg-appliance-addon/libexec/set_postfix_config","-t"],"err_code":255,"err_msg":"Traceback (most recent call last):\n File \"/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py\", line 120, in <module>\n main()\n File \"/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py\", line 110, in main\n render(in_file, out_file, render_mode)\n File \"/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py\", line 101, in render\n render_func()\n File \"/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py\", line 99, in <lambda>\n render_func = {\"main_cf\": lambda: render_main_config(params, out_file), \"master_cf\": lambda: render_template(params, out_file, \"master.cf.template\"), \"virtual\": lambda: render_template(params, out_file, \"virtual.template\"), \"transport\": lambda: render_template(params, out_file, \"transport.template\"), \"tls_policy\": lambda: render_template(params, out_file, \"tls_policy.template\"), \"smtp_tls_crt\": lambda: render_string(client_tls_cert, out_file), \"smtp_tls_key\": lambda: render_string(client_tls_pkey, out_file), \"smtpd_tls_crt\": lambda: render_string(server_tls_cert, out_file), \"smtpd_tls_key\": lambda: render_string(server_tls_pkey, out_file), \"recipient_access\": lambda: render_template(params, out_file, \"recipient_access.template\"), \"dhparam_pem\": lambda: render_string(dhparam_pem, out_file),}[render_mode]\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py\", line 76, in render_main_config\n render_template(params, out_file, \"main.cf.template\")\n File \"/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py\", line 58, in render_template\n template = environment.get_template(template_name)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/environment.py\", line 1013, in get_template\n return self._load_template(name, globals)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/environment.py\", line 972, in _load_template\n template = self.loader.load(self, name, self.make_globals(globals))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/loaders.py\", line 126, in load\n source, filename, uptodate = self.get_source(environment, name)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/loaders.py\", line 210, in get_source\n contents = f.read()\n ^^^^^^^^\n File \"<frozen codecs>\", line 322, in decode\nUnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 3240: invalid continuation byte\nERROR [217] /opt/kaspersky/ksmg/libexec/python3 exit code: 1\nERROR [336] script /opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py failed\nERROR [242] render script for main_cf failed\nERROR [480] render_postfix_configs() failed\nERROR [541] test_postfix_config() failed"}
May 28, 20251 yr Author Solution Проблему решил. Вдруг кому полезно будет. Мы используем отредактированные под себя шаблоны main_cf и master_cf. В шаблонах были использованы комментарии на русском языке. Убрали из комментариев русские буквы и все получилось.
KSMG v2.1.1.8310. Пытаюсь обновить сертификат для TLS
Параметры / Встроенные МТА / TLS шифрование / Создать сертификат в формате PFX.
Выбираю pfx-сертификат, ввожу пароль, получаю невнятное "Ошибка выполнения команды".
Ошибка выполнения команды
Error ID: RunCmdError
Message: Failed to run ['/opt/kaspersky/ksmg-appliance-addon/libexec/set_postfix_config', '-t'] with error code=255 and msg=Traceback (most recent call last):
File "/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py", line 120, in <module>
main()
File "/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py", line 110, in main
render(in_file, out_file, render_mode)
File "/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py", line 101, in render
render_func()
File "/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py", line 99, in <lambda>
render_func = {"main_cf": lambda: render_main_config(params, out_file), "master_cf": lambda: render_template(params, out_file, "master.cf.template"), "virtual": lambda: render_template(params, out_file, "virtual.template"), "transport": lambda: render_template(params, out_file, "transport.template"), "tls_policy": lambda: render_template(params, out_file, "tls_policy.template"), "smtp_tls_crt": lambda: render_string(client_tls_cert, out_file), "smtp_tls_key": lambda: render_string(client_tls_pkey, out_file), "smtpd_tls_crt": lambda: render_string(server_tls_cert, out_file), "smtpd_tls_key": lambda: render_string(server_tls_pkey, out_file), "recipient_access": lambda: render_template(params, out_file, "recipient_access.template"), "dhparam_pem": lambda: render_string(dhparam_pem, out_file),}[render_mode]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py", line 76, in render_main_config
render_template(params, out_file, "main.cf.template")
File "/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py", line 58, in render_template
template = environment.get_template(template_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/environment.py", line 1013, in get_template
return self._load_template(name, globals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/environment.py", line 972, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/loaders.py", line 126, in load
source, filename, uptodate = self.get_source(environment, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/loaders.py", line 210, in get_source
contents = f.read()
^^^^^^^^
File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 3240: invalid continuation byte
ERROR [217] /opt/kaspersky/ksmg/libexec/python3 exit code: 1
ERROR [336] script /opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py failed
ERROR [242] render script for main_cf failed
ERROR [480] render_postfix_configs() failed
ERROR [541] test_postfix_config() failed
Params: {"command":["/opt/kaspersky/ksmg-appliance-addon/libexec/set_postfix_config","-t"],"err_code":255,"err_msg":"Traceback (most recent call last):\n File \"/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py\", line 120, in <module>\n main()\n File \"/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py\", line 110, in main\n render(in_file, out_file, render_mode)\n File \"/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py\", line 101, in render\n render_func()\n File \"/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py\", line 99, in <lambda>\n render_func = {\"main_cf\": lambda: render_main_config(params, out_file), \"master_cf\": lambda: render_template(params, out_file, \"master.cf.template\"), \"virtual\": lambda: render_template(params, out_file, \"virtual.template\"), \"transport\": lambda: render_template(params, out_file, \"transport.template\"), \"tls_policy\": lambda: render_template(params, out_file, \"tls_policy.template\"), \"smtp_tls_crt\": lambda: render_string(client_tls_cert, out_file), \"smtp_tls_key\": lambda: render_string(client_tls_pkey, out_file), \"smtpd_tls_crt\": lambda: render_string(server_tls_cert, out_file), \"smtpd_tls_key\": lambda: render_string(server_tls_pkey, out_file), \"recipient_access\": lambda: render_template(params, out_file, \"recipient_access.template\"), \"dhparam_pem\": lambda: render_string(dhparam_pem, out_file),}[render_mode]\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py\", line 76, in render_main_config\n render_template(params, out_file, \"main.cf.template\")\n File \"/opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py\", line 58, in render_template\n template = environment.get_template(template_name)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/environment.py\", line 1013, in get_template\n return self._load_template(name, globals)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/environment.py\", line 972, in _load_template\n template = self.loader.load(self, name, self.make_globals(globals))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/loaders.py\", line 126, in load\n source, filename, uptodate = self.get_source(environment, name)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/opt/kaspersky/ksmg/lib/python3.11/site-packages/jinja2/loaders.py\", line 210, in get_source\n contents = f.read()\n ^^^^^^^^\n File \"<frozen codecs>\", line 322, in decode\nUnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 3240: invalid continuation byte\nERROR [217] /opt/kaspersky/ksmg/libexec/python3 exit code: 1\nERROR [336] script /opt/kaspersky/ksmg-appliance-addon/libexec/render_postfix_config.py failed\nERROR [242] render script for main_cf failed\nERROR [480] render_postfix_configs() failed\nERROR [541] test_postfix_config() failed"}