Fix smtp sendmail (#781)

* Fix setting mail_username, mail_password; Fix setting auth for get_smtp
* Add MAIL_USEAUTH to config.py
* Add more mail documentation to config.py
* Prevent overriding smtp attributes on config update; update email tests to use mail_userauth
This commit is contained in:
Kevin Chung
2018-12-05 00:18:11 -05:00
committed by GitHub
parent 64b96d9c1a
commit 473acdbdc3
6 changed files with 45 additions and 6 deletions

View File

@@ -179,6 +179,7 @@ def test_expired_reset_password_link():
with app.app_context():
set_config('mail_server', 'localhost')
set_config('mail_port', 25)
set_config('mail_useauth', True)
set_config('mail_username', 'username')
set_config('mail_password', 'password')
@@ -199,6 +200,7 @@ def test_invalid_reset_password_link():
with app.app_context():
set_config('mail_server', 'localhost')
set_config('mail_port', 25)
set_config('mail_useauth', True)
set_config('mail_username', 'username')
set_config('mail_password', 'password')
@@ -237,6 +239,7 @@ def test_user_can_confirm_email(mock_smtp):
set_config('verify_emails', True)
set_config('mail_server', 'localhost')
set_config('mail_port', 25)
set_config('mail_useauth', True)
set_config('mail_username', 'username')
set_config('mail_password', 'password')
@@ -279,6 +282,7 @@ def test_user_can_reset_password(mock_smtp):
# Set CTFd to send emails
set_config('mail_server', 'localhost')
set_config('mail_port', 25)
set_config('mail_useauth', True)
set_config('mail_username', 'username')
set_config('mail_password', 'password')