You're on the correct track, but the response is wrong. Use "* OK", not "+ OK".
"+" is for command continuation (literals, IDLE, and SASL negotiations), and will confuse clients that do not have any command continuation in progress.
"* OK" is specifically for server-originated babble. I suggest something like "* OK wait please..." rather than leaving the payload text empty.
-- Mark --
________________________________
Date: Tue, 8 Jul 2008 19:02:25 +0400
From: lozhkarev@googlemail.com
To: imap-protocol@u.washington.edu
Subject: [Imap-protocol] IMAP server mail transfer simulation
Hello, I'm developing IMAP proxy server to check attachments.
(mail client) <-> (my proxy) <-> (real IMAP server)
Proxy does simple work: transmitting client requests and server responses.
Problem appears when client requests some message from server, but proxy can't response to client while it not download full message from real server (Proxy must check attachment before transmitting it). The message may be very large and downloading may take much time. If client has some timeout it may decide that server failed.
I tried to send "+ OK\r\n" periodically to client before real data preparing, and this method is helpful for some mail clients. For example:
C: f fetch 1 (body[])
S: + OK // server send "+ OK\r\n" by timer while downloading full message
S: + OK
S: + OK
...
S: * 1 FETCH (BODY[] {9876543} ....
but I think this way is not correct.
Is any IMAP protocol feature to simulate message downloading, to prevent client thinking about timeout?
---------------------------------------------------------------
Nickolay Lozhkarev
_________________________________________________________________
Need to know now? Get instant answers with Windows Live Messenger.
http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_messenger_072008