Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

PLUG IT IN!!!


computers / comp.mail.mutt / Re: opening an email file/maildir in a graphical client from the command line

SubjectAuthor
* Re: opening an email file/maildir in a graphical client from the command lJavier
`- Re: opening an email file/maildir in a graphical client from theEike Rathke

1
Subject: Re: opening an email file/maildir in a graphical client from the command line
From: Javier
Newsgroups: comp.os.linux.misc, comp.mail.misc, comp.mail.mutt
Date: Sun, 23 Aug 2020 20:39 UTC
References: 1 2 3
Path: i2pn2.org!i2pn.org!aioe.org!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!buffer1.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 23 Aug 2020 15:39:39 -0500
From: jav...@invalid.invalid (Javier)
Subject: Re: opening an email file/maildir in a graphical client from the command line
Newsgroups: comp.os.linux.misc,comp.mail.misc,comp.mail.mutt
References: <G7CdncOeAMx8OKLCnZ2dnUU78dWdnZ2d@brightview.co.uk> <slrnrjvqkb.618.please@logancomp.rathbonelaw.com> <Z4-dnfXPxfD87KHCnZ2dnUU78efNnZ2d@brightview.co.uk>
Message-ID: <2sCdncL17fWWSd_CnZ2dnUU78IvNnZ2d@brightview.co.uk>
Date: Sun, 23 Aug 2020 15:39:39 -0500
Lines: 98
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-Ts0f20L+uOg90IKng1jVxnfOJCO2ZJMRBy+yFXgKAoRj4JFKx+zi0TiNGhajgYK5kU2W7dH3XxFU6xS!cYZviXNMTSCdCB3DtgDoa8Oje1ULPNq7DhGGVo6jtg/aymlMcPXZzCk2Xf3C1I13TOGjbDK5lVz9!b7619BKeKqhIJ4UYl+L0DBh6wP+N
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 4812
X-Received-Bytes: 5038
X-Received-Body-CRC: 2365643848
View all headers
Poprocks <please@replytogroup.com> wrote:
On 2020-08-21, Javier wrote:
Does anybody know how to open an email file or mailbox in graphical client
(I mean X11 on linux) from the command line.  HTML emails look horrible
inside mutt.

Really? I quite like how my HTML mails look with links -dump

With 'links -dump' you cannot see the hyperlink URLs in the message.
Changing your entry in ~/.mailcap to this will show them as footnotes
although the readability is slightly worser than with 'links -dump'.

 text/html; lynx -force_html -display_charset=utf-8 -dump %s; copiousoutput

9 times out of 10 HTML mail is just used as a pretty useless way to
format information that could be just as easily shown in plaintext or
even something like Markdown.

Regrettably I have no choice but to deal with emails from lusers.

When I do use GUI email, I prefer Seamonkey Mail so I am quite familiar
with it.

I agree.  It looks like the best choice.  It's very lightweight.

I don't believe Seamonkey can handle maildir directly.  You might try
something like Claws Mail, which I understand can handle maildir
natively with a plugin.

Seamonkey does support maildir.

    https://www.seamonkey-project.org/releases/seamonkey2.9/changes

    Support for other message storage formats (pluggable mail stores)
    has been added (bug 402392).
    To enable the new Maildir format (instead of the default Mbox)
    for new accounts, set mail.serverDefaultStoreContractID
    to "@mozilla.org/msgstore/maildirstore;1". There is no UI for
    any of this yet.

  (c) open a given message file.eml in a given maildir, i.e.

    client --folder ${maildir}  --file ${maildir}/cur/file.eml

Not sure about this, but if you point `seamonkey -mail` to the
individual message stored as a mail file within the new/cur directory,
it may work, but I have not tried.

I have just tried and works, but it is a bit picky about the filename.
The extension must be '.eml'

    seamonkey -mail /path/to/file.eml

It will not work with a file within the new/cur directories in the
maildir, because it requires the .eml extension.  You would need to
rename of the files to have the .eml extension in the maildir.

With Thunderbird it works as

    thunderbird -file /path/to/file.eml

And it also requires the .eml extension.

I have tried with claws-mail without success.

    claws-mail --select /path/to/file.eml

In general those applications are very annoying to use on the CLI.
The first time they will pester with pop-up wizards to configure a
POP/IMAP email account.  The informaition given by --help option or
manpages is almost useless, and their config files format are
appalling.  In the case of claws-mail they use a .ini like format,
and in the case of seamonkey/thunderbird they use a profile-dir/prefs.js
extremelly complicated format, with a lot of gotchas and not very well
documented.  I am familiar with that from configuring the firefox browsers,
but is very far away from being human friendly.

Usually what I do for this is, I use `C' in mutt to save the email to a
.eml file, and then open the .eml file in Seamonkey.

Do it inside mutt with a script and a macro to .

cat >> /usr/bin/eml_view <<EOF
#!/bin/sh
    eml_file=$(mktemp).eml
    cat > ${eml_file}
    ( seamonkey -mail ${eml_file}; ) &
    # run in a subshell to avoid mutt waiting for command completition
EOF

chmod a+x /usr/bin/eml_view

cat >> .muttrc <<EOF

macro attach , "<pipe-message>/usr/bin/eml_view<enter><refresh>"
macro pager  , "<pipe-message>/usr/bin/eml_view<enter><refresh>"
macro index  , "<pipe-message>/usr/bin/eml_view<enter><refresh>"
EOF


