mailman/mailman.patch

Tue, 28 Aug 2012 18:36:35 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:36:35 +0200
changeset 579
6b18bb69901e
parent 7
5443cb9b550a
child 631
08b1736686fa
permissions
-rw-r--r--

Correct the paths of patched scripts, refine password generation,
mitigate fdatasync(2) detection problems, correct dependencies, remove
outdated autoconf components, correct conf file paths and attributes,
complete and correct log file rotation handing, and note warnings
useful for diagnosing builds.

     1 Index: Mailman/Archiver/pipermail.py
     2 --- Mailman/Archiver/pipermail.py.orig	2009-02-23 22:23:35 +0100
     3 +++ Mailman/Archiver/pipermail.py	2009-03-27 11:55:18 +0100
     4 @@ -123,9 +123,10 @@
     5          if parentID is not None and self.articleIndex.has_key(parentID):
     6              parent = self.getArticle(archive, parentID)
     7              myThreadKey = (parent.threadKey + article.date + '.'
     8 -                           + str(article.sequence) + '-')
     9 +                           + str(article.sequence)
    10 +                           + '/' + article.msgid + '-')
    11          else:
    12 -            myThreadKey = article.date + '.' + str(article.sequence) + '-'
    13 +            myThreadKey = article.date + '.' + str(article.sequence) + '/' + article.msgid + '-'
    14          article.threadKey = myThreadKey
    15          key = myThreadKey, article.msgid
    16          self.setThreadKey(archive, key, article.msgid)
    17 @@ -420,7 +421,7 @@
    18                      parent = self.database.getArticle(self.archive,
    19                                                      article.parentID)
    20                      article.threadKey = (parent.threadKey + article.date + '.'
    21 -                                         + str(article.sequence) + '-')
    22 +                                         + str(article.sequence) + '/' + article.msgid + '-')
    23                  self.database.setThreadKey(self.archive,
    24                      (article.threadKey, article.msgid),
    25                      msgid)
    26 @@ -635,10 +636,10 @@
    27              if parentID:
    28                  parent = self.database.getArticle(arch, parentID)
    29                  article.threadKey = (parent.threadKey + article.date + '.'
    30 -                                     + str(article.sequence) + '-')
    31 +                                     + str(article.sequence) + '/' + article.msgid + '-')
    32              else:
    33                  article.threadKey = (article.date + '.'
    34 -                                     + str(article.sequence) + '-')
    35 +                                     + str(article.sequence) + '/' + article.msgid + '-')
    36              key = article.threadKey, article.msgid
    38              self.database.setThreadKey(arch, key, article.msgid)
    39 Index: Mailman/Commands/cmd_subscribe.py
    40 --- Mailman/Commands/cmd_subscribe.py.orig	2009-02-23 22:23:35 +0100
    41 +++ Mailman/Commands/cmd_subscribe.py	2009-03-27 11:55:18 +0100
    42 @@ -84,6 +84,7 @@
    43      if password is None:
    44          password = Utils.MakeRandomPassword()
    45      if address is None:
    46 +        h = None
    47          realname, address = parseaddr(res.msg['from'])
    48          if not address:
    49              # Fall back to the sender address
    50 Index: Mailman/HTMLFormatter.py
    51 --- Mailman/HTMLFormatter.py.orig	2009-02-23 22:23:35 +0100
    52 +++ Mailman/HTMLFormatter.py	2009-03-27 11:55:18 +0100
    53 @@ -44,7 +44,7 @@
    54          realname = self.real_name
    55          hostname = self.host_name
    56          listinfo_link  = Link(self.GetScriptURL('listinfo'), realname).Format()
    57 -        owner_link = Link('mailto:' + self.GetOwnerEmail(), ownertext).Format()
    58 +        owner_link = Link('mailto:' + self.GetOwnerEmail(), realname + '-owner').Format()
    59          innertext = _('%(listinfo_link)s list run by %(owner_link)s')
    60          return Container(
    61              '<hr>',
    62 Index: Mailman/Handlers/Decorate.py
    63 --- Mailman/Handlers/Decorate.py.orig	2009-02-23 22:23:35 +0100
    64 +++ Mailman/Handlers/Decorate.py	2009-03-27 11:55:18 +0100
    65 @@ -205,6 +205,7 @@
    66      del msg['content-transfer-encoding']
    67      del msg['content-disposition']
    68      msg['Content-Type'] = 'multipart/mixed'
    69 +    msg['Mime-version'] = '1.0'
    73 Index: Mailman/Handlers/Scrubber.py
    74 --- Mailman/Handlers/Scrubber.py.orig	2009-02-23 22:23:35 +0100
    75 +++ Mailman/Handlers/Scrubber.py	2009-03-27 11:55:18 +0100
    76 @@ -368,6 +368,8 @@
    77                      t = unicode(t, 'ascii', 'replace')
    78                  try:
    79                      # Should use HTML-Escape, or try generalizing to UTF-8
    80 +                    if len(charset) == 0:
    81 +                        charset = 'us-ascii'
    82                      t = t.encode(charset, 'replace')
    83                  except (UnicodeError, LookupError, ValueError,
    84                          AssertionError):
    85 Index: Mailman/Queue/OutgoingRunner.py
    86 --- Mailman/Queue/OutgoingRunner.py.orig	2009-02-23 22:23:35 +0100
    87 +++ Mailman/Queue/OutgoingRunner.py	2009-03-27 11:55:18 +0100
    88 @@ -89,6 +89,7 @@
    89                  syslog('error', 'Cannot connect to SMTP server %s on port %s',
    90                         mm_cfg.SMTPHOST, port)
    91                  self.__logged = True
    92 +            self._snooze(0)
    93              return True
    94          except Errors.SomeRecipientsFailed, e:
    95              # Handle local rejects of probe messages differently.
    96 Index: Mailman/htmlformat.py
    97 --- Mailman/htmlformat.py.orig	2009-02-23 22:23:35 +0100
    98 +++ Mailman/htmlformat.py	2009-03-27 11:55:18 +0100
    99 @@ -300,7 +300,8 @@
   100          charset = 'us-ascii'
   101          if self.language:
   102              charset = Utils.GetCharSet(self.language)
   103 -        output = ['Content-Type: text/html; charset=%s\n' % charset]
   104 +        output = ['Content-Type: text/html; charset=%s' % charset]
   105 +        output.append('Cache-control: no-cache\n')
   106          if not self.suppress_head:
   107              kws.setdefault('bgcolor', self.bgcolor)
   108              tab = ' ' * indent
   109 Index: bin/check_perms
   110 --- bin/check_perms.orig	2009-02-23 22:23:35 +0100
   111 +++ bin/check_perms	2009-03-27 11:55:18 +0100
   112 @@ -82,7 +82,7 @@
   113      return os.stat(path)[ST_MODE]
   115  def statgidmode(path):
   116 -    stat = os.stat(path)
   117 +    stat = os.lstat(path)
   118      return stat[ST_MODE], stat[ST_GID]
   120  seen = {}
   121 Index: bin/config_list
   122 --- bin/config_list.orig	2009-02-23 22:23:35 +0100
   123 +++ bin/config_list	2009-03-27 11:55:18 +0100
   124 @@ -307,6 +307,11 @@
   125                                      in mm_cfg.OPTINFO.items()
   126                                      if validval & bitval]
   127                      gui._setValue(mlist, k, validval, fakedoc)
   128 +                    # Ugly hack, but seems to be needed since
   129 +                    # new_member_options isn't really a number in gui.
   130 +                    # -- tfheen, 2003-12-06
   131 +                    if k == "new_member_options":
   132 +                        mlist.new_member_options = validval
   133              # BAW: when to do gui._postValidate()???
   134      finally:
   135          if savelist and not checkonly:
   136 Index: bin/mailmanctl
   137 --- bin/mailmanctl.orig	2009-02-23 22:23:35 +0100
   138 +++ bin/mailmanctl	2009-03-27 11:55:18 +0100
   139 @@ -424,6 +424,12 @@
   140          os.dup2(devnull, 1)
   141          os.dup2(devnull, 2)
   143 +        # Be sure to close any open std{in,out,err}
   144 +        devnull = os.open('/dev/null', 0)
   145 +        os.dup2(devnull, 0)
   146 +        os.dup2(devnull, 1)
   147 +        os.dup2(devnull, 2)
   148 +
   149          # Instead of cd'ing to root, cd to the Mailman installation home
   150          os.chdir(mm_cfg.PREFIX)
   151          # Set our file mode creation umask
   152 Index: bin/newlist
   153 --- bin/newlist.orig	2009-02-23 22:23:35 +0100
   154 +++ bin/newlist	2009-03-27 11:58:07 +0100
   155 @@ -88,12 +88,16 @@
   156  defined in your Defaults.py file or overridden by settings in mm_cfg.py).
   158  Note that listnames are forced to lowercase.
   159 +
   160 +The list admin address need to be a fully-qualified address, like
   161 +owner@example.com, not just owner.
   162  """
   164  import sys
   165  import os
   166  import getpass
   167  import getopt
   168 +import grp
   170  import paths
   171  from Mailman import mm_cfg
   172 @@ -122,6 +126,9 @@
   175  def main():
   176 +    gid = grp.getgrnam(mm_cfg.MAILMAN_GROUP)[2]
   177 +    if os.getgid() != mm_cfg.MAILMAN_GROUP:
   178 +        os.setgid(gid)
   179      try:
   180          opts, args = getopt.getopt(sys.argv[1:], 'hql:u:e:',
   181                                     ['help', 'quiet', 'language=',
   182 @@ -204,7 +211,7 @@
   183          except Errors.BadListNameError, s:
   184              usage(1, _('Illegal list name: %(s)s'))
   185          except Errors.EmailAddressError, s:
   186 -            usage(1, _('Bad owner email address: %(s)s'))
   187 +            usage(1, _('Bad owner email address: %(s)s.  Owner addresses need to be fully-qualified names, like "owner@example.com", not just "owner".'))
   188          except Errors.MMListAlreadyExistsError:
   189              usage(1, _('List already exists: %(listname)s'))
   191 Index: bin/update
   192 --- bin/update.orig	2009-02-23 22:23:35 +0100
   193 +++ bin/update	2009-03-27 11:55:18 +0100
   194 @@ -554,9 +554,11 @@
   195      file20 = os.path.join(mm_cfg.DATA_DIR, 'pending_subscriptions.db')
   196      file214 = os.path.join(mm_cfg.DATA_DIR, 'pending.pck')
   197      db = None
   198 +    ver = None
   199      # Try to load the Mailman 2.0 file
   200      try:
   201          fp = open(file20)
   202 +        ver = "20"
   203      except IOError, e:
   204          if e.errno <> errno.ENOENT: raise
   205      else:
   206 @@ -568,6 +570,7 @@
   207          # Try to load the Mailman 2.1.x where x < 5, file
   208          try:
   209              fp = open(file214)
   210 +            ver = "214"
   211          except IOError, e:
   212              if e.errno <> errno.ENOENT: raise
   213          else:
   214 @@ -601,8 +604,12 @@
   215              # data[0] is the address being unsubscribed
   216              addrops_by_address.setdefault(data[0], []).append((key, val))
   217          elif op == Pending.SUBSCRIPTION:
   218 -            # data[0] is a UserDesc object
   219 -            addr = data[0].address
   220 +            if ver == "20":
   221 +                # data is tuple (emailaddr, password, digest)
   222 +                addr = data[0]
   223 +            else:
   224 +                # data[0] is a UserDesc object
   225 +                addr = data[0].address
   226              subs_by_address.setdefault(addr, []).append((key, val))
   227          elif op == Pending.RE_ENABLE:
   228              # data[0] is the mailing list's internal name
   229 Index: scripts/driver
   230 --- scripts/driver.orig	2009-02-23 22:23:35 +0100
   231 +++ scripts/driver	2009-03-27 11:55:18 +0100
   232 @@ -98,6 +98,15 @@
   233          module = getattr(pkg, scriptname)
   234          main = getattr(module, 'main')
   235          try:
   236 +            import os
   237 +            request_method = os.environ.get('REQUEST_METHOD')
   238 +            if not request_method in ['GET', 'POST', 'HEAD']:
   239 +                print "Status: 405 Method not allowed"
   240 +                print "Content-type: text/plain"
   241 +                print
   242 +                print "The method is not allowed"
   243 +                sys.exit()
   244 +                
   245              try:
   246                  sys.stderr = logger
   247                  sys.stdout = tempstdout

mercurial