Search code examples
bashemailmuttreply

mutt: reply email from console


I'm using mutt to send me an e-mail when certain event happens:

if [ ... ]
then
  echo "Content" | mutt -s "Subject" -- "my.email@mail.com"
fi

This will send me a new email every time, but I would like that it replies the same e-mail over and over so there is only one e-mail "thread" instead of a new thread for every e-mail.

How can I do this?

Thanks


Solution

  • You need to add the In-Reply-To: header, and the value will be the message-id of the original email.

    I think you'll do this (untested)

    echo "content" | 
    mutt -s "Subject" -e 'my_hdr In-Reply-To: <abc123@example.com>' -- recipient@example.com