# HG changeset patch # User Aki Tuomi # Date 1495108791 -10800 # Node ID 7a30ce5f35b6fce6d48784d5c6f271710a89cd37 # Parent 31d2459cfcf2541b94bb25881788a6406d248cb8 virtual: Match any metadata condition The old code ignored succesful earlier matches for patterns, and stopped looking on first non-matching metadata pattern. Now it breaks on error or on first matching pattern. diff -r 31d2459cfcf2 -r 7a30ce5f35b6 src/plugins/virtual/virtual-config.c --- a/src/plugins/virtual/virtual-config.c Mon Jul 17 14:05:45 2017 +0300 +++ b/src/plugins/virtual/virtual-config.c Thu May 18 14:59:51 2017 +0300 @@ -375,7 +375,8 @@ box = mailbox_alloc(info->ns->list, info->vname, MAILBOX_FLAG_READONLY); mailbox_set_reason(box, "virtual mailbox metadata match"); for (i = 0; i < count; i++) { - if ((ret = virtual_config_box_metadata_match(box, boxes[i], error_r)) <= 0) + /* break on error or match */ + if ((ret = virtual_config_box_metadata_match(box, boxes[i], error_r)) < 0 || ret > 0) break; } mailbox_free(&box);