IMAP4(S) Proxy: optimized input processing routine.