9 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] convert html- and mul...
FromSent OnAttachments
Nick SimicichDec 16, 2002 12:16 am 
Ruprecht HelmsDec 16, 2002 2:10 am 
Ruprecht HelmsDec 16, 2002 8:29 am 
Nick SimicichDec 16, 2002 11:48 am 
AdministratorDec 16, 2002 12:39 pm 
Ruprecht HelmsDec 16, 2002 1:27 pm 
Ruprecht HelmsDec 16, 2002 1:44 pm 
AdministratorDec 16, 2002 6:02 pm 
Nick SimicichDec 16, 2002 7:09 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [maildropl] convert html- and multipart-mails into plaintextActions...
From:Nick Simicich (nj@scifi.squawk.com)
Date:Dec 16, 2002 12:16:39 am
List:net.sourceforge.lists.courier-maildrop

Consider grabbing a copy of my perl script, demime. It reduces pretty much any piece of mail to plain text (save reports, this is on purpose). I drive it as a filter out of maildrop in a

DEMIMEFILTER="/usr/lib/majordomo/demime -f -"

This is an example of running it against certain mailing lists. I have already made the determination that this is a mailing list. The stuff about winmail.dat is because demime will also remove uuencoded text sections.

if ( /^content-type:[:space:].*html/ || \ /^content-type:[:space:].*multi/ || \ /^content-type:[:space:].*rich/ || \ /^content-type:[:space:].*application/ || \ /^X-MS-Attachment/ || \ /^[:space:]+winmail[0-9]?.dat/:b || \ /^begin[:space:]+[:digit:]+[:space:]+winmail.dat/:b || \ /^begin\s+[0-7]+[:space:]+[:graph:]+[:space:]*$/:b) { log "$ltalk@$domain message demimed: $MATCH" xfilter $DEMIMEFILTER }

You can get demime at http://scifi.squawk.com/demime.html

At 10:41 PM 2002-12-15 +0100, Ruprecht Helms wrote:

Hi,

how can I configure that maildrop convert mails with content-type html or multipart/alternative into plaintext. If the mail is from the multiparttype I will cut off the html-part by maildrop.

At the moment I have built such rule

... if (reformail -x Content-Type: == 'text/html') { cc "|mailbot -t /usr/share/autoresponse/html \ -A 'From: rhe@mayn.de' /var/qmail/bin/qmail-inject" reformime }

if (reformail -x Content-Type: == 'multipart/alternative') { cc "|mailbot -t /usr/share/autoresponse/multipart \ -A 'From: rhe@mayn.de' /var/qmail/bin/qmail-inject" reformime }

Demime will also remove advertising signatures. :-)