nmh-workers
[Top] [All Lists]

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

2015-07-28 00:40:23
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
else
        do failure stuff
fi

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

--Ken

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>