<<< Date Index >>>     <<< Thread Index >>>

Re: HTML with attached images



* Flavien <flavien@xxxxxxxxxxx> [2003-11-07 00:01 +0100]:
> 
> Hello,

G'day.

> As most of you, I _hate_ html-mail. That's one  of  the  so  many
> reasons why I love mutt. :o)

I don't _hate_ it, I just don't see the need for it most of the time.

> However, I sometimes receive newsletters in HTML format and would
> like to read them. Today, I launch mozilla on  html  files  if  I
> select the html part when showing all the elements of the mail.
> 
> I would like to tell mutt that in order for  mozilla  to  display
> the images that were also attached to the mail, it needs to  save
> the gif/jpeg to /tmp/ as well as the html file, before  launching
> mozilla. Is this doable ? How ?

I use the macros and script below. You'll need to change the galeon to
mozilla. Also, there's some special stuff to handle the Gizmo newsletter,
which uses the pictures from their website, despite including them in the
email. I'll leave it in in case you're interested in subscribing - it's a
pretty good little tech toy magazine.

macro   index   <F11>   "<copy-message>/tmp/tmpbox\n<enter><enter-command>unset 
wait_key\n<shell-escape>~/bin/mutt-view-html\n<enter-command>set wait_key\n"
macro   pager   <F11>   "<copy-message>/tmp/tmpbox\n<enter><enter-command>unset 
wait_key\n<shell-escape>~/bin/mutt-view-html\n<enter-command>set wait_key\n"

=== mutt-view-html:
#!/bin/sh

cd /tmp
mkdir mutthtmltempdir
cd mutthtmltempdir
munpack -q -t ../tmpbox

grep ^To:.*@gizmo\.com\.au ../tmpbox > /dev/null

if [ $? == 0 ]
then
        sed -e 's#"http://www.gizmo.com.au/pics/#"#' -e 's#"newsletter/#"#' 
part2 > part2.html
        file=part2
else
        for file in part1 part2 part3 part4 part5
        do
                if [ "`file -b $file`" == "HTML document text" ]
                then
                        mv $file $file.html
                        break
                fi
        done
fi

galeon -n $file.html &
sleep 5
cd ..
rm -rf mutthtmltempdir tmpbox
===
-- 
Joshua 'bruce' Crawford ... http://www.geocities.com/mortarn

Daddy, why doesn't this magnet pick up this floppy disk?

Attachment: pgppA8lkjWpK4.pgp
Description: PGP signature