I don't know if this is related to the other issue I was having with my mailbox not being found which I fixed in the other blog post, but after installing postfix:
sudo apt install postfix
and correctly configuring the SMTP relay, I could send email using the sendmail function:
sendmail youremail@gmail.com Subject: testing does it work! .
but i just couldn't use my normal command mail:
echo "email message text" | mail -s "subject line" "youremail@gmail.com"
which I find far more friendly than the sendmail way.
anyhow the fix was to install mailutils:
sudo apt install mailutils
works a treat,
So if you want to install postfix and mutt you should use:
sudo apt install postfix mutt libsasl2-modules mailutils