I love these kinds of questions: there's a simple direct translation
from the description to the recipe(s), so I don't have to guess at
what the questioner intended. Thank you, sir, for your clarity of
question.
"Tomas Karlsson" <webmaster(_at_)iimagers(_dot_)com> writes:
I was wondering if there is a simple way to extract the body of an
email, and add a some text in the begining of that email body
No need to extract:
:0 fb
| echo "some text"; cat -
OR
:0 fb
| cat $HOME/some-file -
The minus-signs are critical.
and then send that email back to the sender with the modified body
message.
:0
* ! ^FROM_DAEMON
* ! ^X-Loop: webmaster(_at_)iimager(_dot_)com
| formail -rtkb -A"X-Loop: webmaster(_at_)iimager(_dot_)com" \
| $SENDMAIL $SENDMAILFLAGS -t
If you only want to do this autoreplying under certain conditions, wrap
the above three recipes in a nested block:
:0
* some-condition
* another
{
:0 fb
....etc
}
Philip Guenther