[Dovecot] Quick question on sieve

Stephan Bosch stephan at rename-it.nl
Wed Nov 20 03:13:00 EET 2013


On 11/20/2013 1:14 AM, LuKreme wrote:
> That's good to know (and the first time I've seen a sieve example with variables.
>
> Will:
>     :matches "list-id" "*" {
>
> match the entire line after List-ID? 

yes.

> desk set "list name" "${1}" trap the first term, or is $1 the entire match to EOL?

${0} is the entire match afaik, ${1} is the first.

> If it's not the first word, is it possible to match the first word without installing the regex package with sieve? (I'm loath to install anything extra at this point)

regex is part of the main Pigeonhole distribution. A simple `require
"regex";` at the top of the script is enough to enable it.

> for example, for this list, the list-id is
>
> List-Id: Dovecot Mailing List <dovecot.dovecot.org>
>
> Which is not a good name for fileinto "$listname"

if header :matches "list-id"  "*<*>*" {
    set "listname" "${2}";
}

fileinto "${listname}";

Be careful with '.' in folder names though. For the default Maildir that
is the folder separator.

Regards,

Stephan.


More information about the dovecot mailing list