I encountered an issue where when moving messages between IMAP accounts (not
mailboxes), that I could not move more than 1 at a time, and would get an
error ("Bad tag") until I re-logged in. I finally traced through the code
and found that commands were being processed like:
COMMAND: [0018Z APPEND "INBOX" .....]
COMMAND: []
Basically the [] was actually the result of clarify_data processing "^M".
The following hack seems to do the trick, but it looks like clarify_data
tried to do it (but obviously failed). The problem occurred on Outlook
Express for PC and Microsoft Entourage for Macintosh, so I'm guessing it's
global (at least for M$ software).
/Mark
--- dbmail/imap4.c 2002-06-05 20:46:13.000000000 +1200
+++ dbmail.mine/imap4.c 2002-09-13 12:41:12.000000000 +1200
@@ -122,6 +122,7 @@
char *tag = NULL,*cpy,**args,*command;
int i,done,result;
int nfaultyresponses;
+ int endidx;
imap_userdata_t *ud = ci->userData;
mailbox_t newmailbox;
@@ -168,6 +169,8 @@
{
/* we have had just about it with this user */
sleep(2); /* avoid DOS attacks */
+
+ trace(COMMAND_SHOW_LEVEL,"FATAL: To many fault responses\n");
fprintf(ci->tx,"* BYE [TRY RFC]\r\n");
done = 1;
break;
@@ -234,9 +237,18 @@
return 1;
}
+
+ /* Hack by Mark Mackay to get lines of '^M' only to be ignored...
*/
+ endidx = strlen(line)-1;
+ if (line >= 0 && endidx ==1 && (line[endidx] == '\n'
||line[endidx] == '\r'))
+ {
+ continue;
+ }
+
/* clarify data a little */
clarify_data(line);
+
trace(COMMAND_SHOW_LEVEL,"COMMAND: [%s]\n",line);
if (!(*line))