see the title for the question. that is all.
views:
78answers:
1
A:
UPDATE extract mime text part only!!!
Could be done this way:
:0 c
* optional rules
{
MAILSUBJ=`formail -zcxSubject:`
MAILBODY=`/usr/local/bin/extract-mime-text.sh`
NEWSUBJ="$MAILSUBJ $MAILBODY"
:0 fw
| formail -I"Subject: $NEWSUBJ"
:0
[email protected]
}
with the script in /usr/local being something along the lines of
#!/bin/bash
T=/tmp/tmpmail.$$.$RANDOM
cat /dev/stdin > $T
for i in `reformime -i < $T | grep -B1 "content-type: text/plain" | grep section | cut -d: -f2`; do
reformime -s$i -e < $T | sed -e "s/[ \t]\+/ /g" | tr -d "\n"
done
rm $T
That way you can nicely forward messages to some pseudo email address that does SMS forwarding (beginning of text part of mail will end up in subject, as only the subject is forwarded to SMS in many cases)
Marki
2010-02-01 04:17:52