[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] mts.conf has me Baffled.

From: Ken Hornstein
Subject: Re: [Nmh-workers] mts.conf has me Baffled.
Date: Tue, 28 Jul 2015 01:40:11 -0400

>The one thing my script doesn't have access to is whether the
>message posting was successful -- at least in the sense of
>whether send (or comp, before it) thinks it completed
>successfully.  I don't believe either provides a return value
>that Bash could use.  And so I've had to save the output
>generated by the script and eyeball it after-the-fact, and if
>something failed then manually resend.

Actually, I just checked ... at least in my simple test, send(1)
will set an exit code of 0 if it believes the messages was submitted
successfully, a 1 if it does not.  So you could test the value of $?
after you call send(1).  Or even just use an if statement like:

if send <some arguments here>; then
        do successful send stuff
        do failure stuff

If you're submitting directly to a non-local SMTP server, that's
probably a reasonable way to test for successful message submission.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]