Support Sieve extension rfc6131

This commit is contained in:
the-djmaze 2022-03-15 10:16:26 +01:00
parent b3c1723c5c
commit 57673384e9
2 changed files with 9 additions and 7 deletions

View file

@ -3,6 +3,8 @@
* https://tools.ietf.org/html/rfc6131
*/
import { capa } from 'Sieve/Utils';
import {
GrammarCommand,
GrammarNumber,
@ -16,7 +18,7 @@ export class VacationCommand extends GrammarCommand
{
super();
this._days = new GrammarNumber;
// this._seconds = new GrammarNumber;
this._seconds = new GrammarNumber;
this._subject = new GrammarQuotedString;
this._from = new GrammarQuotedString;
this.addresses = new GrammarStringList;
@ -31,10 +33,10 @@ export class VacationCommand extends GrammarCommand
toString()
{
let result = 'vacation';
if (0 < this._days.value) {
if (0 < this._seconds.value && capa.includes('vacation-seconds')) {
result += ' :seconds ' + this._seconds;
} else if (0 < this._days.value) {
result += ' :days ' + this._days;
// } else if (0 < this._seconds.value) {
// result += ' :seconds ' + this._seconds;
}
if (this._subject.length) {
result += ' :subject ' + this._subject;
@ -55,14 +57,14 @@ export class VacationCommand extends GrammarCommand
}
get days() { return this._days.value; }
// get seconds() { return this._seconds.value; }
get seconds() { return this._seconds.value; }
get subject() { return this._subject.value; }
get from() { return this._from.value; }
get handle() { return this._handle.value; }
get reason() { return this._reason.value; }
set days(int) { this._days.value = int; }
// set seconds(int) { this._seconds.value = int; }
set seconds(int) { this._seconds.value = int; }
set subject(str) { this._subject.value = str; }
set from(str) { this._from.value = str; }
set handle(str) { this._handle.value = str; }

View file

@ -20,7 +20,7 @@ https://www.iana.org/assignments/sieve-extensions/sieve-extensions.xhtml
- [x] RFC5463 ihave
- [x] RFC5490 mailbox / mboxmetadata / servermetadata
- [ ] RFC5703 enclose / extracttext / foreverypart / mime / replace
- [ ] RFC6131 vacation-seconds
- [x] RFC6131 vacation-seconds
- [ ] RFC6134 extlists
- [ ] RFC6558 convert
- [x] RFC6609 include