Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [sendmail,perl] How to catch a mailer error [perl script as sendmail.cf mailer]
"Christian" <cgregoir99@yahoo.com> 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=<xxx@xxx.fr>,
> 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 anfi@xl.wp.pl sip:896530@fwd.pulver.com
Open-Sendmail: http://open-sendmail.sourceforge.net/
The church saves sinners, but science ss to stop their manufacture.
-- Elbert Hubbard

Report this thread to moderator Post Follow-up to this message
Old Post
Andrzej Adam Filip
04-01-08 12:50 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:24 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.