Re: [Mailman-Users] add_members and email confirmation

2005-12-10 Thread Ren Bucholz
This is a followup to an older message, but I wanted to say that Mark's 
fix worked for the error handling.  Thanks, Mark!

I'm still having a problem with the confirmations, however.  To recap, 
I'm trying to use a modified version of add_members (call it 
new_add_members) in order to subscribe people via my own webform (where 
PHP executes add_members).  I modified it because I'd like the list to 
be confirmed opt-in, but add_members assumes that the user has 
confirmed their subscription and doesn't bother with the confirmation 
message. There's a longer description of what I did in this list's 
archives, if you're interested:
   http://www.mail-archive.com/mailman-users@python.org/msg35077.html

The problem is that this script totally breaks Mailman's web 
subscription features.  The first time I run new_add_members, I get a 
seemingly normal looking confirmation.  Upon clicking the confirmation 
link, I get the Mailman's generic Sorry, We Hit A Bug! message.  And 
from that point forward, attempting to subscribe via the list's 
standard Mailman info page (foo.com/mailman/listinfo/your_list) 
generates the same error.  You can still subscribe by calling the 
unmodified add_members.  The error logs say:

admin(32487): [- Mailman Version: 2.1.5 -]
admin(32487): [- Traceback --]
admin(32487): Traceback (most recent call last):
admin(32487):   File /usr/lib/mailman/scripts/driver, line 101, in 
run_main
admin(32487): main()
admin(32487):   File /usr/lib/mailman/Mailman/Cgi/subscribe.py, line 
96, in main
admin(32487): process_form(mlist, doc, cgidata, language)
admin(32487):   File /usr/lib/mailman/Mailman/Cgi/subscribe.py, line 
176, in process_form
admin(32487): mlist.AddMember(userdesc, remote)
admin(32487):   File /usr/lib/mailman/Mailman/MailList.py, line 854, 
in AddMember
admin(32487): cookie = self.pend_new(Pending.SUBSCRIPTION, userdesc)
admin(32487):   File /usr/lib/mailman/Mailman/Pending.py, line 65, in 
pend_new
admin(32487): db = self.__load()
admin(32487):   File /usr/lib/mailman/Mailman/Pending.py, line 95, in 
__load
admin(32487): return cPickle.load(fp)
admin(32487): AttributeError: 'module' object has no attribute 
'UserDesc'
admin(32487): [- Python Information -]
admin(32487): sys.version =   2.3.4 (#1, Feb  2 2005, 11:44:49)
[GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)]

If anyone has any idea how to fix this, I'd be most appreciative.  I 
should also mention that error isn't limited to a single address - 
subscribing [EMAIL PROTECTED] via new_add_members will cause a web 
subscription for [EMAIL PROTECTED] to fail. Thanks for reading this far!

-Ren

--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=showamp;file=faq01.027.htp


Re: [Mailman-Users] add_members and email confirmation

2005-12-10 Thread Mark Sapiro
Ren Bucholz wrote:

I'm still having a problem with the confirmations, however.  To recap, 
I'm trying to use a modified version of add_members (call it 
new_add_members) in order to subscribe people via my own webform (where 
PHP executes add_members).  I modified it because I'd like the list to 
be confirmed opt-in, but add_members assumes that the user has 
confirmed their subscription and doesn't bother with the confirmation 
message. There's a longer description of what I did in this list's 
archives, if you're interested:
   http://www.mail-archive.com/mailman-users@python.org/msg35077.html

The problem is that this script totally breaks Mailman's web 
subscription features.  The first time I run new_add_members, I get a 
seemingly normal looking confirmation.  Upon clicking the confirmation 
link, I get the Mailman's generic Sorry, We Hit A Bug! message.  And 
from that point forward, attempting to subscribe via the list's 
standard Mailman info page (foo.com/mailman/listinfo/your_list) 
generates the same error.  You can still subscribe by calling the 
unmodified add_members.  The error logs say:

