C Nulk wrote: > >What I would like to do is give the message footer attachment a name. >That way instead of seeing 'Part.002', the users will see >'Unsubscribe'. Maybe that will help, maybe not but it is one more step >to make it a little more visible for the users. I am guessing I can use >'Content-filename: <name>' to give the attachment and name. The >question is where in the code do I add the change?
There's no such header as Content-Filename:. If you want to do this by hacking code, look at Mailman/Handlers/Decorate.py. You will find two places in the code which look like if footer: mimeftr = MIMEText(footer, 'plain', lcset) mimeftr['Content-Disposition'] = 'inline' payload.append(mimeftr) That's the first. The second looks the same but is indented 4 spaces less. There are also similar "if header:" blocks, but presumably you aren't interested in those. Now as to what to do, that's a bit tricky because parts aren't expected to have names unless they are attachments, not inline, but changing the Content-Disposition: to 'attachment' will likely break the inline display in those MUAs that do it right. So I suggest an experiment. change mimeftr['Content-Disposition'] = 'inline' to mimeftr['Content-Disposition'] = 'inline; filename="List Unsub.txt"' but indented as the original in both places. You could also add another line indented at the same level as the above line mimeftr.set_param('name', 'List Unsub.txt') to set the name= parameter on the Content-Type: header. See <http://en.wikipedia.org/wiki/MIME#Content-Disposition> for example for why you might do both. Note that this article says using a name= parameter on Content-Type: INSTEAD of a filename= on Content-Disposition: is discouraged, but you would be doing both which is different. Besides, by definition you are dealing with a broken MUA if it doesn't display the 'inline' parts in line, so give it all the help you can. Of course, the name "List Unsub.txt" can be whatever you want, but a .txt extension is a good idea. -- Mark Sapiro <m...@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org