procmail
[Top] [All Lists]

Re: I need filtering / forwarding help!

2000-10-10 09:06:45
Andreas Tindlund wrote:
      1) removing the sender's name (but not the e-mail address)
      2) letting the subject be untouched
      3) sending only the beginning of the message body
      4) removing ------------(...)------- (e.g. from hotmail
msgs)

and let senders e-mail address, the subject and the beginning of the body 
altogether only occupy e.g. 155 characters not counting:
      a) a new line as a digit
      b) and counting a double space or more spaces only as one
character

How will this code look like?

Here's a starting point.  It's untested, so you'll need to adjust/fix
it to meet your needs.

    :0
    * some conditions here
    {
        # your item 1) -- part of it anyway
        :0 h
        F=| formail -rtxzto:

        # your item 2) -- part of it anyway
        :0 h
        S=| formail -usubject: -zXsubject:

        # your item 4)
        :0 fbw
        | sed -e commands.to.remove.stuff.from.hotmail.messages


        # following does your item 4) and enforces 155-char limit.
        # It also modifies message body so we can count characters.
        :0 b
        | (echo From: $F; echo $S; expand|sed 's/  */ /g') | head -c 155 \
               | $SENDMAIL xxx(_at_)yyy

    }

hth
-- 
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information.  Sorry.
Collin Park                         Not a statement of my employer.

_______________________________________________
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>