Use postconf -e instead of our home-grown solution for that

This commit is contained in:
Lance Edgar 2018-07-10 10:00:56 -05:00
parent e740a6ad31
commit bf366817d7

View file

@ -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):