procmail
[Top] [All Lists]

Re: proper use of metamail & procmail

2001-03-08 00:07:16

With a little more investigation, incl. a hidden clue in the man page, 
I found that metamail could handle the 'charset' stuff, if it was 
properly quoted.

:0
*   ^Mime-Version: 1.0
* ! ^Content-Type:[     ]Text/Plain
*   ^Content-type: *\/[^ ].*
{

        :0fbw
| metamail -q -x -b -c "${MATCH}" 2>>$HOME/metamail.log |\
sed '/This message contains data in an unrecognized format/,$d; /This 
message contains raw digital data,$d'

# The sed stuff is to trim some messages that seem to deal 
# with attachments....  there may be more of these later



# once metamail has done its trick, we only have the body of the 
# msg... but the cell only cares about the body and the From/Subject 
line
# These are taken with formail -x previously

:0fhw
|formail -I"From: $FROM" -I"Subject: $SUBJECT"

}

#
# There's nothing worse than having to scan through pages of 
# previous text, so we try to remove as much as we 
# reasonably can... this trims outlook and outlook express
# which, I think, maddeningly use two slightly different
# markers to note the beginning of a forwarded message
#
# The downside is that if someone sends me a forwarded message 
# and nothing else, I won't get the text of it on my cell
#
# Acceptable condition, IMO, for the trade off
#


:0fbw
| sed '/----- Original Message -----/,$d; /-----Original Message-----
/,$d' |\
grep -v "^>" |\
tr -s ' |\012'


# send it to the cell phone email address ($CELL is set in VARIABLES.rc)
:0
! $CELL



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