only compute header text if we need it
make mail filename available for better debugging

If the Message-Id header can't be found, it's useful to show the
filename of the message in question to facilitate further debugging.
add sanity check for length of canonical headers

If the maildir message file gets corrupted (e.g. I have seen offlineimap
somehow insert spurious blank lines on the second line of the file), it
can fail to extract any or enough of the canonical headers in order to
generate a reliable message hash.  In this case all bets are off so we
need to abort in order to force the user to first fix the corruption.