* On Wed, 9 Nov 2011 06:42:43 -0800 (PST), Howie wrote:
> On Nov 9, 9:25 am, Holger Marzen <
hol...@marzen.de> wrote:
>> * On Wed, 9 Nov 2011 05:27:26 -0800 (PST), Howie wrote:
>> > I used to be able to "view" PDF files which were included as
>> > attachments to emails I received. But recently, I am having a
>> > difficulty, and this isn't working any longer.
>> 1) The reader forks. The foreground process returns, the background
>> process starts the reader. Alpine thinks you have finished viewing the
>> attachment and deletes the temporary file. The background process wants
>> to open an file that no longer exists.
>>
> application/pdf; /usr/bin/xdg-open %s
> I have tried to execute /usr/bin/xdg-open on a pdf file and it opens
> it using adobe reader correctly. So I am not sure what is going on, or
> why it thinks the file can not be found.
xdg-open returns to the command line and runs the pdf-viewer in the
background. This can lead to the race condition I described.
Other mail programs like mutt have the same problem, see
https://bugzilla.redhat.com/show_bug.cgi?id=653249
One solution could be that you alter /etc/mailcap or create a personal
$HOME/.mailcap with something like
application/pdf; acroread '%s'; test=test -n "$DISPLAY"; nametemplate=%s.pdf