Re: mutt, html and chrome
** Luis Mochan moc...@fis.unam.mx [2012-05-15 21:24]: Very recently I started having a curious situation when I open the html version of messages with mutt. My default browser is 'chrome'. Typically, in mutt I press 'v', I find the html message from the list, I press return and the message is displayed in a new window in my running 'chrome'. Nevertheless, I sometimes get the error message 'No webpage found for the web address: file:///tmp/mutt.html'. If I insist enough times, the message eventually is successfully displayed in my browser. My guess is that there is some kind of race condition which becomes apparent only when my computer is busy, as if the browser tries to read the temporal file before mutt finishes writing and closing it. My system is debian/stable and I am using the mutt package from the distribution. Any idea/suggestion will be appreciated. ** end quote [Luis Mochan] A bit late to the party here, but I get the same with Chromium on Ubuntu. I never have the same problem with Firefox though, and since I always get fed up with Chromium quite quickly and go back to Firefox it doesn't worry me. It will be interesting to have a play with the suggestions though. I've sort of assumed it is down to the way Chrome handles it tabs and sub-processes compared to Firefox - either passing off to another sub-process causing Mutt to delete the file, or the first process trying to access the file too quickly. I've always found the interface annoying on Chrome and, unlike many people I know, found it slow and a bit of a memory hog compared to Firefox! I'm running more modern hardware now, so perhaps time to see if that has switched the tables! -- Paul Tansom | Aptanet Ltd. | http://www.aptanet.com/ | 023 9238 0001 Registered in England | Company No: 4905028 | Registered Office: Crawford House, Hambledon Road, Denmead, Waterlooville, Hants, PO7 6NU
Re: mutt, html and chrome
On Tue, May 15, 2012 at 03:50:56PM -0500, Luis Mochan wrote: Looks more like mutt is handing over the URI file:///tmp/mutt.html to your browser and before this has time to fetch the file, mutt has deleted it again; depends on your configuration in .mailcap I'm using the system's defaults since some long time ago. I guess the relevant lines in my /etc/mailcap are: text/html; /usr/bin/sensible-browser '%s'; description=HTML Text; nametemplate=%s.html text/html; /usr/bin/iceweasel '%s'; description=HTML Text; test=test -n $DISPLAY; nametemplate=%s.html text/html; /usr/bin/w3m -T text/html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html text/html; /usr/bin/lynx -force_html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html text/html; /usr/bin/w3m -dump -T text/html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html text/html; /usr/bin/html2text '%s'; copiousoutput; description=HTML Text text/html; /usr/bin/lynx -dump -force_html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html Years ago I used to have text/html; w3m %s; needsterminal; description=HTML Text; nametemplate=%s.html text/html; w3m -dump %s; copiousoutput; description=HTML Text; nametemplate=%s.html in my own .mailcap, in order to display html in a terminal, but now they are commented out. So the question now is, what should I put in my .mailcap? This seems more like an hack but it works most of the times: text/html; /usr/bin/sensible-browser '%s' sleep 2; ... text/html; /usr/bin/iceweasel '%s' sleep 2; ... ... The other question is what changed? This problem seems to be very recent in my setup. I don't know m.
Re: mutt, html and chrome
Dear Marco, Of course, simplicity is usually best! Thanks! Luis This seems more like an hack but it works most of the times: text/html; /usr/bin/sensible-browser '%s' sleep 2; ... text/html; /usr/bin/iceweasel '%s' sleep 2; ... -- o W. Luis Mochán, | tel:(52)(777)329-1734 /(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ O ascii ribbon campaign - stop html mail - www.asciiribbon.org
mutt, html and chrome
Very recently I started having a curious situation when I open the html version of messages with mutt. My default browser is 'chrome'. Typically, in mutt I press 'v', I find the html message from the list, I press return and the message is displayed in a new window in my running 'chrome'. Nevertheless, I sometimes get the error message 'No webpage found for the web address: file:///tmp/mutt.html'. If I insist enough times, the message eventually is successfully displayed in my browser. My guess is that there is some kind of race condition which becomes apparent only when my computer is busy, as if the browser tries to read the temporal file before mutt finishes writing and closing it. My system is debian/stable and I am using the mutt package from the distribution. Any idea/suggestion will be appreciated. Best regards, Luis pd. The output of mutt -v is: Mutt 1.5.20 (2009-06-14) Copyright (C) 1996-2009 Michael R. Elkins and others. Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'. Mutt is free software, and you are welcome to redistribute it under certain conditions; type `mutt -vv' for details. System: Linux 2.6.32-5-amd64 (x86_64) ncurses: ncurses 5.7.20100313 (compiled with 5.7) libidn: 1.15 (compiled with 1.15) hcache backend: tokyocabinet 1.4.37 Compile options: -DOMAIN +DEBUG -HOMESPOOL +USE_SETGID +USE_DOTLOCK +DL_STANDALONE +USE_FCNTL -USE_FLOCK +USE_POP +USE_IMAP +USE_SMTP -USE_SSL_OPENSSL +USE_SSL_GNUTLS +USE_SASL +USE_GSS +HAVE_GETADDRINFO +HAVE_REGCOMP -USE_GNU_REGEX +HAVE_COLOR +HAVE_START_COLOR +HAVE_TYPEAHEAD +HAVE_BKGDSET +HAVE_CURS_SET +HAVE_META +HAVE_RESIZETERM +CRYPT_BACKEND_CLASSIC_PGP +CRYPT_BACKEND_CLASSIC_SMIME +CRYPT_BACKEND_GPGME -EXACT_ADDRESS -SUN_ATTACHMENT +ENABLE_NLS -LOCALES_HACK +COMPRESSED +HAVE_WC_FUNCS +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_YESEXPR +HAVE_ICONV -ICONV_NONTRANS +HAVE_LIBIDN +HAVE_GETSID +USE_HCACHE -ISPELL SENDMAIL=/usr/sbin/sendmail MAILPATH=/var/mail PKGDATADIR=/usr/share/mutt SYSCONFDIR=/etc EXECSHELL=/bin/sh MIXMASTER=mixmaster To contact the developers, please mail to mutt-...@mutt.org. To report a bug, please visit http://bugs.mutt.org/. misc/am-maintainer-mode misc/hg.pmdef.debugtime debian-specific/build_doc_adjustments.diff features/ifdef features/xtitles features/trash-folder features/purge-message features/sensible_browser_position features-old/patch-1.5.4.vk.pgp_verbose_mime features/compressed-folders features/compressed-folders.debian debian-specific/Muttrc debian-specific/Md.etc_mailname_gethostbyname.diff debian-specific/use_usr_bin_editor.diff debian-specific/correct_docdir_in_man_page.diff debian-specific/dont_document_not_present_features.diff debian-specific/document_debian_defaults debian-specific/assumed_charset-compat debian-specific/467432-write_bcc.patch misc/define-pgp_getkeys_command.diff misc/gpg.rc-paths misc/smime.rc upstream/533209-mutt_perror.patch upstream/533459-unmailboxes.patch upstream/533439-mbox-time.patch upstream/531430-imapuser.patch upstream/534543-imap-port.patch upstream/538128-mh-folder-access.patch upstream/537818-emptycharset.patch upstream/535096-pop-port.patch upstream/542910-search-segfault.patch upstream/533370-pgp-inline.patch upstream/533520-signature-highlight.patch upstream/393926-internal-viewer.patch upstream/543467-thread-segfault.patch upstream/544180-italian-yesorno.patch upstream/542817-smimekeys-tmpdir.patch upstream/544794-smtp-batch.patch upstream/537694-segv-imap-headers.patch upstream/548577-gpgme-1.2.patch upstream/548494-swedish-intl.patch upstream/553321-ansi-escape-segfault.patch upstream/553238-german-intl.patch upstream/557395-muttrc-crypto.patch upstream/545316-header-color.patch upstream/568295-references.patch upstream/547980-smime_keys-chaining.patch upstream/528233-readonly-open.patch upstream/228671-pipe-mime.patch upstream/383769-score-match.patch upstream/547739-manual-typos.patch upstream/311296-rand-mktemp.patch upstream/573823-imap_internal_date upstream/542344-dont_fold_From_ upstream/537061-dont-recode-saved-attachments.patch upstream/619216-gnutls-CN-validation.patch upstream/path_max misc/hyphen-as-minus.patch misc/smime_keys-manpage.patch mutt.org
Re: mutt, html and chrome
El día Tuesday, May 15, 2012 a las 03:22:20PM -0500, Luis Mochan escribió: Very recently I started having a curious situation when I open the html version of messages with mutt. My default browser is 'chrome'. Typically, in mutt I press 'v', I find the html message from the list, I press return and the message is displayed in a new window in my running 'chrome'. Nevertheless, I sometimes get the error message 'No webpage found for the web address: file:///tmp/mutt.html'. If I insist enough times, the message eventually is successfully displayed in my browser. My guess is that there is some kind of race condition which becomes apparent only when my computer is busy, as if the browser tries to read the temporal file before mutt finishes writing and closing it. My system is debian/stable and I am using the mutt package from the distribution. Any idea/suggestion will be appreciated. Looks more like mutt is handing over the URI file:///tmp/mutt.html to your browser and before this has time to fetch the file, mutt has deleted it again; depends on your configuration in .mailcap HIH matthias -- Matthias Apitz e g...@unixarea.de - w http://www.unixarea.de/ UNIX since V7 on PDP-11, UNIX on mainframe since ESER 1055 (IBM /370) UNIX on x86 since SVR4.2 UnixWare 2.1.2, FreeBSD since 2.2.5
Re: mutt, html and chrome
Looks more like mutt is handing over the URI file:///tmp/mutt.html to your browser and before this has time to fetch the file, mutt has deleted it again; depends on your configuration in .mailcap I'm using the system's defaults since some long time ago. I guess the relevant lines in my /etc/mailcap are: text/html; /usr/bin/sensible-browser '%s'; description=HTML Text; nametemplate=%s.html text/html; /usr/bin/iceweasel '%s'; description=HTML Text; test=test -n $DISPLAY; nametemplate=%s.html text/html; /usr/bin/w3m -T text/html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html text/html; /usr/bin/lynx -force_html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html text/html; /usr/bin/w3m -dump -T text/html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html text/html; /usr/bin/html2text '%s'; copiousoutput; description=HTML Text text/html; /usr/bin/lynx -dump -force_html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html Years ago I used to have text/html; w3m %s; needsterminal; description=HTML Text; nametemplate=%s.html text/html; w3m -dump %s; copiousoutput; description=HTML Text; nametemplate=%s.html in my own .mailcap, in order to display html in a terminal, but now they are commented out. So the question now is, what should I put in my .mailcap? The other question is what changed? This problem seems to be very recent in my setup. Thanks and best regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ O ascii ribbon campaign - stop html mail - www.asciiribbon.org
Re: mutt, html and chrome
Luis Mochan schrieb am 15.05.2012 um 15:22 (-0500): If I insist enough times, the message eventually is successfully displayed in my browser. My guess is that there is some kind of race condition which becomes apparent only when my computer is busy, as if the browser tries to read the temporal file before mutt finishes writing and closing it. IIRC there was an issue where the file would get deleted before the browser would get its hands on it. There's a set of Python scripts that fixes this problem: https://bitbucket.org/blacktrash/muttils Relevant Mutt configuration: # call viewhtmlmsg from macro macro index,pager F7 \ enter-command set my_wait_key=\$wait_key wait_key=noenter\ pipe-messageviewhtmlmsg -k0enter\ enter-command set wait_key=\$my_wait_key my_wait_keyenter\ view HTML in browser macro index,pager F8 \ enter-command set my_wait_key=\$wait_key wait_key=noenter\ pipe-messageviewhtmlmsg -k0 -senter\ enter-command set wait_key=\$my_wait_key my_wait_keyenter\ view HTML (safe) in browser Michael
Re: mutt, html and chrome
Thanks Michael, I'll try that when I get to my office. I found an alternative solution at http://www.spocom.com/users/gjohnson/mutt/#html by running a simple script that saves the file and then call's the browser. Best regards, Luis On Wed, May 16, 2012 at 12:27:19AM +0200, Michael Ludwig wrote: Luis Mochan schrieb am 15.05.2012 um 15:22 (-0500): ... IIRC there was an issue where the file would get deleted before the browser would get its hands on it. There's a set of Python scripts that fixes this problem: https://bitbucket.org/blacktrash/muttils Relevant Mutt configuration: # call viewhtmlmsg from macro macro index,pager F7 \ ... Michael -- o W. Luis Mochán, | tel:(52)(777)329-1734 /(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ O ascii ribbon campaign - stop html mail - www.asciiribbon.org
Re: mutt, html and chrome
I made a small perl script (attached) that replicates the behavior of mutt_netscape by Gary A. Johnson garyj...@spk.agilent.com and which seems to solve my problem of disappearing temporal files before the browser reads them. Thanks for your kind help! Luis On Tue, May 15, 2012 at 07:30:06PM -0500, Luis Mochan wrote: Thanks Michael, I'll try that when I get to my office. I found an alternative solution at http://www.spocom.com/users/gjohnson/mutt/#html by running a simple script that saves the file and then call's the browser. Best regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `/ /\ Apdo. Postal 48-3, 62251 | (*)/\/ \ Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ O ascii ribbon campaign - stop html mail - www.asciiribbon.org #!/usr/bin/env perl use warnings; use strict; # SYNOPSIS # mutt_browse file # # DESCRIPTION # Runs a browser on a copy of a file, and sleeps for a while # before deleting it. It solves the problem that mutt may delete # the file too fast. # EXAMPLE # To use a sensible browser to view HTML attachments from mutt, add the # following line to the .mailcap file. # # text/html; /path/to/mutt_browse %s # # AUTHOR # Luis Mochan moc...@fis.unam.mx # Shamelessly adapted from mutt_netscape by # Gary A. Johnson garyj...@spk.agilent.com # # WARNING # This program has been tested in a Debian system # The temporal file is created in the /tmp directory # # Variables to be customized # # template filename for temporal file my $template=muttX; # Path to desired browser. Under Debian sensible-browser defaults to # my prefered browser, but an explicit choice such as chrome, # iceweasel, etc. may be used here. my $browser=/usr/bin/sensible-browser; # Delay to give time for browser to read file before it is destroyed my $delay=3; #in seconds # # End of customizations use File::Temp qw(tempfile); die EOF unless @ARGV==1; Usage $0 file to run a sensible-browser over copy of file EOF die Can't read $ARGV[0] unless -r $ARGV[0]; my ($fh, $fname) = tempfile($template, DIR=/tmp, SUFFIX=.html, UNLINK=1); open IN, , $ARGV[0]; while(IN){ print $fh $_; } close $fh; system $browser, $fname; sleep $delay;