Skip to content
Snippets Groups Projects
Commit 788c7d50 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Fixed postfix smtp_generic_maps usage | refs #29119

parent b2248367
No related branches found
No related tags found
No related merge requests found
......@@ -37,19 +37,21 @@ def setup(interactive=True):
# Configure mail sender
sender = utils.get_conf('EMAIL_SENDER', '')
sender_domain = sender.split('@')[-1]
if sender_domain:
if sender_domain == 'ubicast.eu' and utils.get_conf('MS_SERVER_NAME', '') not in ('', 'mediaserver'):
if not sender_domain:
if utils.get_conf('MS_SERVER_NAME', '') not in ('', 'mediaserver'):
sender_domain = utils.get_conf('MS_SERVER_NAME')
if sender_domain == 'ubicast.eu' and utils.get_conf('CM_SERVER_NAME', '') not in ('', 'mirismanager'):
elif utils.get_conf('CM_SERVER_NAME', '') not in ('', 'mirismanager'):
sender_domain = utils.get_conf('CM_SERVER_NAME')
if sender_domain == 'ubicast.eu' and utils.get_conf('MONITOR_SERVER_NAME', '') not in ('', 'monitor'):
elif utils.get_conf('MONITOR_SERVER_NAME', '') not in ('', 'monitor'):
sender_domain = utils.get_conf('MONITOR_SERVER_NAME')
if sender_domain:
cmds.extend([
'rm -f /etc/postfix/generic',
'echo "root@localhost %s@%s" >> /etc/postfix/generic' % (hostname, sender_domain),
'echo "root@%s %s@%s" >> /etc/postfix/generic' % (hostname, hostname, sender_domain),
'echo "@%s %s@%s" >> /etc/postfix/generic' % (hostname, hostname, sender_domain),
'postmap hash:/etc/postfix/generic',
'sed -i "s/#smtp_generic_maps/smtp_generic_maps/" /etc/postfix/main.cf',
])
cmds.append('service postfix restart')
utils.run_commands(cmds)
......
......@@ -35,4 +35,4 @@ inet_protocols = ipv4
default_transport = smtp
relay_transport = smtp
disable_vrfy_command = yes
smtp_generic_maps = hash:/etc/postfix/generic
#smtp_generic_maps = hash:/etc/postfix/generic
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment