Gnus development mailing list
 help / color / mirror / Atom feed
From: merlyn@stonehenge.com (Randal L. Schwartz)
Cc: ding@gnus.org
Subject: Re: htmlified mail
Date: 24 Jan 2001 06:06:03 -0800	[thread overview]
Message-ID: <m13de9gi44.fsf@halfdome.holdit.com> (raw)
In-Reply-To: <ruo66j5qiwi.fsf@g.wolfram.com>

>>>>> "Bill" == Bill White <billw@wolfram.com> writes:

Bill> I'm seeing a lot of this crap nowadays.  Is this MS Lookout! output?

Apparently, MS Outlook (not Outlook Express) for Windows 2K does not
have a global "send plaintext mail only".  To send plaintext mail,
the address must be added to an address book, and then for that specific
address, an option must be individually selected to say "send plaintext".

This is pure evil.

I wrote the following Perl program as a hasty response, and pipe everything
through it that matches "Content-type:.*boundary" in the header.  It's
harmless on *real* MIME content, other than eating a bit of CPU.
Requires the MIME::Tools distribution from teh CPAN.

    #!/usr/bin/perl -w
    use strict;
    $|++;

    my $envelope = <STDIN>;

    use MIME::Parser;
    use MIME::Entity;

    my $parser = MIME::Parser->new;
    $parser->output_to_core(1);
    $parser->tmp_to_core(1);

    my $ent = eval { $parser->parse(\*STDIN) }; die "$@" if $@;

    if ($ent->effective_type eq "multipart/alternative"
        and $ent->parts == 2
        and $ent->parts(0)->effective_type eq "text/plain"
        and $ent->parts(1)->effective_type eq "text/html") {

      my $newent = MIME::Entity->build(Data =>
                                       $ent->parts(0)->body_as_string .
                                       "\n\n[[HTML alternate version deleted]]\n");
      $ent->parts([$newent]);	
      $ent->make_singlepart;
      $ent->sync_headers(Length => 'COMPUTE', Nonstandard => 'ERASE');
    }

    print $envelope;
    $ent->print;


-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



  reply	other threads:[~2001-01-24 14:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-24  9:15 Joakim Hove
2001-01-24 11:38 ` Bill White
2001-01-24 14:06   ` Randal L. Schwartz [this message]
2001-01-24 15:03     ` Stainless Steel Rat
2001-01-24 15:22     ` Hannu Koivisto
2001-01-26  3:59   ` Error with function gnus-summary-pipe-output (Was htmlified mail) Mike Pullen
2001-01-26  8:17     ` Bill White
2001-01-26 13:20       ` ShengHuo ZHU
2001-01-28 20:44         ` James H. Cloos Jr.
2001-01-29  0:35           ` ShengHuo ZHU
2001-01-29  1:49             ` James H. Cloos Jr.
2001-02-06  6:51               ` ShengHuo ZHU
2001-01-26 19:01       ` James H. Cloos Jr.
2001-01-26 19:17         ` ShengHuo ZHU
2001-01-26 22:32           ` James H. Cloos Jr.
2001-01-26 23:00             ` ShengHuo ZHU
2001-01-27 21:17               ` James H. Cloos Jr.
2001-01-27 21:44                 ` ShengHuo ZHU

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m13de9gi44.fsf@halfdome.holdit.com \
    --to=merlyn@stonehenge.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).