- #### Set up a tmpfil and trap to remove it. send moves the file to a backup.
- tmpdir="${MHTMPDIR:-${TMPDIR:-${TMP:-`${nmhbindir}/mhpath +`}}}"
- tmpfil="${tmpdir}/mhmail$$"
- tmpfilbackup="${tmpdir}/[,#]mhmail$$"
- trap "rm -f ${tmpfil} ${tmpfilbackup}" EXIT
-
- #### Put message header and body in file to supply as draft to
- #### send/post. ${header} always ends with a newline, so this adds
- #### the blank that separates the body.
- umask 077
- printf "%s" "To: ${tolist}
-Cc: ${cclist}
-${header}
-${body}" > ${tmpfil} || exit 1
-