[Mailman-Developers] VERP code
Edmund Lau
edlau@ucf.ics.uci.edu
Fri Oct 18 19:40:40 2002
You're absolutely right. The explanation makes a lot of sense now.
So now I'm seemingly stuck between a rock and a hard place. I've been
running stock qmail for a number of years now. qmail likes using "-" as a
delimiter. It's possible to recompile qmail to use "+" instead, but that
would break all my users' personal Email address lists. (It's the same
thing as Postfix's .forward-<ext>)
qmail has a general catch-all address. It's defined by a .qmail-default
file (or .qmail-ext-default). For instance if I had a .qmail-blah-default
in my home directory, any Email with prefix to edlau-blah- gets processed
by it. But note the trailing hyphen. I can't have a .qmail-blah+default
as qmail won't recognize it, unless there's some heavy, magical trickery.
Back to mailman, I can use a "+" as a delimiter, but there needs to be a
"-" right before it. Is there a regex that would get that? So the new
VERP_FORMAT would be '%(bounces)s-+%(mailbox)s=%(host)s'. I would assume
this is better than just matching the last "-" anyway as, like you said, a
user can have that character in their address.
Ideas?
-Ed
On Fri, 18 Oct 2002, Stonewall Ballard wrote:
> > 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