email: Use the term 'setup' rather than 'repair' for consistency

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2022-02-16 11:58:05 -08:00 committed by James Valleroy
parent 55bd428bd7
commit ef6619d8d6
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
4 changed files with 13 additions and 11 deletions

View File

@ -176,12 +176,12 @@ def setup(helper, old_version=None):
app.setup(old_version)
# Setup
helper.call('post', privileged.home.repair)
helper.call('post', privileged.home.setup)
app.get_component('letsencrypt-email-postfix').setup_certificates()
app.get_component('letsencrypt-email-dovecot').setup_certificates()
helper.call('post', privileged.domain.set_domains)
helper.call('post', privileged.postfix.repair)
helper.call('post', privileged.spam.repair)
helper.call('post', privileged.postfix.setup)
helper.call('post', privileged.spam.setup)
# Reload
actions.superuser_run('service', ['reload', 'postfix'])

View File

@ -6,7 +6,7 @@ import subprocess
from plinth import actions
def repair():
def setup():
"""Set correct permissions on /var/mail/ directory.
For each user, /var/mail/<user> is the 'dovecot mail home' for that user.
@ -14,9 +14,9 @@ def repair():
directory. Ensure that 'others' can access /var/mail/.
"""
actions.superuser_run('email', ['home', 'set_up'])
actions.superuser_run('email', ['home', 'setup'])
def action_set_up():
def action_setup():
"""Run chmod on /var/mail to remove all permissions for 'others'."""
subprocess.run(['chmod', 'o-rwx', '/var/mail'], check=True)

View File

@ -52,8 +52,8 @@ smtps_service = postconf.Service(service='smtps', type_='inet', private='n',
SQLITE_ALIASES = 'sqlite:/etc/postfix/freedombox-aliases.cf'
def repair():
"""Tries to repair SASL, mail submission, and user lookup settings."""
def setup():
"""Set SASL, mail submission, and user lookup settings."""
aliases.first_setup()
actions.superuser_run('email', ['postfix', 'setup'])

View File

@ -16,11 +16,13 @@ _milter_config = {
}
def repair():
actions.superuser_run('email', ['spam', 'set_filter'])
def setup():
"""Trigger a privileged setup action."""
actions.superuser_run('email', ['spam', 'setup'])
def action_set_filter():
def action_setup():
"""Compile sieve filters and set rspamd/postfix configuration."""
_compile_sieve()
_setup_rspamd()
postfix.set_config(_milter_config)