Text Attachements within HTML mails

Hi,

We are experiencing some inconvenient with RT 3.8.8 and text attachements.

When a text only mail containing a text/plain attachment is replied
upon everything is fine and the attachment is not shown
in the reply message box, however, for text/html message the first
attached text/plain file is used, instead of the inlined text/plain
which is quite problematic when there is an 1Mb attached text file =>
FF hang during a long time :frowning:

Also there is a small patch so that big text attachements, marked as
attachemnt are not marked as
"not shown because too large" but as “not shown because not inlined”:

— Ticket/Elements/ShowTransactionAttachments.org 2010-11-04
12:18:01.141242000 +0100
+++ Ticket/Elements/ShowTransactionAttachments 2010-11-04
12:18:16.057536000 +0100
@@ -154,7 +154,11 @@
# If it’s text
if ( $message->ContentType =~ m{^(text|message)}i ) {
my $max_size = RT->Config->Get( ‘MaxInlineBody’,
$session{‘CurrentUser’} );

  •    if ( $message->Filename &&
    

RT->Config->Get(‘SuppressInlineTextFiles’, $session{‘CurrentUser’} ) )
{

  •    if ( $disposition ne 'inline' ) {
    
  •        $m->out('<p>'. loc( 'Message body is not shown because
    

sender requested not to inline it.’ ) .’

’);
  •        return;
    
  •    }
    
  •    elsif ( $message->Filename &&
    

RT->Config->Get(‘SuppressInlineTextFiles’, $session{‘CurrentUser’} ) )
{
$m->out(’

’. loc( ‘Text file is not shown because it is
disabled in preferences.’ ) .’

’);
return;
}
@@ -162,10 +166,6 @@
$m->out(’

’. loc( ‘Message body not shown because it is
too large.’ ) .’

’);
return;
}
  •    elsif ( $disposition ne 'inline' ) {
    
  •        $m->out('<p>'. loc( 'Message body is not shown because
    

sender requested not to inline it.’ ) .’

’);
  •        return;
    
  •    }
    
      if (

Hi,

We are experiencing some inconvenient with RT 3.8.8 and text attachements.

When a text only mail containing a text/plain attachment is replied
upon everything is fine and the attachment is not shown
in the reply message box, however, for text/html message the first
attached text/plain file is used, instead of the inlined text/plain
which is quite problematic when there is an 1Mb attached text file =>
FF hang during a long time :frowning:

Here is my current fix for this:

— lib/RT/Transaction_Overlay.pm 2010-11-04 13:07:40.254934000 +0100
+++ local/lib/RT/Transaction_Overlay.pm 2010-11-04 13:02:06.572761000 +0100
@@ -415,6 +415,15 @@
elsif ( $Attachment->ContentType =~ ‘^multipart/’ ) {
my $plain_parts = $Attachment->Children;
$plain_parts->ContentType( VALUE => $args{Type} );

  •   my %args = (
    
  •           VALUE           => 'NULL',
    
  •           OPERATOR        => 'IS',
    
  •           ENTRYAGGREGATOR => 'AND',
    
  •           @_
    
  •   );
    
  •   $plain_parts->Limit ( %args, FIELD => 'Filename' );
       $plain_parts->LimitNotEmpty;
    
       # If we actully found a part, return its content