No unittest because i can't reproduce the crash with my imap server, but kevin acked the patch. BUG: 247456 (cherry picked from commit 4ece1488)