sievelib icon indicating copy to clipboard operation
sievelib copied to clipboard

Brackets around date

Open Abyss777 opened this issue 4 months ago • 0 comments

Hello

Here is a code example

    fs.require("date")
    fs.require("relational")
    fs.require("vacation")
    conditions = [
        ("currentdate", ":zone", "+0500", ":value", "ge", "date", "2026-01-01"),
        ("currentdate", ":zone", "+0500", ":value", "le", "date", "2026-01-31")
    ]

    actions = [("vacation", ":days", 1, ":addresses", "[email protected]", ":from", "<[email protected]>", ":subject", "Отпуск январь", "Нахожусь в отпуске с 01.01.2026 по 31.01.2026" ),]


    fs.addfilter("[Вне офиса]", conditions, actions, "allof")

Get result

require ["date", "relational", "vacation"];

# rule:[Вне офиса]
if allof (currentdate :zone "+0500" :value "ge" "date" ["2026-01-01"], currentdate :zone "+0500" :value "le" "date" ["2026-01-31"]) {
    vacation :subject "Отпуск январь" :days 1 :from "<[email protected]>" :addresses "[email protected]" "Нахожусь в отпуске с 01.01.2026 по 31.01.2026";
}

The result has square brackets around dates, but I do not see any brackets in RFC5260 examples What is the right behavior?

Abyss777 avatar Jan 15 '26 13:01 Abyss777