Any way to simplify repeated use of same string-list?

Jeff Kletsky dovecot at allycomm.com
Fri Nov 18 00:20:20 UTC 2016


I often use the same set of header names when doing an 'address' 
comparison.
I would prefer to be able to specify that once, then re-use it in 
several places.

As an example

     set "address_mailman_fields" "\"To\", \"Cc\", \"From\", \"Errors-To\"";

     if address :domain :matches ["${address_mailman_fields}"] 
"example.com" {
         [...]
     }

     if address :domain :matches ["${address_mailman_fields}"] 
"dovecot.org" {
         [...]
     }

or the like would be quite helpful.

 From what I can tell, even though the variable interpolation *looks* 
like a string-list,
it isn't parsed as such. For example, from sieve-test output:

sieve-test(jeff): Debug: Mailbox <filename>
Opened mail UID=1 because: header "To", "Cc", "From", "Errors-To" (Cache 
file is unusable)
testing: line 27: info: DEBUG: address ["${address_mailman_fields}"] 
didn't match.

sieve-test(jeff): Debug: Mailbox <filename>
Opened mail UID=1 because: header ["To", "Cc", "From", "Errors-To"] 
(Cache file is unusable)
testing: line 34: info: DEBUG: address "[${address_mailman_fields}]" 
didn't match.


Is there any trick available to specify a string-list once, then re-use 
it throughout the script?


Thanks,


Jeff




More information about the dovecot mailing list