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
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.