Re: [exim] permanent error if delivery ends with segv

Top Page
Delete this message
Reply to this message
Author: Phil Pennock
Date:  
To: exim-users
Subject: Re: [exim] permanent error if delivery ends with segv
On 2006-03-22 at 15:02 +0100, Nicolas KOWALSKI wrote:
> Does this looks good enough/reliable for you ?


The only serious problem is that any Perl going into production use
really should have warnings turned on. warnings + strict. And taint,
if dealing with untrusted data. This especially applies when you're
overriding an error condition to mask a problem!

"use warnings", or "perl -w" if dealing with very old Perl (5.005 or
older).

I'll also supply the decode logic I typically, which will help you see
exactly what happened in procmail, so you can get precise logs of all
failures.

> system(@ARGV);


use constant EX_RETRY => 75;

system(@ARGV) or do {
    warn "$0: failed to execute $ARGV[0]: $!\n";
    exit EX_RETRY;
};
exit 0 if $? == 0;
my ($ex, $sig, $core) = ($? >> 8, $? & 127, $? & 128);
my $emsg = "$ARGV[0] died";
$emsg .= ", exiting $ex"    if $ex;
$emsg .= ", signal $sig"    if $sig;
$emsg .= ' (core dumped)'    if $core;


warn "$emsg\n";
exit EX_RETRY;