Skip to content

Commit

Permalink
Merge pull request #402 from GateNLP/smtp-no-tls
Browse files Browse the repository at this point in the history
Add explicit setting for "no email security"
  • Loading branch information
ianroberts authored May 8, 2024
2 parents 4585c71 + 53b9a56 commit fdafb21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion install/get-teamware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ else

case "$EMAIL_SECURE" in
[Nn]*)
DJANGO_EMAIL_SECURITY=
DJANGO_EMAIL_SECURITY=none
;;

*)
Expand Down
4 changes: 3 additions & 1 deletion teamware/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,10 @@
EMAIL_USE_SSL = True
elif os.environ['DJANGO_EMAIL_SECURITY'].lower() == 'tls':
EMAIL_USE_TLS = True
elif os.environ['DJANGO_EMAIL_SECURITY'].lower() in ['', 'none']:
pass
else:
raise ValueError("DJANGO_EMAIL_SECURITY, if set, must be either SSL or TLS")
raise ValueError("DJANGO_EMAIL_SECURITY, if set, must be either SSL or TLS, or 'none' for no security")

if 'DJANGO_EMAIL_CLIENT_CERTIFICATE' in os.environ:
# If certificate is set then key must also, and we want to raise an
Expand Down

0 comments on commit fdafb21

Please sign in to comment.