Re: Attachment Decoding Problem

2000-05-29 Thread Thomas Roessler

On 2000-05-27 21:49:21 -0400, John P. Verel wrote:

 Ah.  So the issue is the sender, in this case
 presumably Lotus Notes.

Yes, it is, and it is complete and utter brain-damage on
Lotus' side.  For some kind of handler, you may try the
attached shell script, which helps at least in some
situations.

(For storing the attachments, piping to uudecode is
entirely fine, though.)

-- 
http://www.guug.de/~roessler/


#!/bin/bash

##
## View X-Lotus-Notes attachments.
##

mimetypes=/usr/local/share/mime.types
metamail="/usr/local/bin/metamail -m mutt"

tmpdir=/tmp/lotus.$$
trap 'rm -rf $tmpdir' 0 1 2 3

mkdir $tmpdir || exit 1

## -B means that we are used in an autoview filter.

if [ "$1" = "-B" ] ; then
metamail="$metamail -B -x -q"

MAILCAPS=${MAILCAPS-$HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap}
for i in `echo $MAILCAPS | tr : \ ` ; do
[ -f $i ]  { grep copiousoutput $i  $tmpdir/mailcap ; }
done
export MAILCAPS=$tmpdir/mailcap
export MM_PAGER=cat
shift
else
metamail="$metamail -p"
fi

[ -z "$1" ] || { exec  $1 || exit 1 ; }

cd $tmpdir

cat  data
extension=`sed -n -e 's/^begin .*\.\([^.]*\)$/\1/p' data | tr '[A-Z]' '[a-z]'`
tmpfile=data.$extension
sed -e "s/^begin .*\$/begin 600 $tmpfile/" data | uudecode
ctype=`awk '/^[^#]/   { 
for(i = 2; i = NF; i++) {
  if($i == "'"$extension"'") {
printf("%s", $1);
exit;
  }
}
  }' $mimetypes`

if [ -z "$ctype" -o \( "$ctype" = "text/plain" \)  ] ; then
recode ibmpc:latin1 $tmpfile
${MM_PAGER-less} $tmpfile
exit
fi

$metamail -b -c $ctype $tmpfile



Attachment Decoding Problem

2000-05-27 Thread John P. Verel

I've received a couple of attachments which are MS Word in format.
They were forwarded to me by another recipient.  

The attachments are preceded by the following text:

UUEncoded file named: 1073313B.doc follows)
(Its format is: Lotus Manuscript 1.0 )

Following that is the ASCII encoded mess.

If I re-send the message, pick it up in W98/MSWord, (you'll pardon the
expression ;), it is decoded properly and can be opened just fine.

I routinely receive MS Word attachments in mutt, save and use them
just fine.

I'm supposing that this is a mime or mailcap issue, but I'm not sure.
Any guidance will be appreciated.

Thanks.

John









Re: Attachment Decoding Problem

2000-05-27 Thread David T-G

John --

...and then John P. Verel said...
% I've received a couple of attachments which are MS Word in format.

Well, they are MS Word documents, but they have been encoded for mailing.


% They were forwarded to me by another recipient.  

That's where it always starts ;-)


% 
% The attachments are preceded by the following text:
% 
% UUEncoded file named: 1073313B.doc follows)
% (Its format is: Lotus Manuscript 1.0 )

Here's your answer: instead of having been encoded with a modern MIME
method (base64 or quoted-printable), they were encoded with uuencode (or
the built-in equivalent on the originator's MUA).

If you get mail from this (these) person(s) regularly, you might suggest
to him/her (them) that he/she (they) change the MUA's attachment settings
to MIME.


% 
% Following that is the ASCII encoded mess.
% 
% If I re-send the message, pick it up in W98/MSWord, (you'll pardon the
% expression ;), it is decoded properly and can be opened just fine.

I presume you mean "re-send the message to an address that uses LookOut!,
use that to save it, and then open the saved attachment in MSWord".  It's
no great shakes to decode a uuencoded file (can you guess how? :-) but
it's not a standard MIME type and probably just showed up as embedded in
the text body instead of attached (think the whole "old-style vs MIME PGP
signing" religious war).


% 
% I routinely receive MS Word attachments in mutt, save and use them
% just fine.

I presume you mean "from other folks instead of this person who uses
uuencode instead of MIME"...


% 
% I'm supposing that this is a mime or mailcap issue, but I'm not sure.
% Any guidance will be appreciated.

Any time you get one of these, since you are presumably using mutt on a
*NIX-type system (and if you have it working under Win98, tell us all!),
just pipe it thru uudecode to get the original file.  You may have to
look around a bit, since those WinDoze folks like to embed spaces in the
filenames that mess up simple programs like uudecode.


% 
% Thanks.

HTH  HAND


% 
% John
% 


:-D
-- 
David T-G   * It's easier to fight for one's principles
(play) [EMAIL PROTECTED]  * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.bigfoot.com/~davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
The "new millennium" starts at the beginning of 2001.  There was no year 0.
Note: If bigfoot.com gives you fits, try sector13.org in its place. *sigh*


 PGP signature


Re: Attachment Decoding Problem

2000-05-27 Thread John P. Verel

On 05/27/00, 09:16:03PM -0400, David T-G wrote:
 % 
 % The attachments are preceded by the following text:
 % 
 % UUEncoded file named: 1073313B.doc follows)
 % (Its format is: Lotus Manuscript 1.0 )
 
 Here's your answer: instead of having been encoded with a modern MIME
 method (base64 or quoted-printable), they were encoded with uuencode (or
 the built-in equivalent on the originator's MUA).

--snip--

Ah.  So the issue is the sender, in this case presumably Lotus Notes.

--snip--

 
 I presume you mean "re-send the message to an address that uses
  LookOut!,

Actually, Eudora, but, FWIW, I've also adopted Look Out! as the new
name :)
 use that to save it, and then open the saved attachment in MSWord".  It's
 no great shakes to decode a uuencoded file (can you guess how? :-) but
 it's not a standard MIME type and probably just showed up as embedded in
 the text body instead of attached (think the whole "old-style vs MIME PGP
 signing" religious war).

In fact, I'd figured out that piping the attachment to uudecode works
just fine.  I guess that's the answer, eh?  

David, thanks for your thoughtful reply :)

John