Skip to Content.
Sympa Menu

en - Re: [sympa-users] footers in text format?

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Miles Fidelman <address@concealed>
  • Cc: "address@concealed" <address@concealed>
  • Subject: Re: [sympa-users] footers in text format?
  • Date: Wed, 11 Aug 2010 19:29:30 -0400

Adam,

That's just plain cool. I'm not quite sure I want to modify my install - one more thing to keep track of each time a new update comes through - but very cool. Any chance you'll be submitting it upstream for inclusion in a future release?

Cheers,

Miles

Adam Bernstein wrote:
Miles --

is there some way to get a footer inserted so that it's visible whether some one is looking at an html version of a message or a text version?

This isn't exactly what you asked, but if by any chance you mean "have a footer added on all messages, whether they're sent in plaintext or in HTML format", then that is something I created in our code. To be at all compliant with netiquette and various national laws, every message really should have a footer with basic list info.

The patch is quite pretty simple: I just define a third footer type, "flex", and make it the default. Then in the routine that adds headers and footers, I first look at the Content-Type, and reset the footer type to mime or append as appropriate.

This isn't really the right way to do it, which is why I haven't submitted it officially, but it's the easiest way I saw to work with the existing Sympa code. It requires editing two lines and inserting 7.

Here's a context diff to the file List.pm:

*** List.pm Tue Apr 27 00:25:33 2010
--- List.pm.mod Tue Aug 10 10:07:51 2010
***************
*** 716,723 ****
'internal' => 1,
'group' => 'description'
},
! 'footer_type' => {'format' => ['mime','append'],
! 'default' => 'mime',
'gettext_id' => "Attachment type",
'group' => 'sending'
},
--- 716,723 ----
'internal' => 1,
'group' => 'description'
},
! 'footer_type' => {'format' => ['mime','append','flex'],
! 'default' => 'flex',
'gettext_id' => "Attachment type",
'group' => 'sending'
},
***************
*** 4463,4468 ****
--- 4463,4476 ----

## Msg Content-Type
my $content_type = $msg->head->get('Content-Type');
+
+ if ($type eq 'flex') {
+ if (!$content_type || ($content_type =~ /^text\/plain/i) || (($content_type =~ /^multipart\/mixed/i) && ($msg->parts(0)->head->get('Content-Type') =~ /^text\/plain/i))) {
+ $type = 'append';
+ }else {
+ $type = 'mime';
+ }
+ }

## MIME footer/header
if ($type eq 'append'){


--
In theory, there is no difference between theory and practice.
In<fnord> practice, there is. .... Yogi Berra





Archive powered by MHonArc 2.6.19+.

Top of Page