[Mailman-Users] Re: What regular expressions are allowed for Mailman topics?
On 5/14/22 09:58, frank.thom...@gmx.net wrote: That's what I thought, but then why does '^(OK|WARN|CRIT|UP|DOWN) ->' not lead to an email with the respective topic but '^(OK|WARN|CRIT|UP|DOWN)' does? It think this is an issue that was fixed in Mailman 2.1.19 by https://bazaar.launchpad.net/~mailman-coders/mailman/2.1/revision/1516/Mailman/Handlers/Tagger.py Prior to that the regexps for topic matches were compiled in verbose mode. You indicated in your OP that the regexp for your topic was ``` ^(OK|WARN|CRIT|UP|DOWN) -> ^(OK|WARN|CRIT|UP|DOWN) \- ``` Prior to Mailman 2.1.19, this was compiled in verbose mode. That worked if the lines were simply keywords, but if they were more complex regexps, this didn't work. The fix in 2.1.19 was to simply `or` the lines which works more as expected. In Mailman <2.1.19, that two line regexp compiled in verbose mode won't match, e.g., `OK -> anything. In fact it's simpler than that. Even the single line regexp `^(OK|WARN|CRIT|UP|DOWN) ->` compiled in verbose mode won't match because of the space, but `^(OK|WARN|CRIT|UP|DOWN)\ ->` will. Thus, this is a bug in Mailman <2.1.19, but you can work around it by `\` escaping the space or using `\s`. -- Mark Sapiro The highway is for gamblers, San Francisco Bay Area, Californiabetter use your sense - B. Dylan -- Mailman-Users mailing list -- mailman-users@python.org To unsubscribe send an email to mailman-users-le...@python.org https://mail.python.org/mailman3/lists/mailman-users.python.org/ Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/ https://mail.python.org/archives/list/mailman-users@python.org/
[Mailman-Users] Re: What regular expressions are allowed for Mailman topics?
On 5/14/2022 9:58 AM, frank.thom...@gmx.net wrote: Out Mailman version is 2.1.9 Really? 2.1.9 is over 15 years old and 30 releases behind. Don't tell me :-). But we can't influence that. We are just consumers of this service You need to start consuming a new service :). z! -- Mailman-Users mailing list -- mailman-users@python.org To unsubscribe send an email to mailman-users-le...@python.org https://mail.python.org/mailman3/lists/mailman-users.python.org/ Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/ https://mail.python.org/archives/list/mailman-users@python.org/
[Mailman-Users] Re: What regular expressions are allowed for Mailman topics?
Mark Sapiro wrote: > On 5/12/22 10:45, Frank Thommen wrote: > > Dear all, > > I'm trying to implement Mailman topics through regular expressions. > > However I'm not sure, what expression types are supported. I was trying > > * ^(OK|WARN|CRIT|UP|DOWN) -> > > * ^(OK|WARN|CRIT|UP|DOWN) - > > to catch subject lines like "OK -> CRIT some text" and "UP -> DOWN some > > text" ecc. The regexpes above don't catch these mail, even though they > > should be perfectly ok according to several regular expression testers. > > Interestingly > > * ^(OK|WARN|CRIT|UP|DOWN) > > /does/ match, but I require the trailing " ->" to discern from other, > > very similar subjects. > > I'm not sure what the asterisks are, maybe bullets? Yep. The asterisks are the bullets of a bulleted list and /not/ part of the regexp. Sorry, if my formatting was unclear in that respect. > The regexp '^(OK|WARN|CRIT|UP|DOWN) ->' should match, e.g. > Subject: OK -> anything That's exactly what I want to achieve. But this doesn't seem to work, as these mails are /not/ added to the respective topic. > > I also didn't find any reference documentation regarding the supported > > regular expression syntax. Is there any? > > https://docs.python.org/2.7/library/re.html That's what I thought, but then why does '^(OK|WARN|CRIT|UP|DOWN) ->' not lead to an email with the respective topic but '^(OK|WARN|CRIT|UP|DOWN)' does? > > Out Mailman version is 2.1.9 > > Really? 2.1.9 is over 15 years old and 30 releases behind. Don't tell me :-). But we can't influence that. We are just consumers of this service Cheers, Frank -- Mailman-Users mailing list -- mailman-users@python.org To unsubscribe send an email to mailman-users-le...@python.org https://mail.python.org/mailman3/lists/mailman-users.python.org/ Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/ https://mail.python.org/archives/list/mailman-users@python.org/
[Mailman-Users] Re: What regular expressions are allowed for Mailman topics?
On 5/12/22 10:45, Frank Thommen wrote: Dear all, I'm trying to implement Mailman topics through regular expressions. However I'm not sure, what expression types are supported. I was trying * ^(OK|WARN|CRIT|UP|DOWN) -> * ^(OK|WARN|CRIT|UP|DOWN) \- to catch subject lines like "OK -> CRIT some text" and "UP -> DOWN some text" ecc. The regexpes above don't catch these mail, even though they should be perfectly ok according to several regular expression testers. Interestingly * ^(OK|WARN|CRIT|UP|DOWN) /does/ match, but I require the trailing " ->" to discern from other, very similar subjects. I'm not sure what the asterisks are, maybe bullets? The regexp '^(OK|WARN|CRIT|UP|DOWN) ->' should match, e.g. ``` Subject: OK -> anything ``` I also didn't find any reference documentation regarding the supported regular expression syntax. Is there any? https://docs.python.org/2.7/library/re.html Out Mailman version is 2.1.9 Really? 2.1.9 is over 15 years old and 30 releases behind. -- Mark Sapiro The highway is for gamblers, San Francisco Bay Area, Californiabetter use your sense - B. Dylan -- Mailman-Users mailing list -- mailman-users@python.org To unsubscribe send an email to mailman-users-le...@python.org https://mail.python.org/mailman3/lists/mailman-users.python.org/ Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/ https://mail.python.org/archives/list/mailman-users@python.org/