Use postconf -e
instead of our home-grown solution for that
This commit is contained in:
parent
e740a6ad31
commit
bf366817d7
|
@ -59,14 +59,11 @@ def restart():
|
|||
sudo('service postfix restart')
|
||||
|
||||
|
||||
def set_config(setting, value, path='/etc/postfix/main.cf'):
|
||||
def set_config(setting, value):
|
||||
"""
|
||||
Configure the given setting with the given value.
|
||||
"""
|
||||
# replace setting if already exists; then add in case it didn't
|
||||
entry = '{} = {}'.format(setting, value)
|
||||
sed(path, r'^{} = .*$'.format(setting), entry, use_sudo=True)
|
||||
append(path, entry, use_sudo=True)
|
||||
sudo("postconf -e '{}={}'".format(setting, value))
|
||||
|
||||
|
||||
def set_myhostname(hostname):
|
||||
|
|
Loading…
Reference in a new issue