Sendmail "ok" signal?

G

Gaz

Hey. I looked at the Sendmail help and did not find a property where i
can get an "ok" signal when the email is finally sent. I need something
like that to show a "Processing, please stand by" screen when the
server is sending an email, and when the email is out, another screen
appears with an "Email sent" message.

Do you know an alternative to the "ok" from the sendmail to do this?
 
D

Dennis Lee Bieber

Do you know an alternative to the "ok" from the sendmail to do this?

Unless SMTP has changed drastically, I don't think there is a means
for this; normally a client submits a message to the SMTPd which queues
it, then later tries to connect to the next SMTPd in the chain
(typically the defined receiving server of the destination address).

As far as the sending /client/ is concerned, the message has been
"sent" when it returns from the first hand-off (that is, when the
message has been queued with the first SMTPd). The SMTPd may make
multiple attempts at delivering the message -- I recall some days where
I'd get a notice some three days later saying it had finally given up
trying to deliver a message (typically the postmaster address of some
spamming ISP, back when I used to have a program format and send
complaints).
--
 
D

Dan Stromberg

Hey. I looked at the Sendmail help and did not find a property where i
can get an "ok" signal when the email is finally sent. I need something
like that to show a "Processing, please stand by" screen when the
server is sending an email, and when the email is out, another screen
appears with an "Email sent" message.

Do you know an alternative to the "ok" from the sendmail to do this?

It depends on how you're talking to the mail server.

If you're opening a pipe to "/usr/lib/sendmail recipient-list" or
"/usr/sbin/sendmail recipient-list" (some *ix hosts have one, or the
other, or both - few have neither), then I believe about all you have to
go on is the exit status from the subprocess.

If you're connecting to host:25/tcp, then you get an informative return
code each time you issue an SMTP command. You can get this same effect,
more or less, by opening a pipe to /usr/lib/sendmail -bs or
/usr/sbin/sendmail -bs as well.

And yes, sendmail and other MTA's that speak SMTP will accept
responsibility for a message well before it gets to its final destination.
However, once they accept the message, they are to do everything in their
power to make sure the message doesn't get lost, even if it means having
to deliver it twice instead of 0 times. They'll write things to disk even
when it'd be faster to just leave it in memory and past it along via the
network, for example - because otherwise a power failure might mean a
message would get lost.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,285
Messages
2,571,415
Members
48,107
Latest member
jigyasauniversity

Latest Threads

Top