mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-05-26 06:19:00 +02:00
add DANE TLSA records to the PUBLIC_HOSTNAME's DNS
Postfix has a tls_security_level called "dane" which uses DNS-Based Authentication of Named Entities (DANE) to require, if specified in the DNS of the MX host, an encrpyted connection with a known certificate. This commit adds TLSA records.
This commit is contained in:
@@ -81,12 +81,12 @@ def is_pid_valid(pid):
|
||||
else:
|
||||
return True
|
||||
|
||||
def shell(method, cmd_args, env={}, capture_stderr=False):
|
||||
def shell(method, cmd_args, env={}, capture_stderr=False, return_bytes=False):
|
||||
# A safe way to execute processes.
|
||||
# Some processes like apt-get require being given a sane PATH.
|
||||
import subprocess
|
||||
env.update({ "PATH": "/sbin:/bin:/usr/sbin:/usr/bin" })
|
||||
stderr = None if not capture_stderr else subprocess.STDOUT
|
||||
ret = getattr(subprocess, method)(cmd_args, env=env, stderr=stderr)
|
||||
if isinstance(ret, bytes): ret = ret.decode("utf8")
|
||||
if not return_bytes and isinstance(ret, bytes): ret = ret.decode("utf8")
|
||||
return ret
|
||||
|
||||
Reference in New Issue
Block a user