admin(32487): [- Mailman Version: 2.1.5 -]
admin(32487): [- Traceback --]
admin(32487): Traceback (most recent call last):
admin(32487):   File /usr/lib/mailman/scripts/driver, line 101, in 
run_main
admin(32487): main()
admin(32487):   File /usr/lib/mailman/Mailman/Cgi/subscribe.py, line 
96, in main
admin(32487): process_form(mlist, doc, cgidata, language)
admin(32487):   File /usr/lib/mailman/Mailman/Cgi/subscribe.py, line 
176, in process_form
admin(32487): mlist.AddMember(userdesc, remote)
admin(32487):   File /usr/lib/mailman/Mailman/MailList.py, line 854, 
in AddMember
admin(32487): cookie = self.pend_new(Pending.SUBSCRIPTION, userdesc)
admin(32487):   File /usr/lib/mailman/Mailman/Pending.py, line 65, in 
pend_new
admin(32487): db = self.__load()
admin(32487):   File /usr/lib/mailman/Mailman/Pending.py, line 95, in 
__load
admin(32487): return cPickle.load(fp)
admin(32487): AttributeError: 'module' object has no attribute 
'UserDesc'
snip

If anyone has any idea how to fix this, I'd be most appreciative.  I 
should also mention that error isn't limited to a single address - 
subscribing [EMAIL PROTECTED] via new_add_members will cause a web 
subscription for [EMAIL PROTECTED] to fail. Thanks for reading this far!


At this point, lists/listname/pending.pck is corrupt and has to be
removed for normal stuff to proceed.

The underlying problem is new_members defines the UserDesc class to be
empty, thus when you call

mlist.AddMember(userdesc, remote=Webpage)

userdesc is not a valid UserDesc instance for AddMember which is where
things go wrong.

I think you need to do the following in your script.

Add

from Mailman.UserDesc import UserDesc

Remove

class UserDesc: pass

It looks like that's all you need, but I haven't looked too thoroughly.

-- 
Mark Sapiro [EMAIL PROTECTED]   The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=showamp;file=faq01.027.htp


Re: [Mailman-Users] add_members and email confirmation

2005-12-10 Thread Ren Bucholz
On Dec 10, 2005, at 2:43 PM, Mark Sapiro wrote:
 At this point, lists/listname/pending.pck is corrupt and has to be
 removed for normal stuff to proceed.

Quick question before trying this fix - can I just erase pending.pck, 
or do I need to replace it with a non-corrupted version from another 
list?

Thanks!

-Ren


 Ren Bucholz wrote:

 I'm still having a problem with the confirmations, however.  To recap,
 I'm trying to use a modified version of add_members (call it
 new_add_members) in order to subscribe people via my own webform 
 (where
 PHP executes add_members).  I modified it because I'd like the list to
 be confirmed opt-in, but add_members assumes that the user has
 confirmed their subscription and doesn't bother with the confirmation
 message. There's a longer description of what I did in this list's
 archives, if you're interested:
   http://www.mail-archive.com/mailman-users@python.org/msg35077.html

 The problem is that this script totally breaks Mailman's web
 subscription features.  The first time I run new_add_members, I get a
 seemingly normal looking confirmation.  Upon clicking the confirmation
 link, I get the Mailman's generic Sorry, We Hit A Bug! message.  And
 from that point forward, attempting to subscribe via the list's
 standard Mailman info page (foo.com/mailman/listinfo/your_list)
 generates the same error.  You can still subscribe by calling the
 unmodified add_members.  The error logs say:

 admin(32487): [- Mailman Version: 2.1.5 -]
 admin(32487): [- Traceback --]
 admin(32487): Traceback (most recent call last):
 admin(32487):   File /usr/lib/mailman/scripts/driver, line 101, in
 run_main
 admin(32487): main()
 admin(32487):   File /usr/lib/mailman/Mailman/Cgi/subscribe.py, line
 96, in main
 admin(32487): process_form(mlist, doc, cgidata, language)
 admin(32487):   File /usr/lib/mailman/Mailman/Cgi/subscribe.py, line
 176, in process_form
 admin(32487): mlist.AddMember(userdesc, remote)
 admin(32487):   File /usr/lib/mailman/Mailman/MailList.py, line 854,
 in AddMember
 admin(32487): cookie = self.pend_new(Pending.SUBSCRIPTION, 
 userdesc)
 admin(32487):   File /usr/lib/mailman/Mailman/Pending.py, line 65, 
 in
 pend_new
 admin(32487): db = self.__load()
 admin(32487):   File /usr/lib/mailman/Mailman/Pending.py, line 95, 
 in
 __load
 admin(32487): return cPickle.load(fp)
 admin(32487): AttributeError: 'module' object has no attribute
 'UserDesc'
 snip

 If anyone has any idea how to fix this, I'd be most appreciative.  I
 should also mention that error isn't limited to a single address -
 subscribing [EMAIL PROTECTED] via new_add_members will cause a web
 subscription for [EMAIL PROTECTED] to fail. Thanks for reading this far!


 At this point, lists/listname/pending.pck is corrupt and has to be
 removed for normal stuff to proceed.

 The underlying problem is new_members defines the UserDesc class to be
 empty, thus when you call

 mlist.AddMember(userdesc, remote=Webpage)

 userdesc is not a valid UserDesc instance for AddMember which is where
 things go wrong.

 I think you need to do the following in your script.

 Add

 from Mailman.UserDesc import UserDesc

 Remove

 class UserDesc: pass

 It looks like that's all you need, but I haven't looked too thoroughly.

 -- 
 Mark Sapiro [EMAIL PROTECTED]   The highway is for gamblers,
 San Francisco Bay Area, Californiabetter use your sense - B. Dylan


