show remote content, temporarily

Board for discussions around the Epyrus mail and news client.

Moderator: athenian200

User avatar
Navigator
Fanatic
Fanatic
Posts: 121
Joined: 2023-02-24, 17:53

show remote content, temporarily

Unread post by Navigator » 2024-04-02, 01:26

An earlier thread I created about this has been locked. I do not recall any transgressions therein so I presume the closure is housekeeping only. I would like to raise this issue for attention again, if/when there is time for its consideration.

Simply stated: I would like I way to reverse the action "Show remote content in this message." I don't really care how this reversal is performed, be it per-message or globally, manually or automatically.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1551
Joined: 2018-10-28, 19:56
Location: Georgia

Re: show remote content, temporarily

Unread post by athenian200 » 2024-04-02, 02:28

Yeah, I didn't close the thread, but I think the threads do lock themselves after a certain amount of time without activity.

The main problem here is the same as what I said before... I just genuinely have no idea how "show remote content" actually works, because I inherited that functionality from Thunderbird, and thus I have no idea how to "unshow" remote content if someone elects to do that.

It seems like it should be fairly trivial in theory, though... just unsetting a flag somewhere that gets set on the message after you click that button.

Does it persist after Epyrus is closed and re-opened, or after you switch to looking at a different message? I always assumed that "show remote content" was a temporary flag that only lasted until you switched to a different message or closed Epyrus, I didn't actually know it was persistent.

One idea I'm wondering about is... whether it's possible that the issue is that once you click that button, the remote content is cached locally, and thus is automatically loaded up when you view the message again. After all, the whole point of having the remote content not shown is to avoid interacting with remote servers... once you've fetched that content, it's on your machine just like the rest of the message is.

So probably it's just an oversight in the original design, because it was assumed that if you have the bandwidth and trust the remote machine hosting the content enough to fetch that stuff for the message, there isn't any reason why you'd want to go back to the "neutered" form of the message that is mostly created for security or bandwidth reasons.

And thus, if that theory is correct, you should be able to stop showing the remote content by clearing the cache somehow. Though I honestly don't really dig down into the options enough to know how to play with all of this...
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
Navigator
Fanatic
Fanatic
Posts: 121
Joined: 2023-02-24, 17:53

Re: show remote content, temporarily

Unread post by Navigator » 2024-04-02, 15:57

athenian200 wrote:
2024-04-02, 02:28
One idea I'm wondering about is... whether it's possible that the issue is that once you click that button, the remote content is cached locally, and thus is automatically loaded up when you view the message again. After all, the whole point of having the remote content not shown is to avoid interacting with remote servers... once you've fetched that content, it's on your machine just like the rest of the message is.
That didn't even occur to me. If that's how this works there is no problem, as it's the presumed repeated network access I am trying to avoid. I don't care to have the server know whenever I look at the message and create a log of my IP address over time, etc. Still it would be good to know how to clear that cache I think?

Does the Thunderbird Add-On Allow HTML Temp provide any insights?

I found a comment on Reddit but I don't know if this applies to Epyrus and I don't want to break my installation if it doesn't:
darktrojan

This is a shitty solution, but there is no way to do it otherwise. Open load the message, open the Error Console and paste this: setMsgHdrPropertyAndReload("remoteContentPolicy", 0)

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1551
Joined: 2018-10-28, 19:56
Location: Georgia

Re: show remote content, temporarily

Unread post by athenian200 » 2024-04-02, 18:26

Navigator wrote:
2024-04-02, 15:57
That didn't even occur to me. If that's how this works there is no problem, as it's the presumed repeated network access I am trying to avoid. I don't care to have the server know whenever I look at the message and create a log of my IP address over time, etc. Still it would be good to know how to clear that cache I think?
Yeah, this definitely needs a little research on my part. Especially since this is in a part of the application I don't work with as much.
I found a comment on Reddit but I don't know if this applies to Epyrus and I don't want to break my installation if it doesn't:
darktrojan

This is a shitty solution, but there is no way to do it otherwise. Open load the message, open the Error Console and paste this: setMsgHdrPropertyAndReload("remoteContentPolicy", 0)
That sounds like it could plausibly work with Epyrus, but I haven't tested it myself to be sure. But if it were set via a message header rather than a preference, that would explain why neither I nor MC knew where to look... that's a pretty obscure place that most other UXP applications don't use, but I do remember having a few issues with message header parsing being relied on too heavily in some other contexts as well.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
Navigator
Fanatic
Fanatic
Posts: 121
Joined: 2023-02-24, 17:53

Re: show remote content, temporarily

Unread post by Navigator » 2024-04-02, 22:04

athenian200 wrote:
2024-04-02, 18:26
That sounds like it could plausibly work with Epyrus, but I haven't tested it myself to be sure. But if it were set via a message header rather than a preference, that would explain why neither I nor MC knew where to look... that's a pretty obscure place that most other UXP applications don't use, but I do remember having a few issues with message header parsing being relied on too heavily in some other contexts as well.
I backed up my profile and tried it. It did not seem to have any effect but I could be doing it wrong as I've never used the code evaluate feature before.

User avatar
Navigator
Fanatic
Fanatic
Posts: 121
Joined: 2023-02-24, 17:53

Re: show remote content, temporarily

Unread post by Navigator » 2024-04-02, 23:10

I think I figured out how to reset this, but I don't really know what I am doing, I'm just pulling levers.

