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

Turn off SMTP authentication when no password is given | refs #29215

parent 6b78be6f
No related branches found
No related tags found
No related merge requests found
...@@ -59,9 +59,9 @@ def setup(interactive=True): ...@@ -59,9 +59,9 @@ def setup(interactive=True):
utils.run_commands(cmds) utils.run_commands(cmds)
# Setup authentication if any # Setup authentication if any
user = utils.get_conf('EMAIL_SMTP_USER') user = utils.get_conf('EMAIL_SMTP_USER')
if user: pwd = utils.get_conf('EMAIL_SMTP_PWD')
if user and pwd:
utils.log('Enabling authentication for SMTP relay.') utils.log('Enabling authentication for SMTP relay.')
pwd = utils.get_conf('EMAIL_SMTP_PWD', '')
with open('/etc/postfix/sasl-passwords', 'w') as fo: with open('/etc/postfix/sasl-passwords', 'w') as fo:
fo.write('%s %s:%s\n' % (server, user, pwd)) fo.write('%s %s:%s\n' % (server, user, pwd))
auth_conf = ''' auth_conf = '''
......
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