From: Valtteri Vuorikoski <vuori@notcom.org>
To: ding@gnus.org
Subject: Re: View HTML Mail in Browser
Date: Sun, 07 Feb 2021 12:23:32 +0200 [thread overview]
Message-ID: <87sg68fa6z.fsf@notcom.org> (raw)
In-Reply-To: <87wnvlz56f.fsf@gmx.net>
Felix Natter <fnatter@gmx.net> writes:
> Is there a modern best practice for reading non-trivial HTML mails? I
> know about shr, but it often fails.
I don't know about best practice, but I use Thunderbird to open
problematic mail. This is nicer than a browser since external images and
Javascript are disabled by default, and attachments can also be accessed
in the GUI application.
First, a shell script called thunderbird-open-file (I also use this with
the file indexer Recoll for opening mail files so it has some extra
functionality):
#!/bin/bash
if [[ -z "$1" ]] ; then
echo "usage: thunderbird-open-file <file>" >&2
exit 1
fi
umask 077
f=/tmp/tb-open-$$.eml
if [[ "$1" == "-" ]] ; then
rm -f "$f"
cat > "$f"
else
cp --remove-destination "$1" $f
fi
( thunderbird -file $f ; rm -f $f ) < /dev/null > /dev/null 2>&1 &
Next, the gnus integration (copypasta from gnus-summary-pipe-to-muttprint):
(defun gnus-summary-pipe-to-thunderbird (&optional command)
"Pipe this article to Thunderbird with a helper script."
(unless (stringp command)
(setq command (expand-file-name "~/bin/thunderbird-open-file -")))
(let ((gnus-summary-pipe-output-default-command
gnus-summary-pipe-output-default-command))
(gnus-summary-save-in-pipe command t)))
(defun gnus-summary-thunderbird (&optional arg)
"Show the current article using Thunderbird."
(interactive "P")
(require 'gnus-art)
(let ((gnus-default-article-saver 'gnus-summary-pipe-to-thunderbird))
(gnus-summary-save-article arg t)))
(define-key gnus-summary-mode-map (kbd "O t") 'gnus-summary-thunderbird)
(define-key gnus-article-mode-map (kbd "O t") 'gnus-summary-thunderbird)
Tip if you end up rolling your own instead: the file name passed to
"thunderbird -file" must end with ".eml". Otherwise it tries to be smart
and falls over.
-Valtteri
next prev parent reply other threads:[~2021-02-09 21:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-06 13:39 Felix Natter
2021-02-06 14:03 ` Andreas Schwab
2021-02-06 21:33 ` Felix Natter
2021-02-06 21:54 ` Adam Sjøgren
2021-02-07 9:36 ` Felix Natter
2021-02-07 12:50 ` Adam Sjøgren
2021-02-13 11:34 ` Felix Natter
2021-02-13 17:30 ` Adam Sjøgren
2021-02-08 11:05 ` Eric S Fraga
2021-02-08 11:44 ` Emanuel Berg
2021-02-08 11:58 ` Eric S Fraga
2021-02-08 12:12 ` Andreas Schwab
2021-02-08 15:06 ` Emanuel Berg
2021-02-06 23:19 ` Eric Abrahamsen
2021-05-26 14:08 ` Steinar Bang
2021-02-07 10:23 ` Valtteri Vuorikoski [this message]
2021-02-09 22:02 ` Adam Sjøgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sg68fa6z.fsf@notcom.org \
--to=vuori@notcom.org \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).