From 57673384e935ba6335baf370d0cfcee7d3a5bf1b Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 15 Mar 2022 10:16:26 +0100 Subject: [PATCH] Support Sieve extension rfc6131 --- dev/Sieve/Extensions/rfc5230.js | 14 ++++++++------ dev/Sieve/README.md | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dev/Sieve/Extensions/rfc5230.js b/dev/Sieve/Extensions/rfc5230.js index 9178eb20b..85da557e9 100644 --- a/dev/Sieve/Extensions/rfc5230.js +++ b/dev/Sieve/Extensions/rfc5230.js @@ -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; } diff --git a/dev/Sieve/README.md b/dev/Sieve/README.md index 4252b5446..e1988527f 100644 --- a/dev/Sieve/README.md +++ b/dev/Sieve/README.md @@ -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