firecat53 / urlscan

Mutt and terminal url selector (similar to urlview)
GNU General Public License v2.0
211 stars 36 forks source link

Unclickable links in mutt #114

Closed SpirleFix closed 2 years ago

SpirleFix commented 3 years ago

Hello, I'm SpirleFix and quasi new to GitHub. My last post to here was a couple of years ago, to Steve Kemp's interesting mail reader "lumail" which doesn't exist anymore, as I fear. And I used another nickname I've forgotten since. I'm interested mainly in lua and context using both in order for making family albums with photos, texts, letters and other documents.

Today I'm here because of an issue concerning "Unclickable links" in mutt's emails. Many companies reveal a strange habit when they want to get my email address confirmed: They send a short confirming link which isn't clickable and forget to add an expanded link which I could copy to and invoke in a browser (often they use a "noreply" email address additionally, so I don't be able to answer and ask).

I wrote to mutt's user list and Kenneth Flak advised me to use "urlscan" as a better "urlview" and told me to download it from here (v0.9.6) and gave me a couple of hints how to invoke it. So my .muttrc contains following rows today:

make unclickable links clickable

================================

macro index,pager \cb " urlscan -d -r 'xdg-open \"{}\"'"

# macro index,pager \cb " urlscan" "call urlscan to extract URLs out of a message" macro attach,compose \cb " urlscan" "call urlscan to extract URLs out of a message"

Besides he wrote me an entry in .mailcap: text/html; browser-mutt.sh qutebrowser %s; test=test -n "$DISPLAY" with browser-mutt.sh being:

!/bin/bash

BROWSER=$1 CONTENT=$2

mkdir -p /tmp/neomutt-arch FILENAME=$(basename $CONTENT).html

cp $CONTENT /tmp/neomutt-arch/$FILENAME $BROWSER file:///tmp/neomutt-arch/$FILENAME &

Now, I don't really succeed using mutt and urlscan to resolve such "unklickable links" (nor do I with "browser-mutt.sh" up to now.)

In the following I will send you:

  1. An example mail with such an "unklickable link" as seen by invoking "mutt".

  2. Urlscan's answer after typing CTRL-b.

  3. An excerpt of the "raw" email too, which is in HTML-Code, with the essential email part.

  4. Example mail containing an "unclickable link":

    From: noreply@magentacloud.de Reply-To: noreply@magentacloud.de To: quasi@web.de Subject: Bitte bestätigen Sie Ihre E-Mail Adresse Date: Sat, 8 May 2021 19:58:24 +0200 Message-Id: 20210508175824.E4F196DE@mx.magentacloud.de

[-- Automatische Anzeige mittels links -dump '/var/tmp/mutt.html' --] MagentaCLOUD Bestätigen Sie Ihre E-Mail-Adresse

   Telekom Logo                               Erleben, was verbindet.

Hallo SpirleFix,

Bitte bestätigen Sie, dass Sie der Inhaber der E-Mail-Adresse
quasi@web.de sind.

            Bestätigen   <--- !!!

Ihre Telekom

   © Telekom Deutschland GmbH

                                Impressum    Datenschutz    Hilfe &
                                FAQ

"Bestätigen" ("Confirm" in English) should be the clickable link!

  1. Urlscan's answer after typing CTRL-b.

    File "/bin/urlscan", line 191, in main() File "/bin/urlscan", line 168, in main tui = urlchoose.URLChooser(urlscan.msgurls(msg, regex=args.regex, headers=args.headers), TypeError: init() got an unexpected keyword argument 'whitespaceoff'

  2. "raw" email

    The excerpt of the essential location IMO is the following. The link is written as "Bestätigen" because in HTML umlaut "ä" must be written as "ä" (at the end of excerpt). It's expansion apparently is "https://www.magentacloud.de/api/user/email?token=3DioZsQNqlXBpx"

                                <td colspan=3D"9" align=3D"center" valign=3D"middle" width=3D"115"=

    height=3D"38" style=3D"text-align:center;vertical-align:middle;font-family= :Arial, Helvetica, sans-serif; font-size:15px; line-height:21px; font-weigh= t:bold; color:#ffffff; text-decoration:none;background-color:#e20074"><a hr= ef=3D"https://www.magentacloud.de/api/user/email?token=3DioZsQNqlXBpx" targ= et=3D"_blank" style=3D"text-align:center;vertical-align:middle;font-family:= Arial, Helvetica, sans-serif; font-size:15px; line-height:21px; font-weight= :bold; color:#ffffff; text-decoration:none;background-color:#e20074" class= =3D"button">Bestätigen

Please, what should be done that "urlscan" finds the link?

Best wishes, SpirleFix

firecat53 commented 2 years ago

Sorry for the delay in responding! Can you either attach the email file to this issue or email me a copy of it in .tar format. It's very difficult to troubleshoot email problems without the original email. Thanks!

firecat53 commented 2 years ago

Checking if you are able to send a .tar copy of the email. When I copy this section of your comment and run urlscan on it, the link https://www.magentacloud.de/~3DioZsQNqlXBpx is easily found.

<td colspan=3D"9" align=3D"center" valign=3D"middle" width=3D"115"=
 height=3D"38" style=3D"text-align:center;vertical-align:middle;font-family=
:Arial, Helvetica, sans-serif; font-size:15px; line-height:21px; font-weigh=
t:bold; color:#ffffff; text-decoration:none;background-color:#e20074"><a hr=
ef=3D"https://www.magentacloud.de/api/user/email?token=3DioZsQNqlXBpx" targ=
et=3D"_blank" style=3D"text-align:center;vertical-align:middle;font-family:=
Arial, Helvetica, sans-serif; font-size:15px; line-height:21px; font-weight=
:bold; color:#ffffff; text-decoration:none;background-color:#e20074" class=
=3D"button">Best&auml;tigen</a></td>
firecat53 commented 2 years ago

Closing on lack of response. Please let me know if you have further issues. Thanks!