I already mailed the author of imapsync about that some days ago but without having an idea how to fix it. I also checked Mail::IMAPClient and found that it lacked the functionality needed here but it seems Mail::IMAPClient isn't maintained anymore (at least there is no development for long time now).
I don't know how much work it would be, but you could look at re-implementing using Mail::IMAPTalk. It's the IMAP client I built for use at FastMail.FM after finding problems with the other ones available at the time (about 4-5 years ago now). It definitely allows capturing a literal response into a file handle, and sending a file handle as a literal response to avoid storing everything in memory.
Rob ---- Cyrus Home Page: http://cyrusimap.web.cmu.edu/ Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html