Skip to content

Commit db72a1f

Browse files
committed
Keep all IMAP versions at the start of CAPABILITY
Fix forward/backward slash in delegation example
1 parent 3495d14 commit db72a1f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

emailproxy.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ documentation = Accounts are specified using your email address as the section h
139139

140140
- Office 365 shared mailboxes are supported: add an account entry here using the email address of the shared
141141
mailbox as the account name. When asked to authenticate, log in as the user that access has been delegated to.
142-
Note that Office 365 no-longer supports the `[email protected]/delegated.mailbox` username syntax.
142+
Note that Office 365 no-longer supports the `[email protected]\delegated.mailbox` username syntax.
143143

144144
- It is possible to create Office 365 / Outlook OAuth 2.0 clients that do not require a secret to be sent. If this
145145
is the case for your setup, delete the `client_secret` line from your account's configuration entry (do not leave

emailproxy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
__author__ = 'Simon Robinson'
77
__copyright__ = 'Copyright (c) 2025 Simon Robinson'
88
__license__ = 'Apache 2.0'
9-
__package_version__ = '2025.6.25' # for pyproject.toml usage only - needs to be ast.literal_eval() compatible
9+
__package_version__ = '2025.7.18' # 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
@@ -2163,8 +2163,8 @@ def process_data(self, byte_data):
21632163
updated_response = re.sub('( AUTH=%s)+' % capability, ' AUTH=PLAIN', str_response, flags=re.IGNORECASE)
21642164
if not re.search(' AUTH=PLAIN', updated_response, re.IGNORECASE):
21652165
# cannot just replace e.g., one 'CAPABILITY ' match because IMAP4 must be first if present (RFC 1730)
2166-
updated_response = re.sub('(CAPABILITY)( IMAP%s)?' % capability, r'\1\2 AUTH=PLAIN', updated_response,
2167-
count=1, flags=re.IGNORECASE)
2166+
updated_response = re.sub('(CAPABILITY)((?: IMAP%s)*)' % capability, r'\1\2 AUTH=PLAIN',
2167+
updated_response, count=1, flags=re.IGNORECASE)
21682168
updated_response = updated_response.replace(' AUTH=PLAIN', '', updated_response.count(' AUTH=PLAIN') - 1)
21692169
if not re.search(' SASL-IR', updated_response, re.IGNORECASE):
21702170
updated_response = updated_response.replace(' AUTH=PLAIN', ' AUTH=PLAIN SASL-IR')

0 commit comments

Comments
 (0)