From czyborra@cs.tu-berlin.de Tue Oct 28 11:53:26 1997 Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!nntprelay.mathworks.com!howland.erols.net!newsfeed.internetmci.com!195.99.66.215!news-feed1.eu.concert.net!unlisys!news.snafu.de!cs.tu-berlin.de!zrz.TU-Berlin.DE!czyborra.cs.tu-berlin.de!czyborra From: Roman Czyborra Newsgroups: comp.mail.mime Subject: Re: seeking MIME mail-sending Unix utility or advice on writing one Date: Wed, 22 Oct 1997 23:47:35 +0200 Organization: Technical University Berlin, Germany Lines: 36 Message-ID: References: NNTP-Posting-Host: dial1-50.zrz.tu-berlin.de Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: Bruce Lewis In-Reply-To: > I'm seeking a MIME utility on Unix that takes as its input a file that > is in message/rfc822 format except that the message body is raw bytes > and the Content-Transfer-Encoding is the *desired* encoding. This > utility would output a message/rfc822 suitable for passing to sendmail > with the body properly encoded, and the Subject line encoded properly. The first part is easy: #!/usr/local/bin/procmail -m :0 fbw *^Content-Transfer-Encoding: base64 | mimencode -b :0 fbw *^Content-Transfer-Encoding: quoted-printable | mimencode -q :0 fbw *^Content-Transfer-Encoding: 8bit | tr \\200-\\377 \\000-\\177 :0 fbw *^Content-Transfer-Encoding: [78]bit | tr -d \\0 But what do you consider proper encoding of the Subject? :0 fhw *^Subject:[ ]*\/.*[^ !-~].* | formail -I \ "Subject: =?UNKNOWN-8BIT?B?`echo -n "$MATCH"|mimencode`?=" :0 w | /usr/lib/sendmail -oi -t