|
6 | 6 | __author__ = 'Simon Robinson' |
7 | 7 | __copyright__ = 'Copyright (c) 2025 Simon Robinson' |
8 | 8 | __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 |
10 | 10 | __version__ = '-'.join('%02d' % int(part) for part in __package_version__.split('.')) # ISO 8601 (YYYY-MM-DD) |
11 | 11 |
|
12 | 12 | import abc |
@@ -2163,8 +2163,8 @@ def process_data(self, byte_data): |
2163 | 2163 | updated_response = re.sub('( AUTH=%s)+' % capability, ' AUTH=PLAIN', str_response, flags=re.IGNORECASE) |
2164 | 2164 | if not re.search(' AUTH=PLAIN', updated_response, re.IGNORECASE): |
2165 | 2165 | # 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) |
2168 | 2168 | updated_response = updated_response.replace(' AUTH=PLAIN', '', updated_response.count(' AUTH=PLAIN') - 1) |
2169 | 2169 | if not re.search(' SASL-IR', updated_response, re.IGNORECASE): |
2170 | 2170 | updated_response = updated_response.replace(' AUTH=PLAIN', ' AUTH=PLAIN SASL-IR') |
|
0 commit comments