0

This works:

echo "yada yada" | msmtp [email protected]

but not this:

cat yadayada.txt | msmtp [email protected]

which delivers the email with empty content.

Why does echo work through pipe but not cat with msmtp ?

user19496
  • 1,490
  • 3
  • 13
  • 22

1 Answers1

0

msmtp seems to rely on a wellformed email message in the file being read.

Ex.

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 protected]

is a Q&D way to get the logfile content sent using msmtp.

user19496
  • 1,490
  • 3
  • 13
  • 22