A small enhancement: currently, when a HTML message is displayed, the HMTL tags are visible, which is probably not the intended behavior.

This could be solved by stripping the tags from the message before storing them into the database, or changing line 723 in the mailarchive_view.module v1.6 in the function theme_mailarchive_view_message_body()

from:

$output = htmlentities($message->body);

to:

$output = htmlentities(strip_tags($message->body));

Stripping the tags before adding them in the database reduces the storage space and doesn't impact viewing perfomance, but of course alters the original message

Maybe this should be a configurable option ?

Comments

BartHanssens’s picture

mm, on second thought, maybe the following solution is better:

in mailarchive_view.module, function theme_mailarchive_view_message_body(),
$output .= $message->body;

in mailarchive.module _mailarchive_message_save()
- strip HTML tags (some people do send HTML mails to mailing lists...)
- decode 7bit encoded mails (think about all the accents in a French mail)
- encode the body to utf8 (since the database table should be utf8)

$body = quoted_printable_decode(strip_tags($body));
$body = utf8_encode($body);

ahoeben’s picture

Instead of filtering before insertion in the database, would it not be more Drupal-like to filter using the Drupal filter system at display-time, using a selectable filter set? Filter results will be cached, so performance-wise it would not have much impact.

jeremy’s picture

Status: Active » Fixed

Go to the administrative mailarchive configuration page and enable a Drupal filter for displaying mailarchive messages. (admin >> mailing list archives >> configure >> Message body format).

You will probably want to configure your input filter to "Escape all tags".

Anonymous’s picture

Status: Fixed » Closed (fixed)