Why Notes Meaning done job was completed successfully failed S1 job was not completed rejected job was rejected for specified reasons blocked job is blocked by concurrent jobs requeued S1 job was not completed, but was requeued for retry removed job was deleted from the queue killed job was deleted from the queue timedout job could not be sent before kill time expired format_failed document conversion failed no_formatter the document conversion program was not found poll_rejected S1 a polling request was rejected by the remote side poll_no_document S1 a polling request failed because nothing was available poll_failed S1 a polling request failed for an unknown reason
if [ "$WHY" != "done" ]; then RETURNFILETYPE=pdf; fi
This would only set RETURNFILETYPE when the job did not complete successfully.
${SPOOL} spooling area ${SENDMAIL} for delivering mail