Skip to content

Commit bf0cc29

Browse files
committed
Merge branch 'reject-blank-password' (see #321)
2 parents 02770ad + d3b9c5f commit bf0cc29

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-
__package_version__ = '2024.11.13' # for pyproject.toml usage only - needs to be ast.literal_eval() compatible
9+
__package_version__ = '2025.1.27' # for pyproject.toml usage only - needs to be ast.literal_eval() compatible
1010
__version__ = '-'.join('%02d' % int(part) for part in __package_version__.split('.')) # ISO 8601 (YYYY-MM-DD)
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)