Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: SendMail works 99% of the time

by Elliott (Pilgrim)
on May 19, 2002 at 19:37 UTC ( [id://167692]=note: print w/replies, xml ) Need Help??


in reply to Re: SendMail works 99% of the time
in thread SendMail works 99% of the time

OK, let me try for a little more clarity...

I am calling SendMail from a cgi script. Bounces, non-receipts etc are not the issue. The issue is that the emails are not being sent every time. I assume this either because of a SendMail error or because of a failure to launch it.

Hagus says "If delivery failed because sendmail returned an error code, you can obviously test for that." which is exactly my problem! I don't know how to log the error.

Replies are listed 'Best First'.
Re: Re: Re: SendMail works 99% of the time
by hagus (Monk) on May 19, 2002 at 22:44 UTC
    After you call the sendmail binary, you can interrogate the $? variable for the exit code of sendmail. I am guessing that '0' means success, although the sendmail man page does not seem to list exit codes.

    After your open using pipes or system call, or whatever you use to invoke sendmail:

    # -- insert sendmail invocation here. # eg. open(SENDMAIL, "|/usr/bin/sendmail -t") $exit_value = $? >> 8; $signal_num = $? & 127; $dumped_code = $? & 128;
    (from the Cookbook)

    Anyway, how do you know that bounces are not the issue? Is the user who is sending the messages getting none at all? Maybe start off by checking the return values as above, but if sendmail is being run successfully and you are missing out on mails, I would look for bounce messages.

    --
    Ash OS durbatulk, ash OS gimbatul,
    Ash OS thrakatulk, agh burzum-ishi krimpatul!
    Uzg-Microsoft-ishi amal fauthut burguuli.

      --how do you know that bounces are not the issue?-- Because I copy the emails to myself - and when the client doesn't receive them, netiher do I. Thank you for the exit codes. I'll do some experimenting with those.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://167692]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-19 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found