IMAPSever:fix crashing during document download