[Rt-commit] rt branch, 4.2-trunk, updated. rt-4.2.10-94-gaa70b41
Jesse Vincent
jesse at bestpractical.com
Wed Mar 4 03:28:48 EST 2015
The branch, 4.2-trunk has been updated
via aa70b41dd496ba66f3eebe9b59839b55fd260bc3 (commit)
via 64ce69b8a381f0aa13d3d3db2d67723775303742 (commit)
from 75b4fcd58161add76a2882f3e3cc958dbb195641 (commit)
Summary of changes:
lib/RT/Attachment.pm | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
- Log -----------------------------------------------------------------
commit aa70b41dd496ba66f3eebe9b59839b55fd260bc3
Merge: 75b4fcd 64ce69b
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Wed Mar 4 00:28:39 2015 -0800
Merge branch '4.2/contentasmime-multipart' into 4.2-trunk
* 4.2/contentasmime-multipart:
Stop putting a charset and body on multipart messages in ContentAsMIME
diff --cc lib/RT/Attachment.pm
index af9b088,70951a2..c727ea6
--- a/lib/RT/Attachment.pm
+++ b/lib/RT/Attachment.pm
@@@ -518,26 -480,25 +518,27 @@@ sub ContentAsMIME
my $entity = MIME::Entity->new();
foreach my $header ($self->SplitHeaders) {
my ($h_key, $h_val) = split /:/, $header, 2;
- $entity->head->add( $h_key, RT::Interface::Email::EncodeToMIME( String => $h_val ) );
+ $entity->head->add(
+ $h_key, $self->_EncodeHeaderToMIME($h_key, $h_val)
+ );
}
-
- # since we want to return original content, let's use original encoding
- $entity->head->mime_attr(
- "Content-Type.charset" => $self->OriginalEncoding )
- if $self->OriginalEncoding;
-
- $entity->bodyhandle(
- MIME::Body::Scalar->new( $self->OriginalContent )
- );
- if ($opts{'Children'} and not $self->IsMessageContentType) {
- my $children = $self->Children;
- while (my $child = $children->Next) {
- $entity->make_multipart unless $entity->is_multipart;
- $entity->add_part( $child->ContentAsMIME(%opts) );
+ if ($entity->is_multipart) {
+ if ($opts{'Children'} and not $self->IsMessageContentType) {
+ my $children = $self->Children;
+ while (my $child = $children->Next) {
+ $entity->add_part( $child->ContentAsMIME(%opts) );
+ }
}
+ } else {
+ # since we want to return original content, let's use original encoding
+ $entity->head->mime_attr(
+ "Content-Type.charset" => $self->OriginalEncoding )
+ if $self->OriginalEncoding;
+
+ $entity->bodyhandle(
+ MIME::Body::Scalar->new( $self->OriginalContent )
+ );
}
return $entity;
-----------------------------------------------------------------------
More information about the rt-commit
mailing list