nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] repl and mime handling

2012-01-17 12:04:25

also, when there's multipart/alternative choose text/plain over e.g. 
text/html. 

The problem with that approach is that sometimes the text part just says
``There is no text part, use an HTML capable mail reader''.  I'm seeing
more of them these days.

Really?  I've been reading text/plain over text/html with EXMH for years and
recently with my own mh front-end (mh-v) and this has never been an issue.
I think if you look closely you'll see stuff like...

  This message is in MIME format. Since your mail reader does not understand
  this format, some or all of this message may not be legible.

...but those warning messages aren't actually in the text/plain part.  

In my trash folder, 2000 msgs, I found three MUAs that include "MIME format
warning" messages but none of them printed the warnings in the text/plain part.

(There are also plenty of messages out there that are HTML only, but they
are encoded html only.)


In mh-e we use the content that is being displayed to the user when we
reply.  If no content is displayed we do not include the original post.
 Otherwise we let the user figure out which content is most useful and
include that in the reply.  Would there be some way to figure this out by
caching the details of the last show command which indicates which part was
displayed (text or html)?

Yea, sure: use mhshow settings that generate text and quote them in the reply...

 repl -filter /dev/null -nodraftfolder -nowwhatnowproc $*
 mhshow -nopause -nomoreproc $* | sed 's/^/ > /' >> ~/Mail/draft
 comp -use 

Fancy version that uses draft-folder and prefers text/plain over text/html 
follows.

steve
--

#!/usr/bin/perl -w

use strict;

my $argstr = join ' ', @ARGV;

my $mhpath = `egrep -i ^Path: $ENV{'HOME'}/.mh_profile 2> /dev/null`;
chop $mhpath;
$mhpath =~ s/^Path:\s*//i;
$mhpath = $ENV{'HOME'} . '/' . $mhpath;

my $drafts = `egrep -i ^draft-folder: $ENV{'HOME'}/.mh_profile 2> /dev/null`;
chop $drafts;
$drafts =~ s/^draft-folder:\s*//i;

my $repl = `repl -filter /dev/null -nowhatnowproc $argstr 2>&1`;
if ( $repl ne '' ) {
  print $repl;
  exit 1;
}

my $cur = `egrep ^cur $mhpath/$drafts/.mh_sequences 2> /dev/null`;
chop $cur;
$cur =~ s/^cur:\s*//i;

my $type = '';
my $plaintext = `mhlist $argstr | grep text/plain`;
if ( $plaintext ne '' ) {
 $type = '-type text/plain';
}

open(OUT,">>$mhpath/$drafts/$cur");
open(IN,"mhshow $type -nopause -nomoreproc $argstr 2>&1 |");
print OUT "\n > ---- Original Message ----\n";
while(<IN>) { print OUT " > $_"; }
close(IN);
close(OUT);
print "made $mhpath/$drafts/$cur\n";

system("comp -use -draftmessage $cur");



_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>