Closed phylor closed 2 years ago
@ryanb @nashby I realize that the last release of this gem was in 2018. Are you still maintaining the gem or is it end of life?
@phylor hey! yes, we still maintain this gem. I'll try to look into this issue when I have time. As far as I remember 4 slashes is not a random thing here, it was optimal solution to work with many OSes as possible
@nashby Great, thanks! :tada:
@phylor hey! Could you please test current master and see if it works for you? By default we don't add file://
prefix anymore so it might work in your case by default. And if it's not then you can add any prefix with following config:
LetterOpener.configure do |config|
config.file_uri_scheme = 'file://'
end
@nashby master
works for me without any configuration option. Thank you very much! :+1:
To open the HTML rendering of mails,
letter_opener
uses thefile
protocol. It always adds three slashes///
and then concatenates the file name to it. If the file name starts with a slash as well (unix based systems and using absolute paths), we end up having 4 consecutive slashes.On some systems (macOS as reported in #180 and - for me - on Linux) this results in invalid file paths and the file cannot be opened.
For me, this happens using
xdg-open
andqutebrowser
as a browser. The following fails for me (qutebrowser is looking forfile://tmp/test.html
):Both
firefox file:////tmp/test.html
andqutebrowser file:////tmp/test.html
open the file correctly. So this could also be a problem withxdg-open
. I don't think that 4 slashes are correct though.So I would still propose to fix this (fixing it also for the macOS people). But there might be a cleaner solution than my proposal.