Bug#674865: request-tracker3.8: Cannot send mail after DSA-2480

May 28th, 2012 - 05:20 pm ET by paul.szabo | Report spam
Dear Dominic,


This should be addressed shortly in an erratum DSA; see
http://bugs.debian.org/cgi-bin/bugr...i?bugg4522



Sorry I did not notice that bug before I submitted mine, I guess the
title did not seem relevant...

I now slightly updated my patch (simpler cmd, neater error message),
as below. I would like to argue that my patch is "better": simpler,
and keeps STDOUT and STDERR.

Cheers, Paul

Paul Szabo psz@maths.usyd.edu.au http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics University of Sydney Australia


# diff -u /usr/share/request-tracker3.8/lib/RT/Interface/Email.pm.bak /usr/share/request-tracker3.8/lib/RT/Interface/Email.pm
/usr/share/request-tracker3.8/lib/RT/Interface/Email.pm.bak 2012-05-19 22:37:07.000000000 +1000
+++ /usr/share/request-tracker3.8/lib/RT/Interface/Email.pm 2012-05-29 06:40:37.000000000 +1000
@@ -443,28 +443,40 @@
}

eval {
- # don't ignore CHLD signal to get proper exit code
- local $SIG{'CHLD'} = 'DEFAULT';
-
- # if something wrong with $mail->print we will get PIPE signal, handle it
- local $SIG{'PIPE'} = sub { die "program unexpectedly closed pipe" };
-
- require IPC::Open2;
- my ($mail, $stdout);
- my $pid = IPC::Open2::open2( $stdout, $mail, $path, @args )
- or die "couldn't execute program: $!";
-
- $args{'Entity'}->print($mail);
- close $mail or die "close pipe failed: $!";
-
- waitpid($pid, 0);
- if ($?) {
- # sendmail exit statuses mostly errors with data not software
- # TODO: status parsing: core dump, exit on signal or EX_*
- my $msg = "$msgid: `$path @args` exited with code ". ($?>>8);
- $msg = ", interrupted by signal ". ($?&127) if $?&127;
- $RT::Logger->error( $msg );
- }
+ ## don't ignore CHLD signal to get proper exit code
+ #local $SIG{'CHLD'} = 'DEFAULT';
+ #
+ ## if something wrong with $mail->print we will get PIPE signal, handle it
+ #local $SIG{'PIPE'} = sub { die "program unexpectedly closed pipe" };
+ #
+ #require IPC::Open2;
+ #my ($mail, $stdout);
+ #my $pid = IPC::Open2::open2( $stdout, $mail, $path, @args )
+ # or die "couldn't execute program: $!";
+ #
+ #$args{'Entity'}->print($mail);
+ #close $mail or die "close pipe failed: $!";
+ #
+ #waitpid($pid, 0);
+ #if ($?) {
+ # # sendmail exit statuses mostly errors with data not software
+ # # TODO: status parsing: core dump, exit on signal or EX_*
+ # my $msg = "$msgid: `$path @args` exited with code ". ($?>>8);
+ # $msg = ", interrupted by signal ". ($?&127) if $?&127;
+ # $RT::Logger->error( $msg );
+ #}
+ #####
+ #use File::Temp; # Done above
+ my $tmp_fh = File::Temp->new() or die "Cannot create temp file for sendmail data";
+ my $tmp_fn = $tmp_fh->filename or die "Nameless temp file for sendmail data";
+ $args{'Entity'}->print($tmp_fh) or die "Cannot write temp file for sendmail data";
+ close ($tmp_fh) or die "Cannot close temp file for sendmail data";
+ my $cmd = "$path @args < $tmp_fn 2>&1";
+ #$RT::Logger->info( "PSz using command: $cmd" );
+ my $msg = `$cmd`;
+ $? and $msg .= "sendmail status: $? (exit code " . ($?>>8) . ", signal " . ($?&127) .")";
+ $msg and die "sendmail output: $msg";
+ unlink ($tmp_fn) or die "Cannot delete temp file for sendmail data";
};
if ( $@ ) {
$RT::Logger->crit( "$msgid: Could not send mail with command `$path @args`: " . $@ );



To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 1 replyReplies Make a reply

Similar topics

Replies

#1 Dominic Hargreaves
May 29th, 2012 - 01:10 pm ET | Report spam
On Tue, May 29, 2012 at 07:10:54AM +1000, wrote:
Dear Dominic,

> This should be addressed shortly in an erratum DSA; see
> http://bugs.debian.org/cgi-bin/bugr...i?bugg4522

Sorry I did not notice that bug before I submitted mine, I guess the
title did not seem relevant...

I now slightly updated my patch (simpler cmd, neater error message),
as below. I would like to argue that my patch is "better": simpler,
and keeps STDOUT and STDERR.



Hi Paul,

Thanks for your patch. However there is probably not a good reason at
this stage (much less resources from my side) to accept it in Debian
directly. If you feel that the patch is an improvement over what's
been done upstream, it may be worth joining the rt-devel mailing list
at <http://lists.bestpractical.com/cgi-...-devel>
and posting there.

Cheers,
Dominic.

Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search