nmh-workers
[Top] [All Lists]

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

2015-07-28 17:29:49
On Tue, 28 Jul 2015 01:40:11 -0400 Ken Hornstein <kenh(_at_)pobox(_dot_)com> 
sez:

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.

Ah, you're right!  My script had a bug that caused it to check a
different result.  Thanks!

                                Bob

_______________________________________________
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>