Update of /cvsroot/mailman/mailman/Mailman/Handlers
In directory usw-pr-cvs1:/tmp/cvs-serv16697

Modified Files:
        CookHeaders.py 
Log Message:
process(): In response to bug #223533, we're changing when the RFC
2919 and 2369 headers are added.

- List-Id: is always added

- List-Post:, List-Help:, List-Subscribe:, List-Unsubscribe:, and
  List-Archive: are only added to posting messages.

- X-List-Administrivia: is only added to message Mailman creates and
  sends out of its own accord.


Index: CookHeaders.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/CookHeaders.py,v
retrieving revision 2.11
retrieving revision 2.12
diff -C2 -d -r2.11 -r2.12
*** CookHeaders.py      12 Mar 2002 00:45:12 -0000      2.11
--- CookHeaders.py      8 Apr 2002 04:28:41 -0000       2.12
***************
*** 133,143 ****
      subfieldfmt = '<%s>, <mailto:%s?subject=%ssubscribe>'
      listinfo = mlist.GetScriptURL('listinfo', absolute=1)
      headers = {
          'List-Id'         : listid,
-         'List-Help'       : '<mailto:%s?subject=help>' % requestaddr,
-         'List-Unsubscribe': subfieldfmt % (listinfo, requestaddr, 'un'),
-         'List-Subscribe'  : subfieldfmt % (listinfo, requestaddr, ''),
-         'List-Post'       : '<mailto:%s>' % mlist.GetListEmail(),
          }
      # First we delete any pre-existing headers because the RFC permits only
      # one copy of each, and we want to be sure it's ours.
--- 133,155 ----
      subfieldfmt = '<%s>, <mailto:%s?subject=%ssubscribe>'
      listinfo = mlist.GetScriptURL('listinfo', absolute=1)
+     # We always add a List-ID: header.  For internally crafted messages, we
+     # also add a (nonstandard), "X-List-Administrivia: yes" header.  For all
+     # others (i.e. those coming from list posts), we adda a bunch of other RFC
+     # 2369 headers.
      headers = {
          'List-Id'         : listid,
          }
+     if msgdata.get('reduced_list_headers'):
+         headers['X-List-Administrivia'] = 'yes'
+     else:
+         headers.update({
+             'List-Help'       : '<mailto:%s?subject=help>' % requestaddr,
+             'List-Unsubscribe': subfieldfmt % (listinfo, requestaddr, 'un'),
+             'List-Subscribe'  : subfieldfmt % (listinfo, requestaddr, ''),
+             'List-Post'       : '<mailto:%s>' % mlist.GetListEmail(),
+             })
+         # Add this header if we're archiving
+         if mlist.archive:
+             headers['List-Archive'] = mlist.GetBaseArchiveURL()
      # First we delete any pre-existing headers because the RFC permits only
      # one copy of each, and we want to be sure it's ours.
***************
*** 150,156 ****
              v = CONTINUATION.join(v.split(', '))
          msg[h] = v
-     # Always delete List-Archive header, but only add it back if the list is
-     # actually archiving
-     del msg['list-archive']
-     if mlist.archive:
-         msg['List-Archive'] = mlist.GetBaseArchiveURL()
--- 162,163 ----



_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-checkins

Reply via email to