procmail
[Top] [All Lists]

Re: How to remove the last part of the body

2000-11-13 17:20:24
Hi. 

I have tried the recipe you gave me but it returns an error. The log says 

procmail: Executing "head,-c,100"
head: illegal option -- c

I don't understand what is wrong. I have left a larger cut of the log
below. Do you see what is wrong?



procmail: No match on
"(^(Mailing-List:|Precedence:.*(junk|bulk|list)|To: Multiple recipients of
|(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )([^>]*[^($
procmail: Assigning "LASTFOLDER=backup"
procmail: Opening "backup"
procmail: No match on "^fg-request"
procmail: No match on "^procmail mailing list"
procmail: No match on
"^list-id:.*procmail|^X-beenthere:.*procmail|^Sender:.*procmail"
procmail: No match on
"^FROM:(.*bbsas.*|.*skandiabanken.*|.*SkandiaBanken.*)"
procmail: Match on
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^a-zA-Z])?).*tindlund.*|^From:(.*torleif.*|.*jon.*|.*fredhei$
procmail: Match on ! "Subject:.*Påmeldingsbekreftelse.*"
procmail: Assigning "LASTFOLDER=/home/homee/ti/tindlund/mail/INBOX"
procmail: Opening "/home/homee/ti/tindlund/mail/INBOX"
procmail: Forking "procmail"
procmail: Executing "date,+%y-%m"
procmail: [19831] Tue Nov 14 00:12:12 2000
procmail: Executing "formail,-f,-XzFrom:,-XzSubject:"
procmail: Assigning "LASTFOLDER=00-11"
procmail: Opening "00-11"
From tindlund(_at_)stud(_dot_)ntnu(_dot_)no  Tue Nov 14 00:12:12 2000
 Subject: SMS TEST!!!
  Folder: 00-11
1555
procmail: Notified
comsat: "tindlund(_at_)405580:/home/homee/ti/tindlund/mail/00-11"
procmail: [19831] Tue Nov 14 00:12:12 2000
procmail: Executing "head,-c,100"
head: illegal option -- c
procmail: [19831] Tue Nov 14 00:12:12 2000
procmail: Program failure (1) of "head"
procmail: Rescue of unfiltered data succeeded
procmail: [19831] Tue Nov 14 00:12:12 2000
procmail: Assigning "LASTFOLDER=/usr/local/bin/sendmail -oi
xx(_at_)xx(_dot_)xx(_dot_)xx"
  Folder: /usr/local/bin/sendmail -oi xx(_at_)xx(_dot_)xx(_dot_)xx
746
procmail: Notified comsat: "tindlund@:/usr/local/bin/sendmail -oi
xx(_at_)xx(_dot_)xx(_dot_)xx"
procmail: [19831] Tue Nov 14 00:12:12 2000
procmail: Executing "/usr/local/bin/sendmail,-oi,xx(_at_)xx(_dot_)xx(_dot_)xx"




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


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