[Mailman-Developers] Oops...

Jay R. Ashworth jra@baylink.com
Tue, 4 Jun 2002 19:51:59 -0400


Ok; Barry's busy closing on a house.  This time, to the list...

I'm doing some low-grade hacking on MM CVS from about last week,
trying to adapt it for some commercial mailing for a client.
(Anyone inclined to maling my ethics without asking first will be
happily consigned to /dev/null; I get more spam than you do, unless your
first name ends in 'Q'.  :-)

I've made a modified version of add_members called invite_members,
swapping ApprovedAddMember for InviteMember as suggested by Barry.

Alas, it seems to be trying to call what I suspect is a mixin from
context, something about hostile addresses.  It's giving me a
traceback; here's the dump:

Traceback (most recent call last):
  File "/appl/mailman2.1/bin/invite_members", line 289, in ?
    main()
  File "/appl/mailman2.1/bin/invite_members", line 266, in main
    addall(mlist, nmembers, 0, send_welcome_msg, s)
  File "/appl/mailman2.1/bin/invite_members", line 165, in addall
    except MMHostileAddress:
NameError: global name 'MMHostileAddress' is not defined

The only changes are the one call in invite_members, which is otherwise
identical to add_members except in it's name, and, the following slight
code modification at line 675 in MailList.py:

text = Utils.maketext(
            'invite.txt',
            {'email'      : invitee,
             'listname'   : listname,
             'hostname'   : self.host_name,
             'confirmurl' : confirmurl,
             'requestaddr': requestaddr,
             'cookie'     : cookie,
             'listowner'  : self.GetOwnerEmail(),
             }, mlist=self)
        if mm_cfg.VERP_CONFIRMATIONS:
            if mm_cfg.JRA_INVITE_SUBJECT:
                subj = mm_cfg.JRA_INVITE_SUBJECT
            else:
                subj = _(
                  'You have been invited to join the %(listname)s
mailing list')            sender = self.GetConfirmEmail(cookie)
        else:
            # Do it the old fashioned way
            subj = 'confirm ' + cookie
            sender = requestaddr

I added:

VERP_CONFIRMATIONS=1
JRA_INVITE_SUBJECT='This will be the subject line'

to mm_cfg.py.

It's probably worth noting that add_members still works fine.

Anyone got any ideas what screwy thing I've done wrong here?

Cheers,
-- jra
-- 
Jay R. Ashworth                                                jra@baylink.com
Member of the Technical Staff     Baylink                             RFC 2100
The Suncoast Freenet         The Things I Think
Tampa Bay, Florida        http://baylink.pitas.com             +1 727 647 1274

   "If you don't have a dream; how're you gonna have a dream come true?"
     -- Captain Sensible, The Damned (from South Pacific's "Happy Talk")