procmail
[Top] [All Lists]

Re: How to remove the last part of the body

2000-11-06 11:11:13
I want procmail to forward a copy of all mail I receive, BUT, i want the
copy to be modified with these conditions:

- From-field + Subject + Body shall be altogether no longer than 300
  characters 
- To do this, the last part of the body shall be cut away.

Here's a starting point.  It has not been tested.

    # Modify one copy to forward
    :0c
    {

        # Remove all but From/Subject from header

        :0 fhwi
        | formail -f -XzFrom: -XzSubject:

        # Trim message to 300 bytes total

        :0 fwi
        | head -c 300

        # Send it!
        :0
        ! other(_at_)email(_dot_)address

        # You can't get here

        LOG="forward to other(_at_)email(_dot_)address didn't work :^<
"
        :0
        /dev/null        
    }

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>