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

Góra strony
Delete this message
Reply to this message
Autor: Nicolas KOWALSKI
Data:  
Dla: exim-users
Temat: Re: [exim] permanent error if delivery ends with segv
Phil Pennock <exim-users@???> writes:

> On 2006-03-21 at 21:53 +0100, Nicolas KOWALSKI wrote:
>> From time to time, the procmail delivery transports fails because
>> procmail terminates with a sigsegv. Our problem is that this generates
>> a permanent error, and the original mail is lost.
>>
>> How can we change such errors as temporary ones ?
>
> Write a very small wrapper program (in C for speed, or Perl) to wrap
> the program and catch the signal, then return a normal error code.
> Exim can be configured with temp_errors to treat certain exit codes
> as temporary errors. If your program returns EX_TEMPFAIL (commonly
> 75) then this is one of the values in the default temp_errors.


Thanks for your suggestion.

Here is a sample "procmail.run" wrapper script I just wrote, called in
the exim transport; it seems to work well (also tested with procmail
segfaulting because of too long recipes).

Does this looks good enough/reliable for you ?

Thanks.


#!/usr/bin/perl
use strict;

unshift(@ARGV, "/usr/bin/procmail");

system(@ARGV);
if ($? == -1) {
        print STDERR "failed to execute: $!\n";
        exit 75;
}
elsif ($? & 127) {
        printf STDERR "procmail died with signal %d\n", ($? & 127);
        exit 75;
}
else {
        exit $?
}



--
Nicolas