Github messages for mblaze
 help / color / mirror / Atom feed
* Re: mhtml: Simple script to view HTML emails in browser
       [not found] <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-166@inbox.vuxu.org>
  2020-08-25 18:21 ` mhtml: Simple script to view HTML emails in browser anjandev
@ 2020-08-25 18:23 ` anjandev
  1 sibling, 0 replies; 2+ messages in thread
From: anjandev @ 2020-08-25 18:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1105 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
```
You can change dmenu to fzf or any other fuzzy finder. I use this snippet 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. It would be cool to have an attachment extractor included in mblaze.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mhtml: Simple script to view HTML emails in browser
       [not found] <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-166@inbox.vuxu.org>
@ 2020-08-25 18:21 ` anjandev
  2020-08-25 18:23 ` anjandev
  1 sibling, 0 replies; 2+ messages in thread
From: anjandev @ 2020-08-25 18:21 UTC (permalink / raw)
  To: ml

[-- 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-25 18:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-166@inbox.vuxu.org>
2020-08-25 18:21 ` mhtml: Simple script to view HTML emails in browser anjandev
2020-08-25 18:23 ` anjandev

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).