classification
Title: imaplib module IMAP4.append() unexpected response BAD Command Error
Type: behavior Stage:
Components: Extension Modules Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: yuy
Priority: normal Keywords:

Created on 2018-04-04 17:40 by yuy, last changed 2018-04-04 17:40 by yuy.

Messages (1)
msg314945 - (view) Author: Yang Yu (yuy) Date: 2018-04-04 17:40
part of bytestring in message in .append() includes 'text-align: center;\r\n}</style><!--[if gte mso 9]><xml>'

append always fails on such messages with 
`abort: command: APPEND => unexpected response: b'}</style><!--[if BAD Command Error. 10'`

Some spam emails includes this in body. I pipe incoming emails to spamassassin and pipe back stdout to be appended to spam mailbox. This type of failures always causes IMAPS connection to be closed.

I can reproduce this every time. IMAP server is Microsoft Exchange I believe
History
Date User Action Args
2018-04-04 17:40:42yuycreate