Re: URL not extracted from HTML by w3m in mutt autoview

2010-07-14 Thread Erik Christiansen
On Tue, Jul 13, 2010 at 08:21:02AM -0400, Patrick Shanahan wrote:
 
 check the header for Content-Type:, it should contain:
   Content-Type: text/html; charset=UTF-8

It's there, but spread over two lines:

Content-Type: text/html;
   charset=UTF-8

As expected, merging the lines made no difference.

 If it is not there, add it.  If it is there but not 
   'text/html; charset=UTF-8'  
 change it and see what you get.

Many thanks for the diagnostic help. At the very least, I'm learning as
we go along.

Erik


Re: URL not extracted from HTML by w3m in mutt autoview

2010-07-14 Thread Erik Christiansen
On Tue, Jul 13, 2010 at 09:16:21AM -0700, Gary Johnson wrote:
 On 2010-07-13, Erik Christiansen wrote:
  I had thought that =3D was a m$-ism?
 
 The = at the end of the line and =3D stuff is quoted-printable,
 a type of Content-Transfer-Encoding defined by RFC 2045.  Mutt
 already knows how to deal with that and decodes it before piping the
 result to w3m.
 
 Is the URL in the text of the message, or is it embedded within an
 A tag?  Posting the problematic URL with a few lines of context may
 help us see the problem better.

It's in an A tag: (I've munged some of the href's characters in this post)

td height=3D60 colspan=3D3 align=3Dcenter valign=3Dmiddle=
font face=3DArial color=3D#66 style=3Dfont-size:10pxa titl=
e=3DView Email Online link href=3Dhttp://example.media.xyz.com.au:80/t=
rack?t=3Dvmid=3D45671msgid=3D87652did=3D87641edid=3D26341sn=3D374852=
7545eid=3df...@example.stuff.neteeid=3df...@example.stuff.netuid=3D9=
56897rid=3D234564erid=3D234564fl=3Dmvid=3Dextra=3D2000eu=3D425=
viewonline style=3Dcolor: #66Click here if you cannot view this =
email properly/a/spanbr /=20

 What happens if you open the attachment in the attachment menu?
 That will use w3m to display the message instead of just using w3m
 as a filter.  Do you see the * as a link?

It's not an attachment. The message is only text/html.
(Yes, I do dump 99% of them, just not this one. :)

Thanks for the enlightenment thus far.

Erik


text/html change from 1.5.18 to 1.5.20

2010-07-14 Thread Matt Larson
I finally got around to upgrading from a crufty build of 1.5.18 to
1.5.20 (hg HEAD from 30 June 2010) .  I run mutt on a Mac and use this
line in mailcap to handle any HTML MIME parts:

text/html; cat  /tmp/mutt.html\;open /tmp/mutt.html

When I message had an HTML part I wanted to view, I'd hit v, select
the HTML part, hit return, and this usage of Mac OS's open command
would open a new tab in Safari.

I no longer get that behavior in 1.5.20.  Instead I get this error:

  [-- text/html is unsupported  --]

  ---Attachment: text/html (all)
  Key is not bound.  Press '?' for help.

If I add copiousoutput to the mailcap entry, 1.5.20 behaves
similarly to 1.5.18, except that mutt now automatically and sometimes
unexpectedly (to me) calls open, sending focus to Safari when I
don't necessarily expect it.  I'd prefer the older behavior if there's
any way to get it back.

Does anyone have any ideas?

Thanks,

Matt


Re: prevent gmail from rewriting from envelope

2010-07-14 Thread Ben Moon
Dear Nicolas,
 Notice I don't set use_envelope_from.
*grummel* still doesn't work. I was just thinking: do have some official 
dns-name on your mutt box? I'm behind a router in a private network and thought 
that this might be the problem; somehow.

Thank you

Ben


Re: text/html change from 1.5.18 to 1.5.20

