[New-bugs-announce] [issue37407] Update imaplib.py to account for additional padding

Edward Smith report at bugs.python.org
Wed Jun 26 01:28:49 EDT 2019


New submission from Edward Smith <edwardmbsmith at icloud.com>:

Regex for imaplib should account for IMAP servers which return one or two whitespaces after the * in responses. For example when using davmail as an interpreter between exchange to IMAP 

Acceptable response is as follows:
```
  58:24.54 > PJJD3 EXAMINE INBOX
  58:24.77 < * 486 EXISTS
  58:24.78      matched r'\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?' => ('486', 'EXISTS', None, None)
  58:24.78 untagged_responses[EXISTS] 0 += ["486"]
```
Davmail response:
```
57:50.86 > KPFE3 EXAMINE INBOX
  57:51.10 < *  953 EXISTS
  57:51.10 last 0 IMAP4 interactions:
  57:51.10 > KPFE4 LOGOUT
```

See additional whitespace after the * on line 2

To be fixed by allowing the regex to account for one or two whitespaces
```python
br'\*[ ]{1,2}(?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?'
```

----------
components: email
messages: 346584
nosy: barry, edwardmbsmith, r.david.murray
priority: normal
pull_requests: 14202
severity: normal
status: open
title: Update imaplib.py to account for additional padding
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37407>
_______________________________________


More information about the New-bugs-announce mailing list