Unofficial archive. This is a read-only, community-run archive of the Apple Support Community. It is not affiliated with or endorsed by Apple Inc.

Safari cannot open URL links from Mail messages

Safari can't always open URL links in Mail messages


Here is an example of a URL that Safari can't open "because the page's address isn't valid". It came to me along with the unlocking code for software I purchased. It links to a document.


Extracting the code under the click-here button produces the following, which is essentially identical to the url Mac says is invalid.


***


Does anyone know why I am having this problem? It started a few months ago (a few updates back for macOS 26.x, well before v.27)


Thanks!


[Edited by Moderator]

5 replies

For a URL to be considered valid, it needs to specify a valid protocol, among other requirements.


For example, if you were to type or paste abcd://xyz.com in Safari's Smart Search field Safari will return a dialog "Safari cannot open the page because the address is invalid." The same will occur if the provided URL contains spaces or other unrecognized or superfluous characters.


https://www.apple.com is an example of a valid URL: valid protocol, valid characters, valid domain, etc.


A link in an email can be malformed for any number of reasons, many of which are intentional, some of which are malicious. It's the reason clicking links in an email is generally not a good idea, although the major threat in doing so results in loading a phony web page used to deceive people into doing something they would not otherwise do.


Does anyone know why I am having this problem?


Copy and paste the alleged link into a text editor, TextEdit or Notes for example, and examine it yourself for compliance. This site tends to frown on posting URLs in general — for the aforementioned reasons.

This is a stretch but since this behavior has been occurring for some time, is it possible some Safari-altering modification is involved?


That is a broad question but if you are not sure / don't know / want to find out, the easiest way would be to download and run EtreCheck. Instructions are here: How to run the Etrecheck Diagnostic Tool - Apple Community


Post that report in a reply to this Discussion. EtreCheck is overkill for the purpose but it's easy to use.

When I examined the link in Text, I could see the "real" address. I extracted that, and it took me to the correct (and legitimate) page. Using the link on that website page I downloaded the demo (via the App Store), and entered the license key. Everything worked as expected.


If you had to manually extract a valid URL from something it seems to me the link in the email was malformed. Intentionally or not, with or without malicious intent, who knows. Hanlon's razor applies.


Is there any way my computer could be interpreting data in these long addresses so that "proper" form is lost to unrecognized characters? Perhaps spaces or non-ASCII characters are somehow inserted or substituted???


Extraneous / non-printing characters would certainly explain it but your Mac isn't doing that. Neither is the Mail app. It is whatever the email body actually contains.


For what it is worth, the invalid address is about 290 characters long. Does something choke beyond 256 characters?!


Good question but the Safari browser supports URLs tens of thousands of characters in length.

You should NEVER directly click on links provided in email messages.


ALWAYS retype the web site name YOU KNOW or derived from reliable sources and type the URL yourself.


Will there be times you MUST use a provided link?


There may be, from time-to-time, but it is a really Bad Idea™ to do so.

I am generally very careful about links in emails. The substance of this email concerned an app I had just purchased. The purchase said there would be a thank you bonus. The email came from a marketing company but was about the thank you. It included the name of the bonus program and the name of the company. It included a download link for a related program and the unlocking key.


I usually retype the web address as suggested by Grant, but this time it seemed legit: exactly what I was told to expect, appropriate timing, no odd-looking graphics, no spelling or grammatical mistakes. So I clicked it, and ended up with an invalid address error.


When I examined the link in Text, I could see the "real" address. I extracted that, and it took me to the correct (and legitimate) page. Using the link on that website page I downloaded the demo (via the App Store), and entered the license key. Everything worked as expected.


This is not the first time I have seen this error. It is not a one-off screwup. Two days ago I ran into the problem trying to subscribe to a major Canadian newspaper. (I worked around the problem.) I have seen it several times over the past six months or so. I don't recall ever encountering it before.


Is there any way my computer could be interpreting data in these long addresses so that "proper" form is lost to unrecognized characters? Perhaps spaces or non-ASCII characters are somehow inserted or substituted???


For what it is worth, the invalid address is about 290 characters long. Does something choke beyond 256 characters?!