[Rt-commit] r16837 - in rt/3.8/trunk: .
alexmv at bestpractical.com
alexmv at bestpractical.com
Fri Nov 14 14:50:43 EST 2008
Author: alexmv
Date: Fri Nov 14 14:50:42 2008
New Revision: 16837
Modified:
rt/3.8/trunk/ (props changed)
rt/3.8/trunk/lib/RT/Action/SendEmail.pm
Log:
r39129 at kohr-ah: chmrr | 2008-11-14 14:50:18 -0500
* Don't attach html parts of mixed/alternative messages
Modified: rt/3.8/trunk/lib/RT/Action/SendEmail.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Action/SendEmail.pm (original)
+++ rt/3.8/trunk/lib/RT/Action/SendEmail.pm Fri Nov 14 14:50:42 2008
@@ -366,12 +366,23 @@
if ( $transaction_content_obj
&& $transaction_content_obj->ContentType =~ m{text/}i )
{
- $attachments->Limit(
- ENTRYAGGREGATOR => 'AND',
- FIELD => 'id',
- OPERATOR => '!=',
- VALUE => $transaction_content_obj->id,
- );
+ # If this was part of a multipart/alternative, skip all of the kids
+ my $parent = $transaction_content_obj->ParentObj;
+ if ($parent and $parent->Id and $parent->ContentType eq "multipart/alternative") {
+ $attachments->Limit(
+ ENTRYAGGREGATOR => 'AND',
+ FIELD => 'parent',
+ OPERATOR => '!=',
+ VALUE => $parent->Id,
+ );
+ } else {
+ $attachments->Limit(
+ ENTRYAGGREGATOR => 'AND',
+ FIELD => 'id',
+ OPERATOR => '!=',
+ VALUE => $transaction_content_obj->Id,
+ );
+ }
}
# attach any of this transaction's attachments
More information about the Rt-commit
mailing list