Issue 33225: imaplib module IMAP4.append() unexpected response BAD Command Error (original) (raw)
part of bytestring in message in .append() includes 'text-align: center;\r\n}<!--[if gte mso 9]>'
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