~launchpad-pqm/mailman/2.1

« back to all changes in this revision

Viewing changes to Mailman/ListAdmin.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2009-10-21 01:06:17 UTC
  • mfrom: (975.1.1 mailman.2112)
  • Revision ID: launchpad@pqm.canonical.com-20091021010617-prbs2ay6nhxx515v
[rs=flacoste] Upgrade Mailman to upstream 2.1.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 1998-2004 by the Free Software Foundation, Inc.
 
1
# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
2
2
#
3
3
# This program is free software; you can redistribute it and/or
4
4
# modify it under the terms of the GNU General Public License
499
499
            subject = _('Request to mailing list %(realname)s rejected')
500
500
        finally:
501
501
            i18n.set_translation(otrans)
502
 
        msg = Message.UserNotification(recip, self.GetBouncesEmail(),
 
502
        msg = Message.UserNotification(recip, self.GetOwnerEmail(),
503
503
                                       subject, text, lang)
504
504
        msg.send(self)
505
505
 
538
538
            except IOError, e:
539
539
                if e.errno <> errno.ENOENT: raise
540
540
                self.__db = {}
541
 
        for id, (op, info) in self.__db.items():
 
541
        for id, x in self.__db.items():
 
542
            # A bug in versions 2.1.1 through 2.1.11 could have resulted in
 
543
            # just info being stored instead of (op, info)
 
544
            if len(x) == 2:
 
545
                op, info = x
 
546
            elif len(x) == 6:
 
547
                # This is the buggy info. Check for digest flag.
 
548
                if x[4] in (0, 1):
 
549
                    op = SUBSCRIPTION
 
550
                else:
 
551
                    op = HELDMSG
 
552
                self.__db[id] = op, x
 
553
                continue
 
554
            else:
 
555
                assert False, 'Unknown record format in %s' % self.__filename
542
556
            if op == SUBSCRIPTION:
543
557
                if len(info) == 4:
544
558
                    # pre-2.1a2 compatibility
553
567
                    assert len(info) == 6, 'Unknown subscription record layout'
554
568
                    continue
555
569
                # Here's the new layout
556
 
                self.__db[id] = when, addr, fullname, passwd, digest, lang
 
570
                self.__db[id] = op, (when, addr, fullname, passwd,
 
571
                                     digest, lang)
557
572
            elif op == HELDMSG:
558
573
                if len(info) == 5:
559
574
                    when, sender, subject, reason, text = info
562
577
                    assert len(info) == 6, 'Unknown held msg record layout'
563
578
                    continue
564
579
                # Here's the new layout
565
 
                self.__db[id] = when, sender, subject, reason, text, msgdata
 
580
                self.__db[id] = op, (when, sender, subject, reason,
 
581
                                     text, msgdata)
566
582
        # All done
567
583
        self.__closedb()
568
584