[PLUG] Need help w/ a procmail recipe
Travis Spencer
travislspencer at gmail.com
Fri Dec 16 20:35:10 UTC 2005
Hey All,
I was wondering if anyone can point out why the following recipes are
failing to cause all multipart/alternative and multipart/mixed e-mails
to be converted to plain text and output to the mailbox called other:
LOGABSTRACT=all
PATH=$HOME/bin:$PATH # munpack is in $HOME/bin.
TMPDIR=/tmp/procmail.$$
TRAP="rm -rf $TMPDIR; $TRAP"
VERBOSE=yes
:0 Wic
* ^Content-Type: multipart.*
|mkdir -p $TMPDIR
# Message is multipart/alternative. First part is text
# and should be discarded. Second part is HTML and should
# be converted.
:0 w
* ^Content-Type: multipart/alternative.*
|munpack -t -C $TMPDIR && \
lynx -dump -force_html $TMPDIR/part2 | \
cat -s
# Message is multipart/mixed or related. HTML is first part.
:0 w
* ^Content-Type: multipart.*
* ! ^Content-Type: multipart/alternative.*
|munpack -t -C $TMPDIR && \
lynx -dump -force_html $DIR/part1 | \
cat -s
:0:
other
Because none of the commands output their results to a file but serve
as filters (save mkdir which has been flagged to continue
regardless), it was my understanding that procmail would continue
processing the other rules. It does though as you can see from this
log entry:
procmail: [14124] Fri Dec 16 12:32:11 2005
procmail: Match on "^Content-Type: multipart.*"
procmail: Executing "mkdir,-p,/tmp/procmail.14124"
procmail: Assigning "LASTFOLDER=mkdir -p /tmp/procmail.14124"
>From foo at yahoo.com Sun Dec 4 22:41:19 2005
Subject: Some subject
Folder: mkdir -p /tmp/procmail.14124 5312
procmail: Match on "^Content-Type: multipart/alternative.*"
procmail: Executing "munpack -t -C $TMPDIR && \
lynx -dump -force_html $TMPDIR/part2 | \
cat -s"
procmail: Assigning "LASTFOLDER=munpack -t -C $TMPDIR && \
lynx -dump -force_html $TMPDIR/part2 | \
cat -s"
>From foo at yahoo.com Sun Dec 4 22:41:19 2005
Subject: Some subject
Folder: munpack -t -C $TMPDIR && \ lynx -dump -force_html $TMPDIR/pa 5312
procmail: Assigning "EXITCODE=0"
procmail: Executing "rm -rf /tmp/procmail.14124; "
If anyone has any suggestions, I would appreciate it.
--
Regards,
Travis Spencer
More information about the PLUG
mailing list