Subject: Re: opening an email file/maildir in a graphical client from the command line
From: Eike Rathke
Newsgroups: comp.os.linux.misc, comp.mail.misc, comp.mail.mutt
Followup: comp.mail.mutt
Organization: possibly
Date: Sun, 23 Aug 2020 21:27 UTC
References: 1 2 3 4
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!lilly.ping.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: erack+nu...@posteo.de (Eike Rathke)
Newsgroups: comp.os.linux.misc,comp.mail.misc,comp.mail.mutt
Subject: Re: opening an email file/maildir in a graphical client from the
command line
Followup-To: comp.mail.mutt
Date: 23 Aug 2020 21:27:17 GMT
Organization: possibly
Lines: 46
Message-ID: <N3e8I5f42ded1T74be@kulungile.erack.de>
References: <G7CdncOeAMx8OKLCnZ2dnUU78dWdnZ2d@brightview.co.uk>
<slrnrjvqkb.618.please@logancomp.rathbonelaw.com>
<Z4-dnfXPxfD87KHCnZ2dnUU78efNnZ2d@brightview.co.uk>
<2sCdncL17fWWSd_CnZ2dnUU78IvNnZ2d@brightview.co.uk>
X-Trace: individual.net JEKPj5ixATfFp113KkvTgQIX1kK286yCEOEs3zSm3qM3q6U4Y=
Cancel-Lock: sha1:s+7a2W7nTDAg6I4h2pU5+PCmlwk=
X-Accept-Language: de,en
X-PGP-Hash: SHA256
X-PGP-Key: 0x6A6CD5B765632D3A
X-PGP-Sig: GnuPG-v2 From,Newsgroups,Subject,Followup-To,Message-ID
iQIzBAEBCAAdFiEEImXX86ewlcw5GGMLamzVt2VjLToFAl9C3tEACgkQamzVt2Vj
LTox1g//XocyANYBQYy0hWhPBCCxvbNJirce561Qb5tXfJcGTAb5/JHrw2bJhhAt
GoR9DOmt0dAbZxw5OF3PeNNCMACHBxrUXCK7bOc47xK6EvhxhLJd+kyEP79XuBSk
rOFkNncZfvVcq/1VrSsfPNjhjjLbkBNy21CbE/s9h7St2GN2/8aPMxyx2Vq0aYr+
IyD+ZoJStvr/racndFV+xm9993oSJDI1D1VsMdE535X1CPT2B7iXSXhIUA/YZwx9
iOkVd4u3aA7SSrFJ4ewOYzcQUoVj+r1CJCKPuppSxiv7XF9v1mWUbr2vSbo8I7oT
E1CKS5G4Xs7LK/ou3cAvZsXnJZVF04jw59IE8CE4tDymeB1I7+5Oozg+pXqqFSqv
RRrdy/eUh0ZLdCTN1oUoHr68402+T74iIp7QS4rKGxgTEe24cl5IY+FUxcF8mMy2
rDZ0WN0onQIPpLQ4ZmqpKABKaJmjXYipFZe76CMd86We3S0ATM+3H/Gw++g2ORtT
6lzYy685i54vrpOqYVmR/tnCMMF26MkMvIgrgFEu2DyRJwMWGGa0cP9UF+crnBCK
4EWwZzuJFLm8qL6n4HqL+fBVCePoEizVEAgfTXwOWQnsi8OLJSOX+/nqgpuGlcNF
Cl2yKD+O4DA6FDVoCyDGe7pmVe3/qp50180q0JghhlzJ4fl0h0Q= =ZUc0
User-Agent: slrn/1.0.3 (Linux)
View all headers
["Followup-To:" header set to comp.mail.mutt.]
* Javier, 2020-08-23 20:39 UTC:
Poprocks <please@replytogroup.com> wrote:
On 2020-08-21, Javier wrote:
Does anybody know how to open an email file or mailbox in graphical client
(I mean X11 on linux) from the command line.  HTML emails look horrible
inside mutt.

Really? I quite like how my HTML mails look with links -dump

With 'links -dump' you cannot see the hyperlink URLs in the message.

You can if you use elinks, they are numbered [1] like this [2] and listed
as footnotes at the end of the output like

[1] https://example.com/1
[2] https://example.com/2

Recommendable ~/.mailcap entry (one line)

text/html; /usr/bin/elinks -localhost 1 -no-connect 1 -force-html -dump %s; copiousoutput; description=HTML Text; nametemplate=%s.html

If the output in some cases is not satisfactory it can be viewed in
Firefox by piping the text/html attachment (hit 'v' on the message to
display attachments and then '|' pipe key on the attachment and enter
the script name) to a script

#!/bin/bash
TMPFILE="/tmp/$(basename $0)_$$.html"
cat>$TMPFILE
firefox $TMPFILE &
sleep 11
rm $TMPFILE

The sleep is necessary to allow Firefox to start and read the temporary
file before removing it.

Instead of hardcoding firefox (or any other browser) it's also possible
to use xdg-open for the user's preferred application.

  Eike

--
OpenPGP/GnuPG encrypted mail preferred in all private communication.
GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Use LibreOffice! https://www.libreoffice.org/


1
rocksolid light 0.7.2
clearneti2ptor