Re: metamail now misbehaving
On 2017-07-09 at 14:12 -0400, Steve Kleene wrote:
> I run Wheezy with fvwm (window manager). I prefer to use the command line
> when possible, and for mail I have bsd-mailx with sendmail. To read e-mails
> sent as HTML or base64, I use metamail (which was last distributed with Etch,
> I think), as follows:
>
> 1. I save the e-mail to a file "mailfile".
> 2. I call "metamail mailfile".
> 3. Metamail silently extracts the HTML and saves it as, let's say, /tmp/Mu6MRTf.
> 4. It calls "/usr/bin/iceweasel /tmp/MD7U6wY", which then displays the HTML.
>
> Coincindent with my upgrade to firefox-esr 52, metamail no longer quite
> works. If no firefox window is up, it does succeed. But if (as usual) a
> firefox window already exists, it opens a new firefox tab with the error
> "Firefox can't find the file at /tmp/Mu6MRTf". And there is in fact no such
> tmp file.
I suspect metamail launches the browser and, after the launched program
is closed, automatically deletes the temporary file.
The problem is that when a window already exists, control is transfered
to that window, and the original program is closed, thus leading to a
race condition between the deletion of the temporary file and its
loading by the firefox process.
First option would be looking for a way not to have metamail remove the
file, leaving the file to be cleaned up later (you may want to dedicate
a subfolder for metamail temp files).
Another option would be to replace the call to /usr/bin/iceweasel with a
wrapper that launches iceweasel and waits a few seconds, which would
hopefully make the browser win the race. It's not a particularly elegant
solution (the race is still there, after all), but is probably good
enough for you.
Reply to: