[Mailman-Users] add_members and email confirmation

Ren Bucholz ren at trubble.com
Fri Oct 28 21:19:44 CEST 2005


Thanks very much to John for his advice on this.  I've implemented it, 
and am now facing a slightly different problem.

For those just tuning in, I'm using MM 2.1.5 and trying to add new list 
subscribers via the command line (so users don't see the default MM 
templates and I have control over the UI).  I started off by using PHP 
to call add_members, which successfully subscribes a user.  It goes 
like this:

> [me at HOST]$ echo your at email.com | add_members -r - LISTNAME

I have to use echo because add_members only reads from files or 
standard input, but otherwise it works wonderfully.  The trouble is 
that no confirmation is sent to the subscriber.  John Dennis pointed 
out that add_members could be copied and hacked so that instead of 
calling ApprovedAddMember (which doesn't send a confirmation), I could 
call AddMember (which should generate a confirmation).  So I created a 
modified add_members and swapped this line:

> mlist.ApprovedAddMember(userdesc, ack, 0)

with this one:

> mlist.AddMember(userdesc, remote="Webpage")

Running the new script on the command line generates this:

> [me at HOST]$ echo your at email.com | MODIFIED_add_members -r - LISTNAME
> Traceback (most recent call last):
>   File "/usr/lib/mailman/bin/MODIFIED_add_members", line 255, in ?
>     main()
>   File "/usr/lib/mailman/bin/MODIFIED_add_members", line 235, in main
>     addall(mlist, nmembers, 0, send_welcome_msg, s)
>   File "/usr/lib/mailman/bin/MODIFIED_add_members", line 135, in addall
>     mlist.AddMember(userdesc, remote="Webpage")
>   File "/usr/lib/mailman/Mailman/MailList.py", line 888, in AddMember
>     raise Errors.MMSubscribeNeedsConfirmation
> MMSubscribeNeedsConfirmation

Strangest of all, a confirmation message *is* generated and sent to the 
email address, but clicking on the confirmation link just sends me to a 
MM error page.  I'm at a loss as to what the problem might be.

Thanks to anyone who made it this far.  And quadruple thanks to anyone 
who can help.  I appreciate it!

-Ren



On Oct 21, 2005, at 2:41 PM, John Dennis wrote:

> On Fri, 2005-10-21 at 14:23 -0400, Ren Bucholz wrote:
>> Hello,
>>
>> I have a signup sheet that subscribes people to a Mailman list by 
>> using PHP to call add_members (the PHP is below, FYI).  My problem is 
>> that add_members seems to ignore the email confirmation settings from 
>> the admin interface.  Even though my list is configured to send a 
>> confirmation message, subscribers only get the "Thanks for signing 
>> up!" email.
>>
>> Does anyone know of a way to use add_members in a confirmed-opt-in 
>> list?  Thanks very much!
>
> Not is its current manifestation. The reason is that manual adding of 
> members assumes this is an approved action. You have two choices:
>
> 1) redirect them to the signup page for the list (this has the 
> advantage of allowing the user to set some preferences and see some 
> basic info).
>
> 2) Copy the add_members script to a new name and edit it so that it 
> calls AddMember instead of AddApprovedMember. See Mailman/Cgi 
> subscribe.py for an example of how to do this and the various 
> exceptions you'll have to catch and handle.
> -- 
> John Dennis <jdennis at redhat.com>
>




More information about the Mailman-Users mailing list