Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Re: [sendmail,perl] How to catch a mailer error [perl script as mailer]

Thread Tools

Re: [sendmail,perl] How to catch a mailer error [perl script as mailer]

Andrzej Adam Filip
Posts: n/a
"Christian" <(E-Mail Removed)> wrote:
> I have a Perl mailer called that way :
> Matmail P=/servers/apache/sites/atmail/,
> F=lsDFMA5:/|@qSPhn9, S=EnvFromL/HdrFromL,
> R=EnvToL/HdrToL,
> T=DNS/RFC822/X-Unix, U=nobody,
> $g $u
> Sometimes, I get the following error :
> Mar 31 07:32:14 black sendmail[25866]: m2V5WDq25860: to=<(E-Mail Removed)>,
> 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)

The proper fix would be to create Sendmail::Carp CPAN module based on
CGI::Carp . Do you volunteer?

[pl>en: Andrew] Andrzej Adam Filip Removed) sip:(E-Mail Removed)
The church saves sinners, but science seeks to stop their manufacture.
-- Elbert Hubbard
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Mailer, Newsletter script in asp/ =?Utf-8?B?Sm9l?= ASP .Net 1 02-23-2005 10:33 PM
Getting a mailer script to work Doug Parker ASP General 1 04-19-2004 04:49 AM
Multiple field form for this ASP mailer script Mark Creelman ASP General 3 04-03-2004 05:01 AM
Script Request - form mailer with ID Number gwmbox Perl Misc 0 07-09-2003 12:19 AM