echo "yada yada" | msmtp email@example.com
but not this:
cat yadayada.txt | msmtp firstname.lastname@example.org
which delivers the email with empty content.
Why does echo work through pipe but not cat with msmtp ?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
msmtp seems to rely on a wellformed email message in the file being read.
Subject: My subject line My body text
Since I don't care about Subject etc
(I'm sending an email when a logfile is modified using incron)
tr -d ':' < yadayada.txt | msmtp email@example.com
is a Q&D way to get the logfile content sent using msmtp.