Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Jayhawk Raven

macrumors member
Original poster
Oct 21, 2015
63
8
Kansas
When I receive an .html file as a link, I can no longer open the link in Safari from the Mail App. When I double click on the file in the email I get this:

Safari Can't Open the Page
Safari can't open the page. The error is "operation couldn't be completed.
Operation not permitted" (NSPOSIXErrorDomain:1)

I can right click on the file from the Mall App and open the file with Firefox or Chrome.

I can download the file and then open it in Safari.

I searched and found the problem might be caused by an Intego program, but I do not have any of their programs installed.

My firewall is on, but I have not touched the standard settings.

I do not have any antivirus software.


Running:
Monterey 12.1 (21C52)
iMac (Retina 5K, 27-inch, 2017)
3.4 GHz Quad-Core Intel Core i5

Any ideas?


(Edited to make title more accurate and to add hardware summary)
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
This seems to be normal behaviour. Safari runs in sandboxed mode, so it has limited permissions to access files and folders. Mail (also sandboxed) stores mail attachments in its own sandbox container, to which Safari should not have access. I do not know whether Firefox and Chrome run in sandboxed mode, but it seems that they can access files to which they should not normally have access.

You can right-click on any attachment in Mail and manually store it somewhere else first (you can set the location of the “downloads” folder in Mail’s general preferences).

You can give Safari more permissions by enabling “full disk access” for it in System Preferences → Security & Privacy → Privacy. I do not recommend doing this, because giving a browser more access makes your computer more vulnerable to vulnerabilities in the browser (and browsers often have vulnerabilities).
 

Fishrrman

macrumors Penryn
Feb 20, 2009
29,243
13,317
OP:
Could you open Mail.
And then, open an email that has one of these html "files" of which you speak...

... and then, take a screenshot and post it here, so we can "see what YOU are seeing..."?
 
Last edited:

Boyd01

Moderator
Staff member
Feb 21, 2012
7,950
4,886
New Jersey Pine Barrens
I don't quite understand what is being discussed here. Are you just talking about a web link in an e-mail, or are you actually attaching an HTML file? I'm an html/javascript developer and just did a quick test: I created a message to myself and dragged a .html file to it. That created an attachment, just like I would expect - see the screenshot from mail below.

file.png


When I double-click the icon, it opens in atom (the text editor that I have configured for .html files). It showed the location of the file as

/Users/XXXX/Library/Containers/com.apple.mail/Data/Library/Mail\ Downloads/892E2F9F-16B1-4189-88C0-0250E15250A0

Now you specifically said: an "HTML file". I would not expect that to open as a link (although that might be the default if I hadn't configured html files to open in an editor).

But if I paste a link to the webpage on the server, then it opens as a link (screenshot from mail below)

link.png



So... are you saying that when you paste a link to a webpage into mail, it doesn't open in your browser when clicked? I would not consider this an "HTML file", it's a link to a webpage. This all works for me as I would expect, but I am still running Catalina and don't have any Intego software.
 

Boyd01

Moderator
Staff member
Feb 21, 2012
7,950
4,886
New Jersey Pine Barrens
Try this:

Now, RIGHT CLICK on it with the mouse.

This should produce a contextual menu. Move to "Open With..." and you will see a range of browsers that should open the file.

Choose "Safari". Does the URL now open (as it should)?

If I try to do as you describe with the HTML file in my first example above, I get this error. This is, again, what I would expect because it's not a webpage on a server, it's just an HTML file.

Screen Shot 2022-01-09 at 11.46.56 AM.png
 

Jayhawk Raven

macrumors member
Original poster
Oct 21, 2015
63
8
Kansas
Sorry about the confusion. They are .html files emailed to me.

When I double click the icon it I get the message:
Safari Can't Open the Page
Safari can't open the page. The error is "operation couldn't be completed.
Operation not permitted" (NSPOSIXErrorDomain:1)

If I right-click on the file it gives me options to open with other apps. It will open in Firefox or Google Chrome, but not in Safari. It will not open with Safari even if I chose Safari from the menu.

Very short video.





is
Screen  2022-01-10 at 9.03.45 AM.png
 

Fishrrman

macrumors Penryn
Feb 20, 2009
29,243
13,317
"If I right-click on the file it gives me options to open with other apps. It will open in Firefox or Google Chrome, but not in Safari. It will not open with Safari even if I chose Safari from the menu."

Fishrrman's Rule #2:
Use what works for you.
Don't use what doesn't work.


If Safari won't open the files, but using Firefox or Chrome DOES, well...
... the solution ought to be obvious.

Hmmmmm....
What happens if you do this:
- Open the html file using Firefox
then
- Choose "Save As..."
then
- From the format popup, select "Web Page, HTML only"
then
- Attempt to open the saved page (from Firefox) with Safari?

Yes, this is only "a workaround".
But if it works, when other means do not... it becomes "what works".
 

Jayhawk Raven

macrumors member
Original poster
Oct 21, 2015
63
8
Kansas
The difference is, as KALLT noted, the “full disk access” for Safari. I apparently had that selected earlier, but with a clean install of Monterey it was not checked. I switched it for the test and it worked. I have turned it off again, because I am not sure of the security risk involved.

I get one of the emails almost daily, but I can open right click and use the quick look attachment feature to see if I need to open it or not. I can open in the other browsers or download and open it, which will work fine for me.

Thank you all for the help and the patience.
 

alphabetagamma

macrumors newbie
Feb 24, 2021
3
0
Having the same issue. It's a bug, and not "normal behavior". If Apple Mail delegates a document to another application (In my case a html file), the other app must get the sandbox rights to read it. "Full Disk Access" for Safari, is a work-around, but giving safari so much rights is not an ideal solution.
You can easily reconstruct the issue, via sending yourself a html file and trying to open it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.