The following was for Netscape 4, and I wonder how much translates to Mozilla or Netscape 7. I think much!

Look at a specific user first. From the ~/.netscape/preferences.js file, see where the .mailcap and .mime.types files are.

user_pref("helpers.private_mailcap_file", "/home/jferg/.mailcap");

user_pref("helpers.private_mime_types_file", "/home/jferg/.mime.types");

When you setup a new mimetype in the Netscape preferences/Navigator/applications menu, it saves settings in these files. Go ahead and see....

You should be able to edit by hand either of those files and have Netscape honor the information in them. Netscape 4.7x seems to honor a global /etc/mime.types file, but not an /etc/mailcap. So you can setup /etc/mime.types how you want, but you have to setup a mailcap file the way you want and then copy to each user as ~/.mailcap

Background:

mime.types (can be either /etc/mime.types or ~/.mime.types) contains a mapping between file extensions and mime-type. mailcap (can be ~/.mailcap or /etc/mailcap for most apps, except Netscape, which apparently doesn't honor /etc/mailcap), contains a list of how to handle each mime-type. Thus, if I wanted to (for some strange reason) spawn off an xterm with less each time I clicked on an XML file, I could:

In mime.types put a line that reads:

text/xml xml

That tells it files with the extension of xml are type text/xml. Then, in ~/.mailcap, I could put:

text/xml;xterm -e less %s

Which tells it if it gets a file of type text/xml to spawn off an xterm running less on that file.

There are other %whatever symbols that can be used in a mailcap file, for example, if you want to pass your handler the complete URL, you can use %u. i.e.:

audio/x-pn-realaudio;/usr/local/packages/RealPlayerG2/realplay %u

man mailcap should give you more information on that.

Now, what this all boils down to is that you'll need to write up a custom mime.types and mailcap set for your site, cp them to /etc/skel, and then use something similar to the script that was posted earlier to distribute them site-wide. Something along the lines of:

for HOMEDIR in `ls -d /home/*`; do cp /etc/skel/.mailcap $HOMEDIR cp /etc/skel/.mime.types $HOMEDIR done

Thanks to Justin Ferguson for this information

-- PaulJohnson - 07 Feb 2003

 
|Powered by TWiki