LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Inconsistent handling of attachments in Thunderbird (https://www.linuxquestions.org/questions/slackware-14/inconsistent-handling-of-attachments-in-thunderbird-694942/)

statguy 01-04-2009 04:09 PM

Inconsistent handling of attachments in Thunderbird
 
I have a puzzling problem. I'm using Thunderbird 2.0.0.18 on Slack 12.2. The handling of microsoft office attachments is inconsistent (I've only noticed the problem with MS files).

Sometimes when I double click an attachment the default choice is "Open with /usr/bin/xdg-open" and when I click OK, the file opens in OpenOffice. In this case the dialog says I am opening a "Word document."

Sometimes, the default choice is "Save to Disk." I have the option to "Open with" but I would need to "Browse" for the application. In the example I'm looking at the dialog (correctly) identified the file as a "PowerPoint presentation."

Finally, sometimes I am only "allowed" to save the document. In this case the file was also (correctly) identified as "Word document."

So, it appears that the MIME types are correctly being identified but with very different behaviours.

Needless to say, I'm puzzled. :scratch:

adriv 01-05-2009 02:10 PM

Quote:

/usr/bin/xdg-open
???
Where did you get OOo from (and which version)?
I'm running SW 12.1 with OOo 3, but I have to choose for /usr/bin/openoffice.org3.
/usr/bin/xdg-open doesn't do anything here, doesn't even exist. :scratch:

statguy 01-05-2009 02:18 PM

It's openoffice 3 and I got it from slackbuilds.org.

The xdg-open will spawn acroread for pdf files. I just noticed when I took another look at the man page that this comes from crossover office.

I'll see what options I have for that, and maybe post a question to the corssover folk.

statguy 01-05-2009 05:37 PM

I did a little more digging and found that xdg-open is part of the xdg-utils package (I still forget how easy it is in slack to find what package a file came from just by using a single grep). There is also a version that comes with acroread 8. Anyone know what the consequences might be of removing the xdg-utils package?

adriv 01-06-2009 04:57 AM

Uninstalling the package doesn't seem to give you too much trouble, as it is not an original SW package in the first place.

There is always the possibility that xdg-utils messes things up in TB. You'll find out soon enough if you uninstall. ;)
If it doesn't, you can always reinstall xdg-utils, no harm done.

GazL 01-06-2009 06:50 AM

xdg-utils is part of the stock install (at least with 12.2). The entries in /etc/mailcap also seem to call xdg-open so any old programs that use mailcap could fail to open external apps if you remove the xdg-utils package.

I've just been having a play with it on my system and mine appears to be broken too.
(Note: I don't have any of the KDE packages installed, as I just use WindowMaker and pcmanfm).


I've done a quick bit of testing and what I've noticed is that although xdg-mime query returns the right mimetype for a pdf
Code:

bash-3.1$ xdg-mime query filetype file.pdf
application/pdf

when I try and find the default application for it, I get a blank response, though a rc=0.

Code:

bash-3.1$ xdg-mime query default application/pdf
bash-3.1$ echo $?
0

If I try and open a pdf with "xdg-open file.pdf" it starts firefox which then pops up the save file dialog. Strangely, using the pcmanfm to open the same file will start xpdf as it should as per the contents of the /usr/share/applications/xpdf.desktop file

Either something is wrong with xdg-open, or I'm misunderstanding this stuff, which is quite possible, I've read the man pages which aren't that informative, /usr/doc/xdg-utils has virtually nothing of interest and looking at the freedesktop website just overloads you with data. This entire mime handling thing seems completely overcomplicated. At least the old mailcap file way of doing things was understandable at a glance.

statguy 01-07-2009 07:17 AM

I now think that Thunderbird is the culprit. I looked at its config and saw that it uses mailcap. So, I commented out the lines in /etc/mailcap. I got approximately the same behaviour. Sometimes I would be prompted to choose between saving an attachment and opening it with an application (I now had to choose the app. since xdg-open was out of the loop) and sometimes I was only prompted to save the file.

Something that may or may not be relevant in my case. Although I did a fresh install of 12.2, I previously had OpenSUSE 10.2. I reformatted my root partition but left my /home partition alone. I wonder if I have some old (local) Thunderbird configuration that is messing things up. What is the profile specific configuration file and if I remove it, will a default one be created the next time I start Thunderbird?

statguy 01-07-2009 12:23 PM

After looking at some stuff in the Thunderbird KB, I deleted my mimeTypes.rdf. I still find some attachments that I should be able to open directly, I cannot. However, the message in the "save only" dialog prompt me to look further. It appears that the messages I'm having trouble with have the wrong mime-types for the attachments. I can see this by looking at the message source.

For example, in one message with two PDF attachments, I can open the second but not the first I have this for the first:

Code:

--B_3313951594_214508
Content-type: application/octet-stream; name="2009 lecture 1 intro.pdf"
Content-disposition: attachment;
        filename="2009 lecture 1 intro.pdf"
Content-transfer-encoding: base64

and for the second I find this:

Code:

--B_3313951594_214508
Content-type: application/msword; name="2009 syllabus(final).pdf";
 x-mac-creator="4D535744";
 x-mac-type="50444620"
Content-disposition: attachment;
        filename="2009 syllabus(final).pdf"
Content-transfer-encoding: base64

Intersetingly, because xdg-open is called to handle the attachment, it is opened with acroread, so xdg-open is working.

So far these munged MIME types have come from MACs. I will keep an eye on it to see what else sends nonsense MIME.

Edit: Found another, this one from a hotmail account. The second attachment has the correct MIME type, but the first does not.

Randux 01-07-2009 03:49 PM

Thunderbird is total crap. Try Claws-mail if you want a really great mail client.

statguy 01-07-2009 05:45 PM

Quote:

Originally Posted by Randux (Post 3400358)
Thunderbird is total crap. Try Claws-mail if you want a really great mail client.

I'll look into it. I have thousands of saved messages in my local folders. Will I be able to migrate them to Claws-mail?

Randux 01-08-2009 12:53 PM

I'm not sure but Claws can read many different types of mail directories. Ask on the newsgroup if you don't see anything in the user manual or faq. claws-mail.org

statguy 01-09-2009 09:29 AM

I just remembered something. A number of years ago I used a mail client that was called (I think) Sylpheed Claws. Is this Claws client a more mature version of that?

In any case, for now I have customized my ~/.mailcap for my immediate needs (since Thunderbird uses the mailcap files) and commented out the xdg-open lines in /etc/mailcap. This is due to the potential security vulnerabililty present with xdg-open.

It appears my attachment difficulties came from wrong MIME types in the messages themselves.

Randux 01-11-2009 11:06 AM

claws is a fork of sylpheed.


All times are GMT -5. The time now is 06:13 AM.