#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
$args{'MIMEObj'} = MIME::Entity->build(
From => Encode::encode( "UTF-8", $args{'Requestor'} ),
Subject => RT::Interface::Email::EncodeToMIME( String => $args{'Subject'} ),
- Type => $args{ContentType} // "text/plain",
+ Type => (defined $args{ContentType} ? $args{ContentType} : "text/plain"),
Charset => "UTF-8",
Data => Encode::encode( "UTF-8", $content ),
);
}
sub find_executable {
- my $self = shift;
+ my ( $self, $exe ) = @_;
- return File::Which::which( @_ );
+ return File::Which::which( $exe );
}
sub diag {
require RT::EmailParser;
my $parser = RT::EmailParser->new;
$parser->ParseMIMEEntityFromScalar( $mail );
- return $parser->Entity;
+ my $entity = $parser->Entity;
+ $entity->{__store_link_to_object_to_avoid_early_cleanup} = $parser;
+ return $entity;
}
sub works {