• opening an email file/maildir in a graphical client from the command li

    From Javier@21:1/5 to All on Tue Aug 18 19:25:05 2020
    Does anybody know how to open an email file or mailbox in graphical client
    (I mean X11 on linux) from the command line. This is because HTML email
    looks horrible inside mutt.

    The graphical client can be anything: thunderbird, seamonkey, claws-mail, sylpheed...

    Also I would like ot open a mailbox in maildir format in a graphical client.

    What I am looking for is 3 things:

    (a) open an isolated file.eml in a graphical client to see the html rendered
    well and also the attachments.

    client --file /path/to/file.eml

    (b) open a mailbox in maildir format in a graphical client.

    client --folder ${maildir}

    This would be analogous to
    mutt -f ${maildir}

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

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

    This I doubt any graphical client support it, but I lose nothing for asking.

    I know for sure (b) is not possible in thunderbird given that the maildir support is incomplete (the new folder is not supported).

    https://wiki.archlinux.org/index.php/Thunderbird#Maildir_support

    I know CLI option support for graphical clients is very poor.
    If graphical clients don't implement that with CLI options, I would
    need to make a profile dir with an script of mine for each invocation.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Javier@21:1/5 to Poprocks on Sun Aug 23 15:39:39 2020
    XPost: comp.os.linux.misc, comp.mail.mutt

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marc Olschok@21:1/5 to javier@invalid.invalid on Sun Aug 23 21:05:48 2020
    On Wed, 19 Aug 2020 02:25:05 Javier <javier@invalid.invalid> wrote:
    Does anybody know how to open an email file or mailbox in graphical client
    (I mean X11 on linux) from the command line. This is because HTML email looks horrible inside mutt.

    I do not know if you need a _graphical_ client only for displaying
    html-emails or also for other reasons. I use mailx and pipe
    html-content to w3m inside mailx. Unlike most other text based browsers
    w3m accepts html from standard input and so it works without having
    to leave the mailx program.

    For convenience I put the command

    w3m -T text/html -I utf-8 $1

    in a shell-script under the name nhtml, and hence inside mailx

    pi . nhtml

    will display the mail as html. I guess, e.g. mutt provides similar
    options to pipe a mail to some external program.

    --
    M.O.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eike Rathke@21:1/5 to All on Sun Aug 23 21:27:17 2020
    XPost: comp.os.linux.misc, comp.mail.mutt

    ["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"
    $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/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)