mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-15 09:51:21 +00:00
email: Reload postfix in domain view
This commit is contained in:
parent
27387d4a9c
commit
240b67c49e
@ -6,6 +6,7 @@ import json
|
||||
import os
|
||||
import re
|
||||
import select
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
@ -111,6 +112,15 @@ def _action_set_keys():
|
||||
set_function = globals()['su_set' + key]
|
||||
set_function(value)
|
||||
|
||||
# Important: reload postfix after acquiring lock
|
||||
with postconf.mutex.lock_all():
|
||||
# systemctl reload postfix
|
||||
args = ['systemctl', 'reload', 'postfix']
|
||||
completed = subprocess.run(args, capture_output=True)
|
||||
if completed.returncode != 0:
|
||||
interproc.log_subprocess(completed)
|
||||
raise OSError('Could not reload postfix')
|
||||
|
||||
|
||||
def clean_mailname(mailname):
|
||||
mailname = mailname.lower().strip()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user