2010-07-14 Thread Dermot
On 14 July 2010 15:55, Matt Larson mlar...@verisign.com wrote:
 I finally got around to upgrading from a crufty build of 1.5.18 to
 1.5.20 (hg HEAD from 30 June 2010) .  I run mutt on a Mac and use this
 line in mailcap to handle any HTML MIME parts:

 text/html; cat  /tmp/mutt.html\;open /tmp/mutt.html

 When I message had an HTML part I wanted to view, I'd hit v, select
 the HTML part, hit return, and this usage of Mac OS's open command
 would open a new tab in Safari.


I do a similar thing with Opera with the following mailcap line:
text/html; opera %s sleep 1; test=sh -c 'test $DISPLAY'

Have you tried something like:
text/html; open %s
or
text/html; open %s  sleep 1

Shouldn't %s be the preferred form as mutt creates a unique file in
/tmp, so creating it manually shouldn't be necessary. I added the
sleep so that the file wouldn't be deleted before it was opened (when
there is an existing Opera window subsequent executions finish
immediately)

 I no longer get that behavior in 1.5.20.  Instead I get this error:

  [-- text/html is unsupported  --]

  ---Attachment: text/html (all)
  Key is not bound.  Press '?' for help.

 If I add copiousoutput to the mailcap entry, 1.5.20 behaves
 similarly to 1.5.18, except that mutt now automatically and sometimes
 unexpectedly (to me) calls open, sending focus to Safari when I
 don't necessarily expect it.  I'd prefer the older behavior if there's
 any way to get it back.

copiousoutput is used where there is a large amount of text expected
from stdout of the mailcap command.
e.g. text/html; lynx -force_html -dump %s ; copiousoutput


 Does anyone have any ideas?

 Thanks,

 Matt


From the timestamp on my mailcap I had it running ok for mutt 1.5.18
and it hasn't been modified since I upgraded to 1.5.20. I'm on Debian
Testing so YMMV on a Mac. I probably got most of my mailcap entries
from http://www.spocom.com/users/gjohnson/mutt/

Regards,
Dermot


Re: text/html change from 1.5.18 to 1.5.20

2010-07-14 Thread Brendan Cully
On Wednesday, 14 July 2010 at 10:55, Matt Larson wrote:
 I finally got around to upgrading from a crufty build of 1.5.18 to
 1.5.20 (hg HEAD from 30 June 2010) .  I run mutt on a Mac and use this
 line in mailcap to handle any HTML MIME parts:
 
 text/html; cat  /tmp/mutt.html\;open /tmp/mutt.html
 
 When I message had an HTML part I wanted to view, I'd hit v, select
 the HTML part, hit return, and this usage of Mac OS's open command
 would open a new tab in Safari.

press 'm' (view-mailcap) instead of return. view-mailcap is for
launching external viewers, whereas return tries to get data into the
pager (using mailcap entries tagged 'copiousoutput').

There was some good discussion about this change, but I no longer
remember the details. It's in the mutt-dev archive somewhere :)


Re: URL not extracted from HTML by w3m in mutt autoview

2010-07-14 Thread Gary Johnson
On 2010-07-14, Erik Christiansen wrote:
 On Tue, Jul 13, 2010 at 09:16:21AM -0700, Gary Johnson wrote:
  On 2010-07-13, Erik Christiansen wrote:
   I had thought that =3D was a m$-ism?
  
  The = at the end of the line and =3D stuff is quoted-printable,
  a type of Content-Transfer-Encoding defined by RFC 2045.  Mutt
  already knows how to deal with that and decodes it before piping the
  result to w3m.
  
  Is the URL in the text of the message, or is it embedded within an
  A tag?  Posting the problematic URL with a few lines of context may
  help us see the problem better.
 
 It's in an A tag: (I've munged some of the href's characters in this post)
 
 td height=3D60 colspan=3D3 align=3Dcenter valign=3Dmiddle=
 font face=3DArial color=3D#66 style=3Dfont-size:10pxa titl=
 e=3DView Email Online link href=3Dhttp://example.media.xyz.com.au:80/t=
 rack?t=3Dvmid=3D45671msgid=3D87652did=3D87641edid=3D26341sn=3D374852=
 7545eid=3df...@example.stuff.neteeid=3df...@example.stuff.netuid=3D9=
 56897rid=3D234564erid=3D234564fl=3Dmvid=3Dextra=3D2000eu=3D425=
 viewonline style=3Dcolor: #66Click here if you cannot view this =
 email properly/a/spanbr /=20