--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=showamp;file=faq01.027.htp


Re: [Mailman-Users] add_members and email confirmation

2005-12-10 Thread Mark Sapiro
Ren Bucholz wrote:

Quick question before trying this fix - can I just erase pending.pck, 
or do I need to replace it with a non-corrupted version from another 
list?

You can just remove it. It will be recreated when needed.

-- 
Mark Sapiro [EMAIL PROTECTED]   The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=showamp;file=faq01.027.htp


Re: [Mailman-Users] add_members and email confirmation

2005-12-10 Thread Ren Bucholz
Mark is officially awesome.  This works, and now my list can be 
confirmed-opt-in.  Thanks so much!

-Ren

PS - If you want to see the final, working replacement for Add_Members, 
you can get it here:
   http://trubble.com/miscellaneous/new_add_members.txt

On Dec 10, 2005, at 2:43 PM, Mark Sapiro wrote:

 Ren Bucholz wrote:

 I'm still having a problem with the confirmations, however.  To recap,
 I'm trying to use a modified version of add_members (call it
 new_add_members) in order to subscribe people via my own webform 
 (where
 PHP executes add_members).  I modified it because I'd like the list to
 be confirmed opt-in, but add_members assumes that the user has
 confirmed their subscription and doesn't bother with the confirmation
 message. There's a longer description of what I did in this list's
 archives, if you're interested:
   http://www.mail-archive.com/mailman-users@python.org/msg35077.html

 The problem is that this script totally breaks Mailman's web
 subscription features.  The first time I run new_add_members, I get a
 seemingly normal looking confirmation.  Upon clicking the confirmation
 link, I get the Mailman's generic Sorry, We Hit A Bug! message.  And
 from that point forward, attempting to subscribe via the list's
 standard Mailman info page (foo.com/mailman/listinfo/your_list)
 generates the same error.  You can still subscribe by calling the
 unmodified add_members.  The error logs say:

 admin(32487): [- Mailman Version: 2.1.5 -]
 admin(32487): [- Traceback --]
 admin(32487): Traceback (most recent call last):
 admin(32487):   File /usr/lib/mailman/scripts/driver, line 101, in
 run_main
 admin(32487): main()
 admin(32487):   File /usr/lib/mailman/Mailman/Cgi/subscribe.py, line
 96, in main
 admin(32487): process_form(mlist, doc, cgidata, language)
 admin(32487):   File /usr/lib/mailman/Mailman/Cgi/subscribe.py, line
 176, in process_form
 admin(32487): mlist.AddMember(userdesc, remote)
 admin(32487):   File /usr/lib/mailman/Mailman/MailList.py, line 854,
 in AddMember
 admin(32487): cookie = self.pend_new(Pending.SUBSCRIPTION, 
 userdesc)
 admin(32487):   File /usr/lib/mailman/Mailman/Pending.py, line 65, 
 in
 pend_new
 admin(32487): db = self.__load()
 admin(32487):   File /usr/lib/mailman/Mailman/Pending.py, line 95, 
 in
 __load
 admin(32487): return cPickle.load(fp)
 admin(32487): AttributeError: 'module' object has no attribute
 'UserDesc'
 snip

 If anyone has any idea how to fix this, I'd be most appreciative.  I
 should also mention that error isn't limited to a single address -
 subscribing [EMAIL PROTECTED] via new_add_members will cause a web
 subscription for [EMAIL PROTECTED] to fail. Thanks for reading this far!


 At this point, lists/listname/pending.pck is corrupt and has to be
 removed for normal stuff to proceed.

 The underlying problem is new_members defines the UserDesc class to be
 empty, thus when you call

 mlist.AddMember(userdesc, remote=Webpage)

 userdesc is not a valid UserDesc instance for AddMember which is where
 things go wrong.

 I think you need to do the following in your script.

 Add

 from Mailman.UserDesc import UserDesc

 Remove

 class UserDesc: pass

 It looks like that's all you need, but I haven't looked too thoroughly.

 -- 
 Mark Sapiro [EMAIL PROTECTED]   The highway is for gamblers,
 San Francisco Bay Area, Californiabetter use your sense - B. Dylan


--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=showamp;file=faq01.027.htp


Re: [Mailman-Users] add_members and email confirmation

2005-12-10 Thread Ren Bucholz
One last caveat: following the confirmation link works, as does  
confirming your subscription once you get there.  However, *cancelling*  
your subscription from the website leads to the same We hit a bug  
message.  I'm not including the URL in my verify.txt confirmation  
message (users just have to reply), but I thought y'all might want to  
know about this outstanding issue.  Users can always ignore the  
confirmation, of course, but errors are unsettling.

Thanks again, and I'm happy to test any suggested fixes that emerge.

-Ren


On Dec 10, 2005, at 3:45 PM, Ren Bucholz wrote:

 Mark is officially awesome.  This works, and now my list can be
 confirmed-opt-in.  Thanks so much!

 -Ren

 PS - If you want to see the final, working replacement for Add_Members,
 you can get it here:
http://trubble.com/miscellaneous/new_add_members.txt

 On Dec 10, 2005, at 2:43 PM, Mark Sapiro wrote:

 Ren Bucholz wrote:

 I'm still having a problem with the confirmations, however.  To  
 recap,
 I'm trying to use a modified version of add_members (call it
 new_add_members) in order to subscribe people via my own webform
 (where
 PHP executes add_members).  I modified it because I'd like the list  
 to
 be confirmed opt-in, but add_members assumes that the user has
 confirmed their subscription and doesn't bother with the confirmation
 message. There's a longer description of what I did in this list's
 archives, if you're interested:
   http://www.mail-archive.com/mailman-users@python.org/msg35077.html

 The problem is that this script totally breaks Mailman's web
 subscription features.  The first time I run new_add_members, I get a
 seemingly normal looking confirmation.  Upon clicking the  
 confirmation
 link, I get the Mailman's generic Sorry, We Hit A Bug! message.   
 And
 from that point forward, attempting to subscribe via the list's
 standard Mailman info page (foo.com/mailman/listinfo/your_list)
 generates the same error.  You can still subscribe by calling the
 unmodified add_members.  The error logs say:

 admin(32487): [- Mailman Version: 2.1.5 -]
 admin(32487): [- Traceback --]
 admin(32487): Traceback (most recent call last):
 admin(32487):   File /usr/lib/mailman/scripts/driver, line 101, in
 run_main
 admin(32487): main()
 admin(32487):   File /usr/lib/mailman/Mailman/Cgi/subscribe.py,  
 line
 96, in main
 admin(32487): process_form(mlist, doc, cgidata, language)
 admin(32487):   File /usr/lib/mailman/Mailman/Cgi/subscribe.py,  
 line
 176, in process_form
 admin(32487): mlist.AddMember(userdesc, remote)
 admin(32487):   File /usr/lib/mailman/Mailman/MailList.py, line  
 854,
 in AddMember
 admin(32487): cookie = self.pend_new(Pending.SUBSCRIPTION,
 userdesc)
 admin(32487):   File /usr/lib/mailman/Mailman/Pending.py, line 65,
 in
 pend_new
 admin(32487): db = self.__load()
 admin(32487):   File /usr/lib/mailman/Mailman/Pending.py, line 95,
 in
 __load
 admin(32487): return cPickle.load(fp)
 admin(32487): AttributeError: 'module' object has no attribute
 'UserDesc'
 snip

 If anyone has any idea how to fix this, I'd be most appreciative.  I
 should also mention that error isn't limited to a single address -
 subscribing [EMAIL PROTECTED] via new_add_members will cause a web
 subscription for [EMAIL PROTECTED] to fail. Thanks for reading this far!


 At this point, lists/listname/pending.pck is corrupt and has to be
 removed for normal stuff to proceed.

 The underlying problem is new_members defines the UserDesc class to be
 empty, thus when you call

 mlist.AddMember(userdesc, remote=Webpage)

 userdesc is not a valid UserDesc instance for AddMember which is where
 things go wrong.

 I think you need to do the following in your script.

 Add

 from Mailman.UserDesc import UserDesc

 Remove

 class UserDesc: pass

 It looks like that's all you need, but I haven't looked too  
 thoroughly.

 --  
 Mark Sapiro [EMAIL PROTECTED]   The highway is for gamblers,
 San Francisco Bay Area, Californiabetter use your sense - B. Dylan


 --
 Mailman-Users mailing list
 Mailman-Users@python.org
 http://mail.python.org/mailman/listinfo/mailman-users
 Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
 Searchable Archives:  
 http://www.mail-archive.com/mailman-users%40python.org/
 Unsubscribe:  
 http://mail.python.org/mailman/options/mailman-users/ren%40trubble.com

 Security Policy:  
 http://www.python.org/cgi-bin/faqw-mm.py?req=showamp; 
 file=faq01.027.htp

