If you send console output via email (like, say the output of
jekyll build as part of a SVN post-commit hook script) if there are ANSI control characters in the string (e.g. colour codes) this can break things. In this case the
exim) was only sending text up to the first ANSI code, which meant that the
jekyll build error messages (which are yellow and red) were missing.
To fix this pipe the text through
ansi2txt (comes with the
colorized-logs package in Debian and Ubuntu). This strips out all ANSI control codes making the string email safe.
(After this I pipe it through
unix2dos to convert to CRLF line endings, as this appears to be the standard for email. On Debian this comes with the
The last line in the hook script then becomes
echo "$LOGVAR" | /usr/bin/ansi2txt | /usr/bin/unix2dos | mail -s "$REPOS_BASENAME build $REV" "$BUILD_EMAIL"