
Kenneth Porter wrote:
I made some tweaks and discovered it won't work with a list with a dash in the name, due to the regex used to extract the action suffix. Can someone more nimble with regex let me know how to adjust it?
<http://matureasskickers.net/MISC/mm-handler.experimental>
I also changed the "printf STDERR" to syslog to my maillog.
Here's the before/after regex:
< if ($addr =~ /(.*)-(.*)\+.*$/) {
if ($addr =~ /(.*)-([^-]+)\+.*$/) {
Actually, all the regexps are 'wrong' in that they will parse a local_part such as my-list into a listname of 'my' and a suffix of 'list' ($list and $cmd in the terminology of the module). The original contrib/mm_handler recovered from that by saying if the suffix didn't match something in the @validfields array, then the listname was the whole thing and the command was 'post'
The revised version appears to do a similar thing, so I'm not sure what the problem is.
Can you be more specific about the list name and the failure? I.e., what is the local_part of the address that fails and what does split_addr(local_part) return (or what error is logged)?
BTW, the old regexps from contrib/mm-handler
/(.*)-(.*)\+.*$/ and /(.*)-(.*)$/
and the new regexps
/(.*)-([^-]+)\+.*$/ and /(.*)-([^-]+)$/
are virtually equivalent. The only difference is they require at least one character in the second group. The fact that they don't allow a '-' in the second group is irrelevant since the first group is greedy and will eat up all but the last '-' anyway.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan