X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fmail%2FIMAP.java;h=8f5f3d0d26283022413a00399a68e65c9ee00d6c;hb=7c1678b4d591e1dabc4e14e7d6231f810003211d;hp=b4b3d3099432354d272d92fb7fe9b567ad17b926;hpb=2ace18f48a4bff972cd456dff6fd009571e3fb34;p=org.ibex.mail.git diff --git a/src/org/ibex/mail/IMAP.java b/src/org/ibex/mail/IMAP.java index b4b3d30..8f5f3d0 100644 --- a/src/org/ibex/mail/IMAP.java +++ b/src/org/ibex/mail/IMAP.java @@ -237,8 +237,8 @@ public class IMAP { for(Mailbox.Iterator it = selected().iterator(q); it.next(); ) { Message message = ((spec & (BODYSTRUCTURE | ENVELOPE | INTERNALDATE | FIELDS | FIELDSNOT | RFC822 | RFC822TEXT | RFC822SIZE | HEADERNOT | HEADER)) != 0) ? it.cur() : null; - int size = message == null ? 0 : message.getLength(); - client.fetch(it.imapNumber(), it.getFlags(), size, message, it.uid()); + long size = message == null ? 0 : message.getLength(); + client.fetch(it.imapNumber(), it.getFlags(), (int)size, message, it.uid()); it.setFlags(it.getFlags() & ~Mailbox.Flag.RECENT); } } @@ -310,10 +310,10 @@ public class IMAP { case EXPUNGE: selected(); api.expunge(); break; case UNSELECT: selected(); api.unselect(); selected = false; break; case CREATE: api.create(token().astring()); break; - case FETCH: selected(); fetch(((lastuid=uid) - ? Query.uid(token().set(maxn(uid))) - : Query.imapNumber(token().set(maxn(uid)))), - lastfetch=token().lx(), 0, 0, 0, uid, 0); break; + case FETCH: selected(); lastuid = uid; fetch((uid + ? Query.uid(token().set(maxn(uid))) + : Query.imapNumber(token().set(maxn(uid)))), + lastfetch=token().lx(), 0, 0, 0, uid, 0); break; case COPY: selected(); api.copy(uid ? Query.uid(token().set(maxn(uid))) : Query.imapNumber(token().set(maxn(uid))), token().astring()); break; @@ -358,7 +358,8 @@ public class IMAP { Date arrival = new Date(); Parser.Token t = token(); if (t.type == t.LIST) { flags = t.flags(); t = token(); } - if (t.type != t.QUOTED) { arrival = t.datetime(); t = token(); } + Parser.Token t2 = token(false); + if (t2 != null) { arrival = t.datetime(); t = t2; } api.append(m, flags, arrival, t.q()); break; } case STORE: { @@ -385,7 +386,10 @@ public class IMAP { return; } } catch (Server.Bad b) { println(tag==null ? "* BAD Invalid tag":(tag + " Bad " + b.toString())); Log.warn(this,b); - } catch (Server.No n) { println(tag==null?"* BAD Invalid tag":(tag+" No " + n.toString())); Log.warn(this,n); } + } catch (Server.No n) { println(tag==null?"* BAD Invalid tag":(tag+" No " + n.toString())); Log.warn(this,n); + } finally { + Log.warn(this, conn.dumpLog()+"\n"); + } } private Parser.Token[] lastfetch = null; // hack