If you have no other option but to use telnet with authentication to send mail 🙂
( echo "ehlo"
$(echo username |base64)
$(echo password |base64)
mail from: from-address
rcpt to: recepient
exit ) |telnet server port
How many times you have felt that there was some simple way to convert bash ansi escape sequences ( colors as well in terminal ) to html equivalent so that you can send the same as html report in email. Here is simple solution. One way is to use ccze if you are using this for logs – colorize your logs and for more generic solution.
dnf install python3-ansi2html.noarch
after this is installed, you can use something like this:
/usr/bin/python3-ansi2html -l -f 12 -i
You can see the help for ansi2html to see what parameters mean and which ones suit you best 🙂
Here is description of the tool:
Description : The goals of ShellCheck are:
: * To point out and clarify typical beginner’s syntax issues,
: that causes a shell to give cryptic error messages.
: * To point out and clarify typical intermediate level semantic
: problems, that causes a shell to behave strangely and
: * To point out subtle caveats, corner cases and pitfalls, that may
: cause an advanced user’s otherwise working script to fail under
: future circumstances.
dnf install ShellCheck
And just run the tool on the script to get the common errors.