[Mailman-Developers] Problems with '+' addressing

Christopher Lindsey lindsey@ncsa.uiuc.edu
Thu, 11 Feb 1999 22:08:05 -0600 (CST)


I have several people subscribing to my lists with plus addressing
(i.e. lindsey+mhonarc@ncsa.uiuc.edu (in fact, I'm subscribed to this list
in the same way)).  This breaks the "Restrict Posting to List Members"
option for these accounts...

What I'm trying to do is check for the existence of a '+' in each address
in the list of subscribers, and if present, trim it and everything to
the right off before checking for a match.

Unfortunately, it appears that FindMatchingAddresses (called from
MailList.FindUser) is just passed a dictionary of list members.
Implementing the kind of check that I'd like would significantly slow
down checking for matches because it couldn't just use the poster's
address as a key anymore.

So what's the best way to do this?  Do a foreach on each key and check
for a match?  Like I said, it's slower, but it sure opens up a lot of
possibilities.  You could then do things like add regular expressions
to the list of accepted posters...  /.*\.example\.com/ would allow
postings from anyone in a given domain (not something I would recommend),
/george@example\.(org|com|net)/ would pull three lines together into
one, etc.  Not terribly useful, but what if you were to incorporate '+'
addressing checks through regexes too then?  Create a macro like :USER:
and :DOMAIN: that would be used in the regex (colons are used since they
can't be part of an address according to RFC 822)...  Then you would
have a regex like

   /:USER:\+[^@]*@:DOMAIN:/

:USER: and :DOMAIN: would be derived from the current poster, and each
entry within the list of subscribers would be compared against the
resulting regular expression (one at a time).

I think that something like the '+' addressing check would be best served
internally within Mailman (via a checkbox or whatever), but once the
engine is in place it's a lot more extensible.

Comments?  I'm willing to mess with this (although I can't guarantee
any great speed -- I just started messing with Python a couple of
days ago).

Chris