[Mailman-Developers] VERP code

Stonewall Ballard sb.list@sb.org
Fri Oct 18 13:51:01 2002


On 10/18/02 3:18 AM, "Edmund Lau" <edlau@ucf.ics.uci.edu> wrote:

> On Thu, 17 Oct 2002, Stonewall Ballard wrote:
> 
>> I'm having the same problem. All of the bounces are "unrecognized". After
>> staring at this code for a while, I don't think that we have the same
>> problem, just the same symptoms.
> 
> We might actually be having the same problem.  I get the "unrecognized"
> errors in my bounce logs too.  For instance:
> 
> Oct 16 21:57:27 2002 (32490) forwarding unrecognized, message-id:
> <DNffhMoQ10000 984b@mc5-s4.law1.hotmail.com>

My bounce problems were due to the list being locked at the time the bounces
are processed. There's something whacked in my setup and I'm trying to
figure out what it is. I did something approximating a clean install, and
the bad locks disappeared, as did the bounce processing problems.

> Yes, my VERP_FORMAT is '%(bounces)s-%(mailbox)s=%(host)s'.  However, my
> understanding is that mailman only uses this variable to generate the
> appropriate VERP string.  It's actually the VERP_REGEXP which matches when
> a bounce is received.  Mine is:
> r'^(?P<bounces>[^-]+?)-(?P<mailbox>[^=]+)=(?P<host>[^@]+)@.*$'

Yes, but you need to unambiguously split the list name from the subscriber
address, and that VERP_REGEXP will always match 'bounces' up to the first
'-', giving you the results that you see.

If you used a regexp like this:

'^(?P<bounces>.+)-(?P<mailbox>[^=]+)=(?P<host>[^@]+)@.*$'

then 'bounces' would match up to the last '-', which would work unless the
subscriber address has a '-' in it. You could at least try this for testing.

You need to use a marker character that's not going to appear in a list
name, but is a legal component of an email address. '+' is a reasonable
choice. I don't know why it's not working for you. Maybe you could try
underscore.

> But like I said earlier, the REGEXP seems fine since my error is line 155
> and the VERP_REGEXP has already been successfully matched on 151.  (If it
> had failed, it would have hit 152-153 and never get around to 155.)  To be
> sure, I made a quick driver and ran it against some known good and known
> bad VERP strings.

Yes, it does match, but at the wrong '-'.
> 
> So while it's true that extra hyphens may mess the matching up (which I do
> have lists containing it), it's rather unlikely that's the problem, esp
> since I have a list named 'test' and even that failed.

Take a look at the value of mo.group('mailbox') after the match and see if
it has something like 'bounces-person' in it. That should prove that you're
matching the string incorrectly.

 - Stoney