Add set_myhostname() and set_mydestination() for postfix

This commit is contained in:
Lance Edgar 2019-09-09 14:17:49 -05:00
parent fec1c66422
commit f787b3ad79

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2018 Lance Edgar
# Copyright © 2010-2019 Lance Edgar
#
# This file is part of Rattail.
#
@ -24,8 +24,6 @@
Fabric library for Postfix
"""
from __future__ import unicode_literals, absolute_import
from rattail_fabric2 import apt
@ -66,6 +64,20 @@ def set_config(c, setting, value):
c.sudo("postconf -e '{}={}'".format(setting, value))
def set_myhostname(c, hostname):
"""
Configure the 'myhostname' setting with the given string.
"""
set_config(c, 'myhostname', hostname)
def set_mydestination(c, *destinations):
"""
Configure the 'mydestinations' setting with the given strings.
"""
set_config(c, 'mydestination', ', '.join(destinations))
def set_relayhost(c, relayhost):
"""
Configure the 'relayhost' setting with the given string