1
1
I started refining my sieve rules recently and became a bit unsure about how :contains
actually works. I checked out http://sieve.mozdev.org/reference.html but it still didn't clear up the question I had.
Say I have the following rule:
if
header :contains ["List-Id", "X-Mailinglist", "X-Mailing-List"] [
"ros-dev.reactos.org",
"ros-general.reactos.org"
]
{
fileinto "Lists/ReactOS";
stop;
}
does this mean (and that would be my idea of how I want it to work) automatically that any of the listed header fields ["List-Id", "X-Mailinglist", "X-Mailing-List"]
should contain any of the given values ["ros-dev.reactos.org", "ros-general.reactos.org"]
or need I say explicitly if anyof (...)
like this?:
if anyof (
header :contains ["List-Id", "X-Mailinglist", "X-Mailing-List"] [
"ros-dev.reactos.org",
"ros-general.reactos.org"
]
)
{
fileinto "Lists/ReactOS";
stop;
}
... for this desired outcome? Or do the two lists not match each element of the first against each element of the second list anyway?
NB: I know that the comma-separated conditions are affected by anyof
and allof
respectively. So if anyof (condition1, condition2)
means (pseudo-code) if (condition1 or condition2)
and if allof (condition1, condition2)
means if (condition1 and condition2)
. Understanding this aspect is not my problem.
What I fail to understand, though, is whether anyof
and allof
respectively influence either or both of the lists in a :contains
clause. In the above example there is a list for the header fields and a list of values to match against.
Essentially the question boils down to whether or not there is a semantic difference between the two above snippets. And if not, then whether the first one means this:
if anyof (
header :contains ["List-Id", "X-Mailinglist", "X-Mailing-List"] "ros-dev.reactos.org",
header :contains ["List-Id", "X-Mailinglist", "X-Mailing-List"] "ros-general.reactos.org"
)
{
fileinto "Lists/ReactOS";
stop;
}
... or this:
if allof (
header :contains ["List-Id", "X-Mailinglist", "X-Mailing-List"] "ros-dev.reactos.org",
header :contains ["List-Id", "X-Mailinglist", "X-Mailing-List"] "ros-general.reactos.org"
)
{
fileinto "Lists/ReactOS";
stop;
}
... or something else altogether.
thanks for your time, but this is exactly the part that I understood already. I needed no clarification for that part. However, I added some more sentences in the hope that I can explain what I'm after. – 0xC0000022L – 2015-06-20T15:10:56.490