[request-tracker-maintainers] Bug#674865: Bug#674865: request-tracker3.8: Cannot send mail after DSA-2480
Dominic Hargreaves
dom at earth.li
Mon May 28 11:55:09 UTC 2012
merge 674522 674865
thanks
On Mon, May 28, 2012 at 09:47:52PM +1000, Paul Szabo wrote:
> Since the
> http://www.debian.org/security/2012/dsa-2480
> update, my RT is not sending email but logging:
>
> May 28 11:46:07 prt sendmail[2531]: q4S1k7vj002531: collect: premature EOM: Bad file descriptor
> May 28 11:46:07 prt sendmail[2531]: q4S1k7vj002531: from=www-data, size=0, class=0, nrcpts=0, msgid=<201205280146.q4S1k7vj002531 at prt.pc.maths.usyd.edu.au>, relay=www-data at localhost
This should be addressed shortly in an erratum DSA; see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=674522
for more details.
Cheers,
Dominic.
> # 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-28 21:34:51.000000000 +1000
> @@ -443,28 +443,38 @@
> }
>
> 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\n";
> + my $tmp_fn = $tmp_fh->filename or die "Nameless temp file for sendmail data\n";
> + $args{'Entity'}->print($tmp_fh) or die "Cannot write temp file for sendmail data\n";
> + close ($tmp_fh) or die "Cannot close temp file for sendmail data\n";
> + my $cmd = "$path @args < $tmp_fn 2>&1 || echo \"Sendmail failed, status \$?\"";
> + #$RT::Logger->info( "PSz using command: $cmd" );
> + my $msg = `$cmd`; die "$msg\n" if $msg;
> + unlink ($tmp_fn) or die "Cannot delete temp file for sendmail data\n";
> };
> if ( $@ ) {
> $RT::Logger->crit( "$msgid: Could not send mail with command `$path @args`: " . $@ );
--
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)
More information about the pkg-request-tracker-maintainers
mailing list