Add invite option to add_members script

Bug #558267 reported by athielke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Mailman
New
Undecided
Unassigned

Bug Description

This will add two options to the add_members script:
--invite-msg-file=file
-m file
  This will prepend the message in the file to the invite email that gets generated.

--invite=<y|n>
-i <y|n>
  Set to yes if you only want to invite the users to a list, instead of subscribing them.

Revision history for this message
athielke (athielke) wrote :

The file add_member_invite.patch was added: None

Revision history for this message
mylogon (mylogon-users) wrote :

Logged In: YES
user_id=1042734
Originator: NO

It invites everyone - including people who are members for me. It totally ignores the

except Errors.MMAlreadyAMember:

Revision history for this message
msapiro (msapiro-users) wrote :

Logged In: YES
user_id=1123998
Originator: NO

Actually, the patch looks quite good. There are some problems but they aren't problems with the patch.

The problem with inviting someone who is already a member is because MailList.InviteNewMember() does not test for membership before inviting. The patch would catch Errors.MMAlreadyAMember just as is done for adding, but the exception isn't thrown. The web Mailman/Cgi/admin.py gets around this by doing the test itself before inviting, but I think the proper thing is for InviteNewMember() to do it.

There is another problem in that InviteNewMember() can throw an Errors.MembershipIsBanned exception which is not caught, but this problem is in the base add_members, not the patch.

Revision history for this message
mylogon (mylogon-users) wrote :

Logged In: YES
user_id=1042734
Originator: NO

As a quick change to that section:

  try:
            if invite:
                if mlist.isMember(member):
                    raise Errors.MMAlreadyAMember
                    print >> tee, _('Already a member: %(member)s')
                else:
                    mlist.InviteNewMember(userdesc, invite_msg)
            else:
                mlist.ApprovedAddMember(userdesc, ack, 0)

This works - but still not for banned.

Revision history for this message
mylogon (mylogon-users) wrote :

Logged In: YES
user_id=1042734
Originator: NO

Now the pending.pck file is corrupt. Someone else filed a bug report:

https://sourceforge.net/tracker/?func=detail&atid=100103&aid=911648&group_id=103

AttributeError: 'module' object has no attribute 'UserDesc' Private: (?)
No
When adding members via InviteNewMember, and he/she
receives the emails asking for confirmation, this is the
message shown when clicking:

Also happens when trying to post a message to the list.

It seems the problem is UserDesc class is defined to be empty, which it should not be.

Sample Invite from Web - pending.pck:

(dp1
S'32cd3506286849a4a7f4fdef09cec7b1ed8188f3'
p2
(S'S'
(iMailman.UserDesc
UserDesc
p3
(dp4
S'language'
p5
S'en'
p6
sS'address'
p7
S'me@mydomain'
p8
sS'invitation'
p9
S'listname'
p10
sS'fullname'
p11
V
sS'password'
p12
S'ozwetuut'
p13
sS'digest'
p14
I0
sbtp15
sS'evictions'
p16
(dp17
g2
F1187031528.2229049
ssS'version'
p18

Sample from script:

(dp1
S'evictions'
p2
(dp3
S'8341fdb4bb70336aa678196525e761559f96ecc9'
p4
F1187031624.769033
ssg4
(S'S'
(i__main__
UserDesc
p5
(dp6
S'fullname'
p7
S''
sS'invitation'
p8
S'listname'
p9
sS'digest'
p10
I0
sS'address'
p11
S'me@mydomain'
p12
sbtp13
sS'version'
p14
I2
s.

It has been suggested that:

(i__main__
UserDesc

is the error.

It was suggested to change: (from a similar error) http://mail.python.org/pipermail/mailman-users/2005-December/048056.html

Add

from Mailman.UserDesc import UserDesc

Remove

class UserDesc: pass

and that seems to solve the problem.

Revision history for this message
mylogon (mylogon-users) wrote :

Logged In: YES
user_id=1042734
Originator: NO

But maybe someone else could also verify and report back...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.