B
bzd
Hello
I wrote a simple mail filtering script using Mail::Audit. It works
fine, but I'd like to overload DIE signal handler, so the script
would not send back "Undelivered Mail Returned to Sender" with
die output if there are any errors. It should just log exception
mesg or mail it directly to me.
I've tried
$SIG{__DIE__} = sub {
print LOG "DIE: ".$_[0];
$incoming_mail->ignore; # for Mail::Audit
}
but it doesn't work. $SIG{__DIE__} does work in simple testcase
though, like opening non-existing file, so I'm probabbly missing
something. Could anyone help?
regards,
artb.
I wrote a simple mail filtering script using Mail::Audit. It works
fine, but I'd like to overload DIE signal handler, so the script
would not send back "Undelivered Mail Returned to Sender" with
die output if there are any errors. It should just log exception
mesg or mail it directly to me.
I've tried
$SIG{__DIE__} = sub {
print LOG "DIE: ".$_[0];
$incoming_mail->ignore; # for Mail::Audit
}
but it doesn't work. $SIG{__DIE__} does work in simple testcase
though, like opening non-existing file, so I'm probabbly missing
something. Could anyone help?
regards,
artb.