procmail
[Top] [All Lists]

Re: Cutting the body to a certain amount of characters

2001-02-06 16:32:54
Hmmm, this is a toughy.  Perhaps this can get you started.
(very, very untested).

:0:
* ^TO_whoever
{
        # save the body to temp file
        :0bc
        | cat - >body.tmp

        # drop all headers but From and Subject
        # and pipe them and the body through perl character counter script
        :0h
        | (formail -r -iFrom: -iSubject: ; cat body.tmp) | \
                perl -aF// -ne 'while ($c = shift @F) { exit if ++$i > 160; 
print $c; }' | \
                $SENDMAIL -oi phone(_at_)email(_dot_)com
}


On Tue, 6 Feb 2001, Andreas Tindlund wrote:

I have asked this question before, but I never got a descent solution to
it.

This is what I want:


:0:
* Criteria
[Cut the mail's body so that the (FROM-field + SUBJECT-field +
BODY-beginning) equals 160 characters.]
! email(_at_)domain     #forward this email to email(_at_)domain

I want do to this because my GSM-service provider allows me to send
SMS to my GSM phone through en e-mail address email(_at_)domain(_dot_) => i 
want to
forward some of my incoming mail to my mobile phone...

Do you have a solution how this can be done? Please post it!
_______________________________________________________________

 Andreas Tindlund      mob: 930 12 247   /   fg: 738 99 645
_______________________________________________________________






_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>