Dňa 16. mája 2023 19:36:00 UTC používateľ MRob via Exim-users <exim-users@lists.exim.org> napísal: >Hi, I want to capture part of a regex match (capture group) to put in logs. >This example using subject header works but is there a better way? > >warn set acl_c_temp = ${if match{$h_Subject:}{<regex with capture >group>}{$1}{none}} > !condition = ${if eq{$acl_c_temp}{none}} > logwrite = Notice: subject match is: $acl_c_temp
Empty variable is the same as undefined: set acl_m_temp = ${if match{$h_Subject:}{<regex>}{$1}} condition = ${if def:acl_m_temp} ... Note, use acl_m_... for that, one connection can transfer multiple unrelated messages, once acl_c_... will be set, it can remain in that state for other messages in the same connection (while not in this case, but anyway). The acl_m_... will be cleared for every message for you by exim itself. regards -- Slavko https://www.slavino.sk/ -- ## subscription configuration (requires account): ## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/ ## unsubscribe (doesn't require an account): ## exim-users-unsubscr...@lists.exim.org ## Exim details at http://www.exim.org/ ## Please use the Wiki with this list - http://wiki.exim.org/