Implemented output buffering for ImapStream