[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-28 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 Henrik Krohns changed: What|Removed |Added Resolution|--- |FIXED Status|REOPENED

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-27 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #28 from Henrik Krohns --- And now I realize that ReplaceTags does all it's replacing long before a message is even processed. It would mean lots of logic addition/changing. Sorry for the flood. I'm going to shut up now for a da

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-27 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #27 from Henrik Krohns --- (In reply to Henrik Krohns from comment #26) > PS. Has anyone noticed that many sa-update rules will break, if someone > actually changes "replace_start" and "replace_end" to something else than < > > .

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-27 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #26 from Henrik Krohns --- PS. Has anyone noticed that many sa-update rules will break, if someone actually changes "replace_start" and "replace_end" to something else than < > ... is there really any point to even allowing those

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-27 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #25 from Henrik Krohns --- Ok more brainstorming: ReplaceTags module is even named to replace TAGS. We already agreed that captured values are tags. So should we now actually use that already defined format instead? It would me

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-27 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #24 from Henrik Krohns --- (In reply to Henrik Krohns from comment #22) > invalid regexp for TEST_CAPTURE_7 'm{www\.%{HEADER(From:addr:domain)}/}': Now that I look at this argument usage more closely, it's also generating $1 var

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-27 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 Giovanni Bechis changed: What|Removed |Added CC||giova...@paclan.it --- Comment #2

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-27 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 Henrik Krohns changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-26 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 Henrik Krohns changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-22 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #20 from Henrik Krohns --- - Now uses %{TAGNAME} template format for regex matching - If any regex rule depends on undefined tag, consider the rule unrun - Allow tag names to contain underscores - Add documentation Committed rev

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-21 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #19 from Henrik Krohns --- (In reply to John Hardin from comment #18) > I like the syntax, too. > > (In reply to Henrik Krohns from comment #16) > > If a regex rule depends on a tag %{FOO} and no match is found for it, should >

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-21 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 John Hardin changed: What|Removed |Added CC||jhar...@impsec.org --- Comment #18 fr

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-21 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #17 from Loren Wilton --- > Let me know what you think. I like the syntax. It is easy to remember and write, and not clumsy. I agree that a rule with an unassigned variable must be unrun, since you rationally can't run it exce

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-21 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #16 from Henrik Krohns --- If a regex rule depends on a tag %{FOO} and no match is found for it, should we consider it as unrun? I guess so. Doesn't make much sense to try matching the literal value anyway. -- You are receiving

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-21 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #15 from Henrik Krohns --- Ok I have better proposal for regexp variable/tag templates: %{TAGNAME} body FOO /bar %{TAGNAME}/ Perlre does not interpolate % character so it's ok, also %{1,2} won't be misparsed as template, as %{[

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-21 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #14 from Henrik Krohns --- - Named capture cleanups, add tests, new PMS/set_captures, Parser/parse_captures functions (Bug 7992) - MIMEHeader: support named regex captures, add tflags multiple support, improve tests Committed re

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-20 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #13 from Henrik Krohns --- - Check %- right after regex matching, to prevent got_hit or anything else potentially messing with it in the future - Save all matches on tflags multiple rules - Remove duplicate values from matches/ta

Re: [Bug 7992] Capturing and reusing strings for matching across rules

2022-05-15 Thread Henrik K
On Sun, May 15, 2022 at 10:24:46PM +0200, Michael Storz wrote: > Well, settag supports body, rawbody, full, header and tag. It does not > support uri, because Conf.pm has > > # we don't do URI evals yet - maybe later > #if (/^uri\s+(\S+)\s+eval:(.*)$/) { > # $self->{parser}->add_test ($1,

Re: [Bug 7992] Capturing and reusing strings for matching across rules

2022-05-15 Thread Michael Storz
Am 2022-05-14 22:02, schrieb bugzilla-dae...@spamassassin.apache.org: https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #7 from Henrik Krohns --- (In reply to Michael Storz from comment #6) I think the settag command is easier to understand for the user because it is so simi

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-15 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #12 from Henrik Krohns --- (In reply to Henrik Krohns from comment #10) > But it's not possible to use the same capture name across different rules. > As the set_tag is called right after a rule is hit, a new hit will always > ov

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-15 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #11 from Henrik Krohns --- Added check_hashbl_tag function # Capture tag using SA 4.0 regex named capture feature header __X_SOME_ID X-Some-ID =~ /^(?\d{10,20})$/ # Query the tag value as is from a DNSBL header HASHBL_TAG e

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-14 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #10 from Henrik Krohns --- FYI, it's possible to capture multiple values into a capture by using the same name. echo -e "X-ESP-ID: 12345, 6\n\nHello" | \ SA_LOGGER_ESCAPE=0 spamassassin \ --cf 'header __X_ESP_ID X-ESP-ID =

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-14 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #9 from Henrik Krohns --- Now the captured value is set as a tag, which should simplify things. Committed revision 1900910. Committed revision 1900911. echo -e "X-ESP-ID: 12345\n\nHello" | \ SA_LOGGER_ESCAPE=0 spamassassin \

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-14 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #8 from Henrik Krohns --- (In reply to Michael Storz from comment #6) > The special case of the HEADER tag instead of a general way of > using tags with modifier functions is bad enough. Sorry but I don't see anything special ab

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-14 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #7 from Henrik Krohns --- (In reply to Michael Storz from comment #6) > I think the settag command is easier to understand for the user because it > is so similar to the header and body commands. But how would it even work? How

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-14 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 Michael Storz changed: What|Removed |Added CC||sa-...@lrz.de --- Comment #6 from M

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-14 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #5 from Henrik Krohns --- Further ideas: - Allow askdns to act on the same (to-be-determined) variable format as regex. askdns ESP_LOOKUP """MAILCHIMPID""".espbl.foobar.com A 127.0.0.2 - Add new HashBL functions, check_hashbl_

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-14 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #4 from Henrik Krohns --- (In reply to Henrik Krohns from comment #3) > Anything more fancy than people adjusting the rule priorities manually will > be left for someone else to do. I already went through the rabbit hole of > the

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-14 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 --- Comment #3 from Henrik Krohns --- (In reply to Loren Wilton from comment #2) > Nice. Thanks Henrik! > > I'm not sure I'm thrilled about the "" syntax to flag a name usage, but just > off the top of my head I can't think of anything that

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-14 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 Loren Wilton changed: What|Removed |Added CC||lwil...@earthlink.net --- Comment #2

[Bug 7992] Capturing and reusing strings for matching across rules

2022-05-14 Thread bugzilla-daemon
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7992 Henrik Krohns changed: What|Removed |Added Target Milestone|Undefined |4.0.0 CC|