On Thu, 2023-02-09 at 21:05 +1100, Stephen Morris wrote:
I've checked two mails with attachments, one mail has the pdf attachment as content type application/binary-octet and the other has the content type of application/pdf on the attachment and the issue occurs with both of them.
On that note, it's not a good idea to try and get your program to open PDFs sent as application/binary-octet, because it'll try to do the same thing with any other non-PDF file. Fun and chaos will ensue.
You can try setting it to pass the file to xdg-open, and then xdg-open will try opening the file in the right application for what the file is. See if that changes anything.
If you allow Thunderbird to directly open the PDF in Okular, can you view properties of the PDF file in Okular, and see where the temporary file is being loaded from?
A wild thought: Is it a filename with blank spaces in it?