--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 

Re: [Mailman-Users] add_members and email confirmation

2005-12-10 Thread Mark Sapiro
Ren Bucholz wrote:

One last caveat: following the confirmation link works, as does  
confirming your subscription once you get there.  However, *cancelling*  
your subscription from the website leads to the same We hit a bug  
message.  I'm not including the URL in my verify.txt confirmation  
message (users just have to reply), but I thought y'all might want to  
know about this outstanding issue.  Users can always ignore the  
confirmation, of course, but errors are unsettling.


This is a known problem - fixed in 2.1.6. See
http://sourceforge.net/tracker/index.php?func=detailaid=981188group_id=103atid=100103

-- 
Mark Sapiro [EMAIL PROTECTED]   The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=showamp;file=faq01.027.htp


Re: [Mailman-Users] add_members and email confirmation

2005-10-28 Thread Ren Bucholz
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:

 [EMAIL PROTECTED] echo [EMAIL PROTECTED] | 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:

 [EMAIL PROTECTED] echo [EMAIL PROTECTED] | 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 [EMAIL PROTECTED]


--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=showamp;file=faq01.027.htp


Re: [Mailman-Users] add_members and email confirmation

2005-10-28 Thread Mark Sapiro
Ren Bucholz wrote:

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:

 [EMAIL PROTECTED] echo [EMAIL PROTECTED] | 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.


The problem is that AddMember generates the pending subscription, the
cookie and the confirmation email and then raises
Errors.MMSubscribeNeedsConfirmation so the caller (generally,
Mailman/Cgi/subscribe.py) can catch the exception and generate the
appropriate response text. The add_members script doesn't catch this
exception, so you get the above error. You can just add

except Errors.MMSubscribeNeedsConfirmation:
print  tee, _('Sent Confirmation: %(member)s')

or maybe, if you don't actually see this output, just

except Errors.MMSubscribeNeedsConfirmation:
pass

to the excepts following the try: of the AddMember call. You probably
want to also handle the Errors.MMNeedApproval exception in case you do
this on a list where subscription requires approval.

As to why the confirmation link returned an error, I don't know why
this happened. What does Mailman's error log say?

-- 
Mark Sapiro [EMAIL PROTECTED]   The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=showamp;file=faq01.027.htp


[Mailman-Users] add_members and email confirmation

2005-10-21 Thread Ren Bucholz
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!

-Ren



=-=-=-=-=-=-=-

h2Subscription Results/h2

?php

// The path to your add_members program here:
$ADD_MEMBERS = '/your/path/to/add_members';

// The name of your mailing list:
$LIST = 'FakeList';

// The email address from the form, run through a process
// that removes nasty scripting attacks
$adrs = escapeshellcmd($_GET['email']);

// Runs the pipeline and stores the output in an array
exec(echo $adrs | $ADD_MEMBERS -r - $LIST, $output, $return_var);

// Implodes the array into a string
$msg = implode('', $output);

// Search for 'Subscribed' in $msg. Then we know if it worked or not.

if (strpos($msg, 'Subscribed') === FALSE) {
   print Crap!  Something went wrong and you were not subscribed.;
} else {
   print It worked!;
 }

?

--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=showamp;file=faq01.027.htp


Re: [Mailman-Users] add_members and email confirmation

2005-10-21 Thread John Dennis
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 [EMAIL PROTECTED]

--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=showamp;file=faq01.027.htp