diff options
| author | bwarsaw | 2003-01-07 14:19:25 +0000 |
|---|---|---|
| committer | bwarsaw | 2003-01-07 14:19:25 +0000 |
| commit | 4a1b8771e9c7a7e10eb5043024dd3dc7536d1791 (patch) | |
| tree | a1af6bd20adcc05e158963d618796944ea93008a | |
| parent | d2761a2b7406a07022aa3abb2b5e6b1d39d41bd4 (diff) | |
| download | mailman-4a1b8771e9c7a7e10eb5043024dd3dc7536d1791.tar.gz mailman-4a1b8771e9c7a7e10eb5043024dd3dc7536d1791.tar.zst mailman-4a1b8771e9c7a7e10eb5043024dd3dc7536d1791.zip | |
process(): Ben Gertzfield idea to add "Content-Disposition: inline"
header to the headers and footers parts as a hint to persnickety
clients (not mentioning Outlook here) that the text should be
displayed inline instead of as attachments.
It does no harm so even if it doesn't completely fix the problem it
sounds like a good idea.
| -rw-r--r-- | Mailman/Handlers/Decorate.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Mailman/Handlers/Decorate.py b/Mailman/Handlers/Decorate.py index 5605e3215..9d9fb2a54 100644 --- a/Mailman/Handlers/Decorate.py +++ b/Mailman/Handlers/Decorate.py @@ -1,17 +1,17 @@ -# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. +# Copyright (C) 1998-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 # 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. """Decorate a message by sticking the header and footer around it. @@ -92,14 +92,16 @@ def process(mlist, msg, msgdata): elif msg.get_type() == 'multipart/mixed': # The next easiest thing to do is just prepend the header and append # the footer as additional subparts - mimehdr = MIMEText(header, 'plain', lcset) - mimeftr = MIMEText(footer, 'plain', lcset) payload = msg.get_payload() if not isinstance(payload, ListType): payload = [payload] if footer: + mimeftr = MIMEText(footer, 'plain', lcset) + mimeftr['Content-Disposition'] = 'inline' payload.append(mimeftr) if header: + mimehdr = MIMEText(header, 'plain', lcset) + mimehdr['Content-Disposition'] = 'inline' payload.insert(0, mimehdr) msg.set_payload(payload) wrap = 0 @@ -137,9 +139,11 @@ def process(mlist, msg, msgdata): payload = [inner] if header: mimehdr = MIMEText(header, 'plain', lcset) + mimehdr['Content-Disposition'] = 'inline' payload.insert(0, mimehdr) if footer: mimeftr = MIMEText(footer, 'plain', lcset) + mimeftr['Content-Disposition'] = 'inline' payload.append(mimeftr) msg.set_payload(payload) del msg['content-type'] |
