a couple comments: The build taskid should wind up in a file somewhere accessible before nightly starts anything time-consuming like make clobber or bringover; the cleanest way to kill a mistakenly-started build is with pkill -T -- though maybe the way to do this is by putting the taskid into the lock file..
Also, it might make sense to put the tool version output you relocated into a second temporary file that gets prepended to $mail_msg_file, so that the tool versions show up early in the output (on a related note, I think it would make sense to use a similar technique to truncate the list of files updated in the bringover output at a few hundred lines, but that's not this bug). (by "bringover" I of course am also referring to the equivalent with other SCM systems..) - Bill