Dňa 15. júla 2024 7:26:06 UTC používateľ Grand Master via Exim-users <exim-users@lists.exim.org> napísal:
># condition = ${if >match{${extract{1}{:}{${lookup{$sender_address}lsearch{/usr/local/etc/exim/db/known}}}}}{no} >{yes}{no}} lsearch will not work, it is "literaly search", looking of exact key match >## condition = ${if >eq{${extract{2}{:}{${lookup{$acl_c_reverse_address}wildlsearch{/usr/local/etc/exim/db/known}}}}}{no} >{yes}{ wildlsearch is better, but looking a PTR name must fail, as @ is not expected in it. >file /usr/local/etc/exim/db/known >*@company.com:\N^mail\-[a-z0-9]+\-[a-z0-9]+\.google\.com$\N >*@company2.com >:\N^[A-Z0-9]+\-[A-Z0-9]+\-obe\.outbound\.protection\.outlook\.com$\N The DB file is key & value pair, separated by colon or whitespace, in your first line the key is "*@company.com" and value is rest of line (after colon). Thus your ${extract ...} is wrong and i am not sure if regexp value in match is expanded at all. >please note I am not looking for a solution to the problem, but only a way >to create a test condition The solution lies in two things, you have to read docs about lookups, and then learn how it works by "exim -be", ideally with appropriate debug options (eg. -d-all+expand+lists). Do it in step by step manner, first learn how to use lookup(s) to find key/get value, and then how to do someting with that value. I afraid, that even after you will fix the syntax, it will not work, and i would try to construct lookup key in some format (beware on colon), something as: lookup{$sender_address;$acl_ptrname} ... And then wrote proper key regex in DB, without values, just using yes/no as result. 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/