To be able to view an E-Mail from Mutt under Windows either using the Windows Subsystem for Linux (WSL) or MSYS2 (as delivered with Git Bash)
- in your default GUI E-Mail client by selecting the e-mail and hitting
E
(mail), - in your default GUI browser by selecting the attached
HTML
file and hittingB
(rowser),
do as follows:
Add to ~/.muttrc
the lines
macro pager E "<pipe-message>iconv -c --to-code=UTF8 > ~/.cache/mutt/mail.eml<enter><shell-escape>~/bin/wsl-open.sh $HOME/.cache/mutt/mail.eml<enter>"
macro attach B "<pipe-entry>iconv -c --to-code=UTF8 > ~/.cache/mutt/mail.html<enter><shell-escape>~/bin/wsl-open.sh $HOME/.cache/mutt/mail.html<enter>"
and save under the path ~/bin/wsl-open.sh
this shell script
#!/bin/sh
eval cmd.exe /c /start /b "$(wslpath -w "$1")"
or, better, wsl-open.sh.
Add to ~/.muttrc
the lines
macro pager E "<pipe-message>iconv -c --to-code=UTF-8 > $XDG_CACHE_HOME/mutt/mail.eml<enter><shell-escape>`echo ""\""${EMAIL:-start}""\""` $XDG_CACHE_HOME/mutt/mail.eml 2>/dev/null<enter>"
macro attach B "<pipe-entry>iconv -c --to-code=UTF-8 > $XDG_CACHE_HOME/mutt/mail.html<enter><shell-escape>`echo ""\""${BROWSER:-start}""\""` $XDG_CACHE_HOME/mutt/mail.html 2>/dev/null<enter>"