use of com.zimbra.cs.mailclient.imap.ResponseText in project zm-mailbox by Zimbra.
the class ImapAppender method append.
private long append(MessageInfo mi, Literal data) throws IOException {
ImapRequest req = connection.newRequest(CAtom.APPEND, new MailboxName(mailbox));
if (mi.flags != null) {
req.addParam(mi.flags);
}
if (mi.date != null) {
req.addParam(mi.date);
}
req.addParam(data);
ResponseText rt = req.sendCheckStatus().getResponseText();
if (rt != null && rt.getCCode() == CAtom.APPENDUID) {
AppendResult ar = (AppendResult) rt.getData();
if (ar.getUid() > 0) {
return ar.getUid();
}
}
throw req.failed("APPENDUID supported but UID missing from result");
}
use of com.zimbra.cs.mailclient.imap.ResponseText in project zm-mailbox by Zimbra.
the class RemoteFolder method copyMessage.
public CopyResult copyMessage(long uid, String mbox) throws IOException {
assert isSelected();
String seq = String.valueOf(uid);
ImapRequest req = connection.newUidRequest(CAtom.COPY, seq, new MailboxName(mbox));
ResponseText rt = req.sendCheckStatus().getResponseText();
if (rt.getCCode() == CAtom.COPYUID) {
CopyResult cr = (CopyResult) rt.getData();
// Bug 36373: If COPYUID result 0 then assume that message no longer exists.
if (cr != null && cr.getToUids()[0] != 0) {
return cr;
}
}
// Message not found
return null;
}
Aggregations