I searched for the string "remoteContentPolicy" and found it in some .msf files, near the top in what appears to be a kind of compression table, e.g. "(B4=remoteContentPolicy)" but the "B4" part varies from file to file. However in one of these files I found many instances of "^B4=1" but only a few instances of "^B4=2" so I replaced every instance of the latter with the former, saved the file, and started Epyrus. A message in the associated local folder that previously was showing remote content now has it blocked, and the Preferences button is back too.

The compressed format is hard to read so I couldn't figure out which message I was looking at flags for which is why I just replaced all appearances. I also wonder if editing files externally like this could cause something to fall out of sync or some other problem. Therefore even though this appeared to work it's not a good solution. Is there an existing utility for reading and editing .msf files?

User avatar
Bilbo47
Fanatic
Fanatic
Posts: 244
Joined: 2017-11-18, 04:24

Re: show remote content, temporarily

Unread post by Bilbo47 » 2024-04-02, 23:49

MSF files are written in the infamous "Mork" format. The main reason TBird-etc has not dumped the format long ago and used something else is - it is so insanely fast/small/efficient. The operative word being "insane". It is not human-readable and it's impossible to reverse-engineer. There are various library packages out there in source form that try to decode Mork files, in various languages (never got any of them to work). Not sure if there is any code that successfully writes Mork files, other than TBird and cousins.

Hint: MAB Mork Address Book files may be an easier place to start, because there are add-ons that export+import MAB data ... notice these files *were* converted to SQLite quite a while back.

User avatar
Navigator
Fanatic
Fanatic
Posts: 121
Joined: 2023-02-24, 17:53

Re: show remote content, temporarily

Unread post by Navigator » 2024-04-03, 17:22

Bilbo47 wrote:
2024-04-02, 23:49
There are various library packages out there in source form that try to decode Mork files, in various languages (never got any of them to work).
Then direct editing of .msf files doesn't sound like a promising avenue, other than the bulk find-and-replace I initiated, so I still hope for a way to do this from the GUI, either by an extension or as part of the core program. On principle I think settings should be reversible so I favor it being in the core.

Since it appears this "remoteContentPolicy" is the right target but "setMsgHdrPropertyAndReload("remoteContentPolicy", 0)" had no effect, is there another command that does work?

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1551
Joined: 2018-10-28, 19:56
Location: Georgia

Re: show remote content, temporarily

Unread post by athenian200 » 2024-04-03, 19:59

Navigator wrote:
2024-04-03, 17:22
Then direct editing of .msf files doesn't sound like a promising avenue, other than the bulk find-and-replace I initiated, so I still hope for a way to do this from the GUI, either by an extension or as part of the core program. On principle I think settings should be reversible so I favor it being in the core.

Since it appears this "remoteContentPolicy" is the right target but "setMsgHdrPropertyAndReload("remoteContentPolicy", 0)" had no effect, is there another command that does work?
If I can figure out how to make this happen for you, I will, but the truth is that I don't know much about Mork or our message headers, and I am almost as lost as you are with this. You and Bilbo already taught me a thing or two with this conversation I didn't know before... that this is a message header property, and is probably tied to the Mork database in some way. That at least gives me a general idea of where to look that I wouldn't have had before.

I'm thinking a good starting place might be to look at where "Show remote content" is in the first place... maybe if I look at that code I can figure out how to reverse whatever it does?
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35861
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: show remote content, temporarily

Unread post by Moonchild » 2024-04-03, 21:05

I'm pretty sure you can figure all this out (and how to do the reverse) by digging into the front-end JS/XUL to find the feature in question and looking at how the front-end instructs mailnews core to make the change. You shouldn't have to deal with Mork or the mailbox format directly -- that's why APIs and interfaces were created...
I do think something like this might ultimately be a good candidate for an extension, but maybe the basic functionality to make a message "pristine" again can easily be added. That would actually improve GUI intuitiveness as one of the cornerstones of an intuitive UI is to be able to undo changes made with the same ease as making those changes.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Bilbo47
Fanatic
Fanatic
Posts: 244
Joined: 2017-11-18, 04:24

Re: show remote content, temporarily

Unread post by Bilbo47 » 2024-04-07, 19:41

Moonchild wrote:
2024-04-03, 21:05
something like this might be good [to add] functionality to make a message "pristine" again
Such a feature would be great for Composer/Author/Developer mode, to help the author+sender make messages more compliant with Accessibility requirements, as far as text metadata that needs to stand in for visual/graphical/image content. We're talking image descriptions etc aimed at screen readers and text-to-speech programs, etc. That would also improve Usability of messages displayed in text-only/non-HTML mode.

User avatar
Navigator
Fanatic
Fanatic
Posts: 121
Joined: 2023-02-24, 17:53

Re: show remote content, temporarily

Unread post by Navigator » 2024-04-22, 22:53

Bumping to keep the forum software from locking it, not to be an impatient ass.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35861
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: show remote content, temporarily

Unread post by Moonchild » 2024-04-23, 00:48

Navigator wrote:
2024-04-22, 22:53
Bumping to keep the forum software from locking it, not to be an impatient ass.
Auto-locking is not enabled for this particular board.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Navigator
Fanatic
Fanatic
Posts: 121
Joined: 2023-02-24, 17:53

Re: show remote content, temporarily

Unread post by Navigator » 2024-04-23, 05:00

Moonchild wrote:
2024-04-23, 00:48
Auto-locking is not enabled for this particular board.
Then I am confused as to why my original thread was locked and by whom.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35861
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: show remote content, temporarily

Unread post by Moonchild » 2024-04-23, 09:00

All boards used to be locked but I've since installed an extension to control this per-board. Auto-locking for this board is off since then.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Post Reply