summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2002-10-20 15:39:46 +0000
committerbwarsaw2002-10-20 15:39:46 +0000
commit0b33525a4f24d3f723dc791ab7acddbb10dea200 (patch)
tree6f0ad5c0640db5d984684f6f20aaffc6d2ec0a87
parent8073edc7b37421b5536f6b70363169e333ecf4f1 (diff)
downloadmailman-0b33525a4f24d3f723dc791ab7acddbb10dea200.tar.gz
mailman-0b33525a4f24d3f723dc791ab7acddbb10dea200.tar.zst
mailman-0b33525a4f24d3f723dc791ab7acddbb10dea200.zip
dolist(): Add a check for consistency between the bounce_info and
delivery_status, as necessary for cron/disabled. Some older betas (alphas?) could have a situation where an address is disabled BYBOUNCE but there was no bounce information available. The "fix" is to re-enable such addresses. There should be almost none that fall into this category, but I think it's fine to re-enable them and let the normal bounce processing re-disable them in the normal way. Also, some minor formatting change and whitespace normalization.
-rwxr-xr-xbin/update33
1 files changed, 28 insertions, 5 deletions
diff --git a/bin/update b/bin/update
index 6164ebe66..da1031693 100755
--- a/bin/update
+++ b/bin/update
@@ -6,14 +6,14 @@
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
+# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""Perform all necessary upgrades.
@@ -48,6 +48,8 @@ from Mailman import MailList
from Mailman.LockFile import TimeOutError
from Mailman.i18n import _
from Mailman.Queue.Switchboard import Switchboard
+from Mailman.OldStyleMemberships import OldStyleMemberships
+from Mailman.MemberAdaptor import BYBOUNCE, ENABLED
FRESH = 0
NOTFRESH = -1
@@ -176,7 +178,7 @@ def move_language_templates(mlist):
if gcksum == tcksum:
os.unlink(os.path.join(mm_cfg.TEMPLATE_DIR,
gtemplate + '.prev'))
-
+
def dolist(listname):
@@ -189,6 +191,26 @@ def dolist(listname):
'%(listname)s')
return 1
+ # Sanity check the invariant that every BYBOUNCE disabled member must have
+ # bounce information. Some earlier betas broke this. BAW: we're
+ # submerging below the MemberAdaptor interface, so skip this if we're not
+ # using OldStyleMemberships.
+ if isinstance(mlist._memberadaptor, OldStyleMemberships):
+ noinfo = {}
+ for addr, (reason, when) in mlist.delivery_status.items():
+ if reason == BYBOUNCE and not mlist.bounce_info.has_key(addr):
+ noinfo[addr] = reason, when
+ # What to do about these folks with a BYBOUNCE delivery status and no
+ # bounce info? This number should be very small, and I think it's
+ # fine to simple re-enable them and let the bounce machinery
+ # re-disable them if necessary.
+ n = len(noinfo)
+ if n > 0:
+ print _(
+ 'Resetting %(n)s BYBOUNCEs disabled addrs with no bounce info')
+ for addr in noinfo.keys():
+ mlist.setDeliveryStatus(addr, ENABLED)
+
# Update the held requests database
print _("""Updating the held requests database.""")
mlist._UpdateRecords()
@@ -274,7 +296,7 @@ script.
print _("""\
looks like you have a really recent CVS installation...
you're either one brave soul, or you already ran me""")
-
+
#
# move public archive mbox there if it's around
@@ -422,6 +444,7 @@ If your archives are big, this could take a minute or two...""")
for listname in listnames:
print _('Updating mailing list: %(listname)s')
errors = errors + dolist(listname)
+ print
print _('Updating Usenet watermarks')
wmfile = os.path.join(mm_cfg.DATA_DIR, 'gate_watermarks')
try: