[Esa-l]problem with Sanitizing MIME, solved
alois at astro.ch
Fri Jul 6 01:01:55 PDT 2001
I have been using procmail sanitizer since January on HPUX 10.20,
with procmail 3.15 and Sanitizer release 1.126
I found out that procmail-sanitizer lost messages, because the
Sanitizing MIME part did not work correctly.
I got all these 470 line long perl code entries in procmail.log.
As it is, the pipe into | perl -p -e ... failed in the Sanitizing MIME
section, and then the procmail rescue code delivered the message with
a missing 'F' in the first line which starts with 'From' into the
users mailbox, e.g. /var/mail/alois
This damaged header
had the result that pine or imap could not find the message there.
It was effectively lost.
I updated procmail to version 3.21 and Sanitizer to 1.129 but this did
not fix the problem.
I have the suspicion that it is the length of the perl -p -e script (475
lines) which creates the problem on HPUX 10.20. I searched with google
and deja for many hours but could not find any reference to my problem.
I modified the Sanitizer code and created out of html-trap.procmail
the variant /etc/procmail/html-trap.procmail.my
I moved the imbedded perl script into a separate file
and call this file as a filter, for Sanitizing MIME.
This seems to solve the problem.
The section in html-trap.procmail.my now reads:
---------- begin quote
# MIME attachments
* 1^0 ^Content-Type[ ]*:.*(application|multipart)/[^ ]*;
* 1^0 ^Content-Type[ ]*:.*message/rfc822
* 1^0 ^Content-Disposition[ ]*:.*attachment
LOG="Sanitizing MIME attachment headers$SUBJ"
| /etc/procmail/sanitize_mime.pl 2>> $LOGFILE
---------- end quote
and the file sanitize_mime.pl contains the perl script
which was originally between the ' ' quotes in the filter script,
with the trailing line ends #\ removed, and
with the first added line
#! /usr/bin/perl -p
Of course it must be made executable.
|| Alois Treindl, Astrodienst AG, mailto:alois at astro.com
|| Zollikon/Zurich, Switzerland
More information about the esd-l