![]() |
|
|
|||||||
![]() |
PERL - Re: [sendmail,perl] How to catch a mailer error [perl script as sendmail.cf mailer] |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
"Christian" <> wrote:
> I have a Perl mailer called that way : > > Matmail P=/servers/apache/sites/atmail/savemsg.pl, > F=lsDFMA5:/|@qSPhn9, S=EnvFromL/HdrFromL, > R=EnvToL/HdrToL, > T=DNS/RFC822/X-Unix, U=nobody, > A=savemsg.pl $g $u > > Sometimes, I get the following error : > > Mar 31 07:32:14 black sendmail[25866]: m2V5WDq25860: to=<>, > delay=00:00:00, xdelay=00:00:00, mailer=atmail, pri=32256, dsn=5.3.0, > stat=unknown mailer error 255 > > I cannot find any relevant system information about a problem at the time > this error pops up. So here is my question : is there a way to catch a > mailer error so that the message stays in the mail queue until it gets "man perlfunc" states that "die" when $!==0 and $?==0 causes "exits with 255". My guess would indicate uncaught "die" in your script perl as the most likely culprit. I would suggest you installing $SIG{__DIE__} handler function in your perl to: a) "translate" exit code 255 to a value sendmail recognizes as listed in sysexits.h file e.g. #define EX_SOFTWARE 70 /* internal software error */ #define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */ Exit code 75 would make sendmail queue message for future delivery. b) emitting *short* problem description via STDERR (e.g. below 128 chars) P.S. The proper fix would be to create Sendmail::Carp CPAN module based on CGI::Carp . Do you volunteer? -- [pl>en: Andrew] Andrzej Adam Filip sip: Open-Sendmail: http://open-sendmail.sourceforge.net/ The church saves sinners, but science seeks to stop their manufacture. -- Elbert Hubbard Andrzej Adam Filip |
|
|
![]() |
| Thread Tools | Search this Thread |
|
|