If the URL is embedded within an A ... tag, as this one is, then
w3m will not display it.  That is, in an HTML link written like
this,

A href=http://foo.com;bar/A

w3m will display bar but not http://foo.com;.

In your original post you said that the URL was rendered as *.
Did the * appear instead of Click here if you cannot view this
email properly or was the * in front of Click here ...?

  What happens if you open the attachment in the attachment menu?
  That will use w3m to display the message instead of just using w3m
  as a filter.  Do you see the * as a link?
 
 It's not an attachment. The message is only text/html.
 (Yes, I do dump 99% of them, just not this one. :)

I guess I should have been more clear and written, What happens if
you open the attachment or the message in the attachment menu?  I
expect w3m to highlight the link but not display the URL.

If your w3m is configured to allow the use of an external browser,
typing

EscM

on the link will open the link in the external browser.

Regards,
Gary



Re: URL not extracted from HTML by w3m in mutt autoview

2010-07-14 Thread Erik Christiansen
On Wed, Jul 14, 2010 at 11:29:34AM -0700, Gary Johnson wrote:
 On 2010-07-14, Erik Christiansen wrote:
  It's in an A tag: (I've munged some of the href's characters in this post)
  
  td height=3D60 colspan=3D3 align=3Dcenter valign=3Dmiddle=
  font face=3DArial color=3D#66 style=3Dfont-size:10pxa titl=
  e=3DView Email Online link href=3Dhttp://example.media.xyz.com.au:80/t=
  rack?t=3Dvmid=3D45671msgid=3D87652did=3D87641edid=3D26341sn=3D374852=
  7545eid=3df...@example.stuff.neteeid=3df...@example.stuff.netuid=3D9=
  56897rid=3D234564erid=3D234564fl=3Dmvid=3Dextra=3D2000eu=3D425=
  viewonline style=3Dcolor: #66Click here if you cannot view this =
  email properly/a/spanbr /=20
 
 If the URL is embedded within an A ... tag, as this one is, then
 w3m will not display it.  That is, in an HTML link written like
 this,
 
 A href=http://foo.com;bar/A
 
 w3m will display bar but not http://foo.com;.

Ah, thank you. (And for improving my understanding of html.)

 In your original post you said that the URL was rendered as *.
 Did the * appear instead of Click here if you cannot view this
 email properly or was the * in front of Click here ...?

The latter. It displays like this:

*
 Click here if you cannot view this email properly

   What happens if you open the attachment in the attachment menu?
   That will use w3m to display the message instead of just using w3m
   as a filter.  Do you see the * as a link?

Wow. It opens the link in firefox.
(Do you know, I've never before considered opening the message body in
the attachment menu.)

  It's not an attachment. The message is only text/html.
  (Yes, I do dump 99% of them, just not this one. :)
 
 I guess I should have been more clear and written, What happens if
 you open the attachment or the message in the attachment menu?  I
 expect w3m to highlight the link but not display the URL.

It automatically followed the link, opening it in firefox.

 If your w3m is configured to allow the use of an external browser,
 typing
 
 EscM
 
 on the link will open the link in the external browser.

Seems like it shot right past any opportunity to do that.

Many thanks for helping me understand better what's happening between
mutt and w3m, to get to the browser.

I might just interpose a wrapper around w3m, taking your information to
modify the 

 A href=http://foo.com;bar/A

to
  A href=http://foo.com; http://foo.com; bar/A

Then I can copy-paste the displayed URL into an extant firefox instance,
instead of locking up mutt until a firefox instance, opened via the
attachment menu, is closed.

Erik

P.S. I have to go bush for a week in an hour, so apologies if you're
curious enough to probe further. My replies will necessarily be delayed.

-- 
Last year China overtook Japan as the world's biggest carmaker.
This year it overtook America as the biggest car market.
  - Michael Robinson (BBC, July 2010)