mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-31 20:25:38 +00:00
Prevent too long uid expunge command
This commit is contained in:
parent
e8eb733303
commit
4803a1ecbd
1 changed files with 3 additions and 1 deletions
|
@ -4057,6 +4057,7 @@ class Core {
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
boolean perform_expunge = prefs.getBoolean("perform_expunge", true);
|
boolean perform_expunge = prefs.getBoolean("perform_expunge", true);
|
||||||
boolean uid_expunge = prefs.getBoolean("uid_expunge", false);
|
boolean uid_expunge = prefs.getBoolean("uid_expunge", false);
|
||||||
|
int chunk_size = prefs.getInt("chunk_size", DEFAULT_CHUNCK_SIZE);
|
||||||
|
|
||||||
if (!perform_expunge)
|
if (!perform_expunge)
|
||||||
return false;
|
return false;
|
||||||
|
@ -4086,7 +4087,8 @@ class Core {
|
||||||
@Override
|
@Override
|
||||||
public Object doCommand(IMAPProtocol protocol) throws ProtocolException {
|
public Object doCommand(IMAPProtocol protocol) throws ProtocolException {
|
||||||
// https://datatracker.ietf.org/doc/html/rfc4315#section-2.1
|
// https://datatracker.ietf.org/doc/html/rfc4315#section-2.1
|
||||||
protocol.uidexpunge(UIDSet.createUIDSets(Helper.toLongArray(uids)));
|
for (List<Long> list : Helper.chunkList(uids, chunk_size))
|
||||||
|
protocol.uidexpunge(UIDSet.createUIDSets(Helper.toLongArray(list)));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue