Create a .mailcap
file in your $HOME
directory, so $HOME/.mailcap
, with the following content and replacing /path/to/your/bin/
with the actual path of course:
application/vnd.oasis.opendocument.base;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.chart;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.chart-template;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.database;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.formula;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.formula-template;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.graphics;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.graphics-template;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.image;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.image-template;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.presentation;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.presentation-template;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.spreadsheet;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.spreadsheet-template;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.text;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.text-master;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.text-template;/path/to/your/bin/soffice %s
application/vnd.oasis.opendocument.text-web;/path/to/your/bin/soffice %s
application/vnd.sun.xml.writer;/path/to/your/bin/soffice %s
application/vnd.sun.xml.writer.global;/path/to/your/bin/soffice %s
application/vnd.stardivision.writer;/path/to/your/bin/soffice %s
application/vnd.stardivision.writer-global;/path/to/your/bin/soffice %s
application/x-starwriter;/path/to/your/bin/soffice %s
application/vnd.sun.xml.writer.template;/path/to/your/bin/soffice %s
application/vnd.sun.xml.calc;/path/to/your/bin/soffice %s
application/vnd.stardivision.calc;/path/to/your/bin/soffice %s
application/x-starcalc;/path/to/your/bin/soffice %s
application/vnd.sun.xml.calc.template;/path/to/your/bin/soffice %s
application/vnd.sun.xml.impress;/path/to/your/bin/soffice %s
application/vnd.stardivision.impress;/path/to/your/bin/soffice %s
application/vnd.stardivision.impress-packed;/path/to/your/bin/soffice %s
application/x-starimpress;/path/to/your/bin/soffice %s
application/vnd.sun.xml.impress.template;/path/to/your/bin/soffice %s
application/vnd.sun.xml.draw;/path/to/your/bin/soffice %s
application/vnd.stardivision.draw;/path/to/your/bin/soffice %s
application/x-stardraw;/path/to/your/bin/soffice %s
application/vnd.sun.xml.draw.template;/path/to/your/bin/soffice %s
application/vnd.sun.xml.math;/path/to/your/bin/soffice %s
application/vnd.stardivision.math;/path/to/your/bin/soffice %s
application/x-starmath;/path/to/your/bin/soffice %s
application/vnd.ms-word;/path/to/your/bin/soffice %s
application/x-msword;/path/to/your/bin/soffice %s
application/msword;/path/to/your/bin/soffice %s
application/vnd.ms-excel;/path/to/your/bin/soffice %s
application/x-msexcel;/path/to/your/bin/soffice %s
application/x-ms-excel;/path/to/your/bin/soffice %s
application/x-excel;/path/to/your/bin/soffice %s
application/msexcel;/path/to/your/bin/soffice %s
application/msexcell;/path/to/your/bin/soffice %s
application/x-xls;/path/to/your/bin/soffice %s
application/vnd.ms-powerpoint;/path/to/your/bin/soffice %s
application/x-mspowerpoint;/path/to/your/bin/soffice %s
application/mspowerpoint;/path/to/your/bin/soffice %s
application/vnd.openxmlformats-officedocument.spreadsheetml.document;/path/to/your/bin/soffice %s
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;/path/to/your/bin/soffice %s
application/vnd.openxmlformats-officedocument.wordprocessingml.document;/path/to/your/bin/soffice %s
(the list may contain some now outdated and maybe superfluous entries, it’s historically grown).
Well behaving programs consider and follow a ~/.mailcap
file that overrides /etc/mailcap
, like browsers and mail user agents.