• Re: What's best way to handle HTML emails in Mutt?

    From Chris Green@21:1/5 to hobie of RMN on Sat Dec 28 11:50:01 2024
    hobie of RMN <hobie@rumormillnews.com> wrote:
    For 20 years I've enjoyed Mutt as my primary mail reader. I used its 'bounce' feature to deal with HTML mails, sending them to a webmail
    program on a different server. But now the jellyfish anti-spam daemon
    won't allow me to do that; it rejects my bounced emails because "From:"
    and "(envelope-from)" are not the same.

    What's the best way to handle this? Switch to Thunderbird or claws-mail?

    I simply use lynx to view 99% of HTML E-Mail and the odd one that
    doesn't view well by that means I feed into my web browser. All on
    the same machine.

    In ~/.mailcap I have:-

    text/html; lynx -dont_wrap_pre -dump %s; copiousoutput; nametemplate=%s.html

    That does the work of viewing most HTML E-Mail as text. Then, when
    that doesn't work I use 'v' in mutt to view the parts of the E-Mail
    and feed the text/html bit to my browser with 'm' (view-mailcap).

    To do this second bit I have the following in ~/.mailcap:-

    text/html; /home/chris/bin/muttview %s html

    This comes before the line that calls lynx, I can't quite remember how
    it works, I think it's the 'copiousoutput' bit that means that line
    gets selected by default.

    The /home/chris/bin/muttview is rather complicated in my case because
    I run mutt remotely by ssh and feed the html back through the ssh
    connection with a reverse tunnel to view in the browser on the client
    machine. If you are running mutt locally then just call your web
    browser.

    --
    Chris Green
    ·

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Henning Follmann@21:1/5 to Chris Green on Sat Dec 28 14:40:01 2024
    Just a few additional bits added

    On Sat, Dec 28, 2024 at 10:23:09AM +0000, Chris Green wrote:
    hobie of RMN <hobie@rumormillnews.com> wrote:
    For 20 years I've enjoyed Mutt as my primary mail reader. I used its 'bounce' feature to deal with HTML mails, sending them to a webmail
    program on a different server. But now the jellyfish anti-spam daemon won't allow me to do that; it rejects my bounced emails because "From:"
    and "(envelope-from)" are not the same.

    What's the best way to handle this? Switch to Thunderbird or claws-mail?

    I simply use lynx to view 99% of HTML E-Mail and the odd one that
    doesn't view well by that means I feed into my web browser. All on
    the same machine.

    To get most HTML displayed inside mutt you could add this to your .muttrc:

    # for html mails
    alternative_order text/plain text/html
    unauto_view *
    auto_view text/html
    macro index,pager \cb "<pipe-message> urlscan<Enter>" "call urlscan to extract URLs out of a message"
    macro attach,compose \cb "<pipe-entry> urlscan<Enter>" "call urlscan to extract URLs out of a message"

    The bottom two lines are for urlscan. The output is not really pretty, but
    you will see the real url . These then will open with whatever xdg-open is
    set to.

    In ~/.mailcap I have:-

    text/html; lynx -dont_wrap_pre -dump %s; copiousoutput; nametemplate=%s.html


    As some pointed out the other option w3m;
    This is what is in my .mailcap:

    text/html; w3m -dump -o display_link_number=true -I %{charset} -T text/html '%s'; copiousoutput; description=HTML Text; %nametemplate=%s.html; needsterminal; priority=1


    That does the work of viewing most HTML E-Mail as text. Then, when
    that doesn't work I use 'v' in mutt to view the parts of the E-Mail
    and feed the text/html bit to my browser with 'm' (view-mailcap).
    [...]



    -H

    --
    Henning Follmann | hfollmann@itcfollmann.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to hobie of RMN on Sat Dec 28 16:10:01 2024
    On Fri, Dec 27, 2024 at 23:41:39 -0500, hobie of RMN wrote:
    For 20 years I've enjoyed Mutt as my primary mail reader. I used its 'bounce' feature to deal with HTML mails, sending them to a webmail
    program on a different server. But now the jellyfish anti-spam daemon
    won't allow me to do that; it rejects my bounced emails because "From:"
    and "(envelope-from)" are not the same.

    What's the best way to handle this?

    It depends on what you want to do. For me, there are two different
    modes of dealing with HTML email in mutt.

    The first mode is allowing mutt to run a text web browser to render
    the HTML into readable text. It's been a while since I configured
    this, but I believe it's these three lines in my .muttrc which do it:

    alternative_order text/plain text/html
    unauto_view *
    auto_view = text/html

    If a message is sent in mixed mode (text/plain AND text/html parts),
    then mutt shows the text/plain part. (Note: this may or may not be
    a faithful rendering of the HTML part. It's whatever the sender put
    in that part, and it may be missing some information.)

    If a message is sent with ONLY a text/html part, then mutt chooses
    a text web browser to render it. I recommend installing "links"
    because it does a better job than "lynx". If links is not present
    but lynx is, lynx will be used, which is... marginally acceptable.

    The second mode that I use is to copy the HTML part to a file, and
    then scp it to my local machine, and then load it in a web browser.
    While reading the message, press 'v' to view the parts in a tree
    layout. Use the arrows to select the text/html part, then press 's'
    to save it to a file. You'll be prompted for a filename; I use the
    same filename every time (foo.html) just to make the procedure easy.

    Once foo.html is saved on the mutt host, scp it to your local host.
    If your local and remote hosts are the same machine, then you can
    skip this step. Of course, you can use rsync, sftp, or whatever.

    Once foo.html is copied to the local host, go to your web browser
    (Firefox or Chromium or whatever), press Ctrl-t to open a new tab,
    and select file:///home/yourname/foo.html in the URL bar. If you
    use the same filename every time, then this will be in your history
    already (after the first time), which greatly reduces the amount of
    typing needed in this step. Hit Enter, and voila. Now you're
    reading the text/html part the way the sender intended, including
    loading all of the tracking images that tell them you've opened the
    email.

    Now, this is just my personal workflow, and you may come up with
    different ways to deal with it. Just find whatever works best for
    you.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ghe2001@21:1/5 to hobie of RMN on Sat Dec 28 06:10:01 2024
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512







    On Friday, December 27th, 2024 at 9:41 PM, hobie of RMN <hobie@rumormillnews.com> wrote:

    For 20 years I've enjoyed Mutt as my primary mail reader. I used its
    'bounce' feature to deal with HTML mails, sending them to a webmail
    program on a different server. But now the jellyfish anti-spam daemon
    won't allow me to do that; it rejects my bounced emails because "From:"
    and "(envelope-from)" are not the same.

    What's the best way to handle this? Switch to Thunderbird or claws-mail?

    Look into protonMail -- their free client might work for you (did for me):

    https://mail.proton.me

    --
    Glenn English

    -----BEGIN PGP SIGNATURE-----
    Version: ProtonMail

    wsC5BAEBCgBtBYJnb4YKCZCf14YxgqyMMkUUAAAAAAAcACBzYWx0QG5vdGF0 aW9ucy5vcGVucGdwanMub3JnrHcnVX25VUjYcl+TOM5AS1w3+18NEwGF3XUD ycA0uDAWIQQsonMPQlJwJWNADZef14YxgqyMMgAAUxYIAK9SWNsk18cZnBVD C1DQsDS+R/kakTrNXL3/lypK45wP2v7LxP4O07yOjYxgTVO7w9juC/HwBG16 zxznEcZx/JRtuC2j80HXf8eue89Uje9oza7pqGLjBKkOyKsKK37A3/JCzrlc pKHRQTeBCu98aemLEltBlYerHfcShkwoScNuDtNvxG8XULGxeCODpmr3a7/+ U0Y6ptfyEzKLSA+fp7PGuSu8Fzjl7YT+YJMYwA2YAparIJ3bY10vyrPiTX3X y+MViAD1cZUw/7Xb9/kSNbuKCgsp5osbNSuZV1V9Un7pxHhabVhBGtNhwqhG K2ECukvg+JsDy6iXu+NKBmulGXE=
    =GqwH
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From hobie of RMN@21:1/5 to All on Sat Dec 28 05:50:01 2024
    For 20 years I've enjoyed Mutt as my primary mail reader. I used its
    'bounce' feature to deal with HTML mails, sending them to a webmail
    program on a different server. But now the jellyfish anti-spam daemon
    won't allow me to do that; it rejects my bounced emails because "From:"
    and "(envelope-from)" are not the same.

    What's the best way to handle this? Switch to Thunderbird or claws-mail?

    --hobie

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to All on Sat Dec 28 08:40:01 2024
    On Sat, Dec 28, 2024 at 05:01:15AM +0000, ghe2001 wrote:
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512







    On Friday, December 27th, 2024 at 9:41 PM, hobie of RMN <hobie@rumormillnews.com> wrote:

    For 20 years I've enjoyed Mutt as my primary mail reader. I used its 'bounce' feature to deal with HTML mails, sending them to a webmail
    program on a different server. But now the jellyfish anti-spam daemon
    won't allow me to do that; it rejects my bounced emails because "From:"
    and "(envelope-from)" are not the same.

    What's the best way to handle this? Switch to Thunderbird or claws-mail?

    Look into protonMail -- their free client might work for you (did for me):

    https://mail.proton.me

    Does their client work with another mail service, though?

    I mean: the client is reportedly GPLV3, but what does that help you if
    you are tied to their "service"?

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZ2+qlwAKCRAFyCz1etHa RmlIAJ41lXIfaUKXnWnRbhq8fBDpZpBupgCeKc96MVmaXXhNd/kCU5s/4kwDimY=
    =imOR
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christoph Brinkhaus@21:1/5 to All on Sat Dec 28 09:50:01 2024
    Am Fri, Dec 27, 2024 at 11:41:39PM -0500 schrieb hobie of RMN:
    For 20 years I've enjoyed Mutt as my primary mail reader. I used its 'bounce' feature to deal with HTML mails, sending them to a webmail
    program on a different server. But now the jellyfish anti-spam daemon
    won't allow me to do that; it rejects my bounced emails because "From:"
    and "(envelope-from)" are not the same.

    What's the best way to handle this? Switch to Thunderbird or claws-mail?

    May be you can use the send-hook for that purpose.
    See below an example of my muttrc. Usually I use my t-online account.
    With the send-hook the "From:" is changed in case the receiver has a
    gmx address.

    send-hook . 'unmy_hdr From:'
    send-hook '~t ^.*@gmx\.net$' 'my_hdr From: Christoph Brinkhaus <brinkhaus@gmx.net>'

    For your issue -t might not help, additionally I do not know if
    envelope-from can be changed by a send-hook. But the example should show
    that it is not pure black magic. May be it is a starting point for you.

    Kind regards,
    Christoph
    --
    Ist die Katze gesund
    schmeckt sie dem Hund.

    -----BEGIN PGP SIGNATURE-----

    iQGzBAABCgAdFiEEj7zWuLpAjGEt2B3aIXCAe2OOngIFAmdvubQACgkQIXCAe2OO ngJg0QwAgGkAc7ychQJyAWnKvuTLB6ut50bfYMEimHsvahxpgktsUg/HnimkRrbc H1jX98u0BMZcDMOXVU90FIIstYV6GINSZn9gZVd46eCHinDntv9hgu2LLAz7ImEN sTkyCxmO7rDh1T3ni6NHExM4hoR+xXmp6H/OXCDfkSC96f0QbMuXmFl2279c+Ixq 1RURCzaCvuqxk/h4jjlFv2hgN7K/s6CDwHzPofWbKLZ9AEqJ1rlKUOJCROzrnQjW 3g1Gizus2osAiMXVOfpD9C/luwDJDh5/dlfAVZHksRa6bZBtQBOATctQD5NCTUEX iWn/C/mHUWFEogL2F10INiKx3yiOzrrHp86PIXmfvOAPgkxMBnYhmde42R/xPUU0 2tB7eSd0IXJ9f39VussAw3sD0yAfPXEKSjgQiLBV1PyQUTsecOnV6XDeWCmb9Y0q 0vOgyoqhcmWx1yhVOPJnqXW7oGOjCN1APDL3VPrdv9/AL12EZuxXMYIOfaAOno0g
    EcvAJFrG
    =Jkcq
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Smith@21:1/5 to hobie of RMN on Sat Dec 28 11:00:01 2024
    Hi,

    On Fri, Dec 27, 2024 at 11:41:39PM -0500, hobie of RMN wrote:
    For 20 years I've enjoyed Mutt as my primary mail reader. I used its 'bounce' feature to deal with HTML mails, sending them to a webmail
    program on a different server.

    I also use Mutt. I have Mutt's mailcap set to view the text/html part
    with w3m. This is good enough for most cases but where the mail is
    complicated I just use a keybinding to load it into a local firefox.

    If you are running Mutt on the same computer that your web browser is on
    then you could just set up your mailcap to always view with the browser.

    If like me you are running Mutt on some other machine it gets a bit more complicated as you can't just have mutt execute the browser. Even if X forwarding worked it would be painful. So I call a script from Mutt's
    mailcap for text/html that:

    1. works out which host I am connected from currently

    2. copies the html part to that host

    3. connects to that host and executes a program that opens a new tab in
    my running browser, with the path to the html file from (2) as the
    URL.

    now the jellyfish anti-spam daemon won't allow me to do that; it
    rejects my bounced emails because "From:" and "(envelope-from)" are
    not the same.

    I'm amazed that this worked for you for as long as it did to be honest,
    due to things like SPF and DKIM.

    SPF is basically a DNS record that enumerates the IP networks that can
    send email "from" a domain. When you bounce an email you're asserting
    that you are authorised to send emails "from" users at that domain, but
    your domain's SPF record only allows certain hosts.

    If that record is under your control, and if your machine with Mutt has
    a static IP address, then you could add it to the record.

    Otherwise if you can find a way to send yourself the email while
    changing the From: address to something else then it will probably
    continue to work for you. However, many Email Service Providers do now
    require that all incoming email have at least one of SPF or DKIM
    passing, so that's an added wrinkle.

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    Please consider the environment before reading this e-mail.
    — John Levine

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