summaryrefslogtreecommitdiff
path: root/Mailman/Commands
diff options
context:
space:
mode:
authortkikuchi2005-08-28 05:31:27 +0000
committertkikuchi2005-08-28 05:31:27 +0000
commit067dc15b2432bb285ab5e4a3eac6f4dddd67ed19 (patch)
treeceac72251ee33742bfff7626c99dde163d3da946 /Mailman/Commands
parentbc1dad4f90a26ade7c4dd6d2863de88856e8b4b6 (diff)
downloadmailman-067dc15b2432bb285ab5e4a3eac6f4dddd67ed19.tar.gz
mailman-067dc15b2432bb285ab5e4a3eac6f4dddd67ed19.tar.zst
mailman-067dc15b2432bb285ab5e4a3eac6f4dddd67ed19.zip
back porting from 2.1.6
Diffstat (limited to 'Mailman/Commands')
-rw-r--r--Mailman/Commands/cmd_confirm.py3
-rw-r--r--Mailman/Commands/cmd_password.py6
-rw-r--r--Mailman/Commands/cmd_set.py20
-rw-r--r--Mailman/Commands/cmd_subscribe.py11
4 files changed, 28 insertions, 12 deletions
diff --git a/Mailman/Commands/cmd_confirm.py b/Mailman/Commands/cmd_confirm.py
index e0e7b1c19..6574355d7 100644
--- a/Mailman/Commands/cmd_confirm.py
+++ b/Mailman/Commands/cmd_confirm.py
@@ -67,6 +67,9 @@ your email address?"""))
res.results.append(_("""\
You were not invited to this mailing list. The invitation has been discarded,
and both list administrators have been alerted."""))
+ except Errors.MMBadPasswordError:
+ res.results.append(_("""\
+Bad approval password given. Held message is still being held."""))
else:
if ((results[0] == Pending.SUBSCRIPTION and mlist.send_welcome_msg)
or
diff --git a/Mailman/Commands/cmd_password.py b/Mailman/Commands/cmd_password.py
index 4d0a8e3e0..19093c0c4 100644
--- a/Mailman/Commands/cmd_password.py
+++ b/Mailman/Commands/cmd_password.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002 by the Free Software Foundation, Inc.
+# Copyright (C) 2002-2004 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -49,6 +49,8 @@ def process(res, args):
if mlist.isMember(address):
password = mlist.getMemberPassword(address)
res.results.append(_('Your password is: %(password)s'))
+ # Prohibit multiple password retrievals.
+ return STOP
else:
listname = mlist.real_name
res.results.append(
@@ -62,6 +64,8 @@ def process(res, args):
if mlist.isMember(address):
password = mlist.getMemberPassword(address)
res.results.append(_('Your password is: %(password)s'))
+ # Prohibit multiple password retrievals.
+ return STOP
else:
listname = mlist.real_name
res.results.append(
diff --git a/Mailman/Commands/cmd_set.py b/Mailman/Commands/cmd_set.py
index b29095e6f..c68a9067d 100644
--- a/Mailman/Commands/cmd_set.py
+++ b/Mailman/Commands/cmd_set.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002 by the Free Software Foundation, Inc.
+# Copyright (C) 2002-2003 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -292,10 +292,16 @@ class SetCommands:
status = self._status(res, args[0])
if status < 0:
return STOP
- # sense is reversed
- mlist.setMemberOption(self.__address, mm_cfg.DisableDelivery,
- not status)
- res.results.append(_('delivery option set'))
+ # Delivery status is handled differently than other options. If
+ # status is true (set delivery on), then we enable delivery.
+ # Otherwise, we have to use the setDeliveryStatus() interface to
+ # specify that delivery was disabled by the user.
+ if status:
+ mlist.setDeliveryStatus(self.__address, MemberAdaptor.ENABLED)
+ res.results.append(_('delivery enabled'))
+ else:
+ mlist.setDeliveryStatus(self.__address, MemberAdaptor.BYUSER)
+ res.results.append(_('delivery disabled by user'))
def set_myposts(self, res, args):
mlist = res.mlist
@@ -308,7 +314,7 @@ class SetCommands:
mlist.setMemberOption(self.__address, mm_cfg.DontReceiveOwnPosts,
not status)
res.results.append(_('myposts option set'))
-
+
def set_hide(self, res, args):
mlist = res.mlist
if len(args) <> 1:
@@ -343,7 +349,7 @@ class SetCommands:
mlist.setMemberOption(self.__address, mm_cfg.SuppressPasswordReminder,
not status)
res.results.append(_('reminder option set'))
-
+
def process(res, args):
diff --git a/Mailman/Commands/cmd_subscribe.py b/Mailman/Commands/cmd_subscribe.py
index ee4b75a65..a653158a3 100644
--- a/Mailman/Commands/cmd_subscribe.py
+++ b/Mailman/Commands/cmd_subscribe.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002 by the Free Software Foundation, Inc.
+# Copyright (C) 2002-2005 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -84,9 +84,12 @@ def process(res, args):
res.results.append(_('No valid address found to subscribe'))
return STOP
# Watch for encoded names
- h = make_header(decode_header(realname))
- # BAW: in Python 2.2, use just unicode(h)
- realname = h.__unicode__()
+ try:
+ h = make_header(decode_header(realname))
+ # BAW: in Python 2.2, use just unicode(h)
+ realname = h.__unicode__()
+ except UnicodeError:
+ realname = u''
# Coerce to byte string if uh contains only ascii
try:
realname = realname.encode('us-ascii')