Github messages for mblaze
 help / color / mirror / Atom feed
From: anjandev <anjandev@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: mhtml: Simple script to view HTML emails in browser
Date: Tue, 25 Aug 2020 20:21:22 +0200	[thread overview]
Message-ID: <20200825182122.9MXa7fKMRUUH72zBukj_aia48xih2XxfKW5jDngphlY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-166@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 973 bytes --]

New comment by anjandev on mblaze repository

https://github.com/leahneukirchen/mblaze/issues/166#issuecomment-680193006

Comment:
Hi @Anachron, thank you for sharing your approach for opening html emails. I built upon your example for an approach that works for me:

```
ATTACH="$(mshow -t . | dmenu)"
MIME="$(echo "$ATTACH" | cut -f 2 -d ":" | cut -f 2 -d " ")"
ATTACHNUM="$(echo "$ATTACH" | cut -f1 -d':')"

tmp="$(mktemp '/tmp/mblaze.XXXXXX')"
mshow -O . "$ATTACHNUM" > "$tmp"
# replace this with xdg?
case "$MIME" in
	"application/pdf")
		zathura "$tmp"
		;;
	"text/html")
		firefox "$tmp" 
		;;
# More stuff for pngs and stuff?
esac
```

I use it as a general tool for extracting all attachments in emails in my email script I made for my pinephone:

https://git.sr.ht/~anjan/sxmo-userscripts/tree/master/mail.sh#L79

I dont know if my approach is the best but it works for emails with multi html and works as a general attachment extractor.

       reply	other threads:[~2020-08-25 18:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-166@inbox.vuxu.org>
2020-08-25 18:21 ` anjandev [this message]
2020-08-25 18:23 ` anjandev

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=20200825182122.9MXa7fKMRUUH72zBukj_aia48xih2XxfKW5jDngphlY@z \
    --to=anjandev@users.noreply.github.com \
    --cc=ml@inbox.vuxu.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).