Timestamp (Sieve test)

From Mailutils
Revision as of 21:24, 17 December 2010 by Gray (talk | contribs) (Initial revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Timestamp is a Sieve test, implemented as a loadable extension.

Syntax

  timestamp [:before / :after] <header-name: string>
             <date: datestring>

The timestamp test compares the value of a structured date header field with the given date.

If the tagged argument is :after. and the date from the header is after the specified date the result is True, otherwise, if the header date is before the given date, the result is False.

If the tagged argument is :before and the date from the header is before the specified date the result is True, otherwise, if the header date is after the given date, the result is False.

If no tagged argument is supplied, :after is assumed.

Almost any date format is understood.

Example

  request "test-timestamp";

  if timestamp :before "X-Expire-Timestamp" "now - 5 days"
    {
      discard;
    }

This program will discard the messages, if it contains a X-Expire-Timestamp whose value is a date more than 5 days older than the current date.