Due to how stdin is read, the message gets a trailing "\n". sed was used to
remove it but this commit use shell variable mangling "${var%Pattern}"
instead (faster and nicer).
To simplify and improve readability of configuration options, use of standard
newline character is preferred over $NEWLINE_CHAR.
This commit uses \n in configuration options instead of $NEWLINE_CHAR and adds
a final \n to $NEWLINE_CHAR conversion step just prior to sending.