mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Fix Sieve math-type and comparator handling
This commit is contained in:
parent
92a6027aa0
commit
3893849d21
12 changed files with 128 additions and 48 deletions
|
|
@ -58,13 +58,33 @@ export const
|
|||
serverErrorDesc(text);
|
||||
},
|
||||
|
||||
getComparators = () => ['i;ascii-casemap'],
|
||||
getComparators = (validOnly = 0) => {
|
||||
let result = [
|
||||
// Default
|
||||
'i;ascii-casemap',
|
||||
];
|
||||
if (capa.includes('relational') || !validOnly) {
|
||||
result.push('i;octet');
|
||||
}
|
||||
if (capa.includes('comparator-i;ascii-numeric') || !validOnly) {
|
||||
result.push('i;ascii-numeric');
|
||||
}
|
||||
if (capa.includes('comparator-i;unicode-casemap') || !validOnly) {
|
||||
result.push('i;unicode-casemap');
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
getMatchTypes = (validOnly = 1) => {
|
||||
let result = [':is',':contains',':matches'];
|
||||
// https://datatracker.ietf.org/doc/html/rfc6134#section-2.3
|
||||
// Only available for tests with a key_list property
|
||||
if (capa.includes('extlists') || !validOnly) {
|
||||
result.push(':list');
|
||||
}
|
||||
if (capa.includes('relational') || !validOnly) {
|
||||
result.push(':value');
|
||||
result.push(':count');
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue