Skip to content

Commit d3b9c5f

Browse files
committed
Reject blank passwords in credential requests
1 parent 7312ae0 commit d3b9c5f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

emailproxy.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
__author__ = 'Simon Robinson'
77
__copyright__ = 'Copyright (c) 2024 Simon Robinson'
88
__license__ = 'Apache 2.0'
9-
__version__ = '2024-11-13' # ISO 8601 (YYYY-MM-DD)
9+
__version__ = '2025-01-27' # ISO 8601 (YYYY-MM-DD)
1010
__package_version__ = '.'.join([str(int(i)) for i in __version__.split('-')]) # for pyproject.toml usage only
1111

1212
import abc
@@ -703,6 +703,10 @@ def get_oauth2_credentials(username, password, reload_remote_accounts=True):
703703
handles OAuth 2.0 token request and renewal, saving the updated details back to AppConfig (or removing them
704704
if invalid). Returns either (True, '[OAuth2 string for authentication]') or (False, '[Error message]')"""
705705

706+
if not password:
707+
Log.error('No password provided for account', username, '- aborting login')
708+
return False, '%s: Login failed - no password provided for account %s' % (APP_NAME, username)
709+
706710
# we support broader catch-all account names (e.g., `@domain.com` / `@`) if enabled
707711
config_accounts = AppConfig.accounts()
708712
valid_accounts = [username in config_accounts]

0 commit comments

Comments
 (0)