ジジに感謝します。あなたは私の一日を救ってくれました。私がやったことで答えを完成させてください。
STORE <<startScope>>:<<endScope>> +FLAGS (\Delete)
私の場合の本当の解決策です。私は今、次のようなものを使用しています:
private Object storeDeletion(IMAPProtocol protocol, int startID, int endID)
throws ProtocolException{
String args = Integer.toString(startID) + ":"
+ Integer.toString(endID)
+ " +FLAGS" + " (\\Deleted)";
Response[] r = protocol.command("STORE " + args, null);
int notDeleted = 0;
for (Response res : r) {
// do something here with each response, but avoid last one (summary response)
}
// dispatch remaining untagged responses
protocol.notifyResponseHandlers(r);
protocol.handleResult(r[r.length-1]);
return "" + (r.length - notDeleted - 1);
}
すべての応答を確認したくない場合は、+FLAGS.SILENT
代わりに+FLAGS
. notDeleted は、何らかの理由で削除済みとしてマークできなかったすべての問題のあるメールの for ループ内でインクリメントされます。