I try to filter mails by subaddress :detail parts in sieve scripts.
Goal is the usage of regex patterns as in this simple test case:
if envelope :detail :regex "to" ["^test$"]{
fileinto "Social";
stop;
}
if envelope :detail ["to"] ["test"]{
fileinto "Social";
stop;
}
Neither of both scripts work.
If I enable trace in my dovecot configuration, I can see, that the address, sieve tries to extract the detail from doesn't contain the detail part any more, while the "to"-header used for a header test in the same script does.
12: header test
12: starting `:regex' match with `i;ascii-casemap' comparator:
12: extracting `to' headers from message
12: matching value `"user+test@domain.net" <user+test@domain.net>'
12: with regex `.*blogs' [id=0] => 0
12: finishing match with result: not matched
12: jump if result is false
12: jumping to line 18
18: envelope test
18: starting `:regex' match with `i;ascii-casemap' comparator:
18: getting `to' part from message envelope
18: extracting `detail' part from address `user@domain.net'
18: finishing match with result: not matched
18: jump if result is false
18: jumping to line 22
22: envelope test
22: starting `:is' match with `i;ascii-casemap' comparator:
22: getting `to' part from message envelope
22: extracting `detail' part from address `user@domain.net'
22: finishing match with result: not matched
22: jump if result is false
22: jumping to line 32
So, what could be reasons for dovecot to cut down the detail part for envelope?