#!/bin/sh #---------------------------------------------------------------------------- # /var/spool/hylafax/mimeconverters/application/octet-stream - converter # # Creation: 2006-12-25 jed # Last Update: $Id$ # # Copyright (c) 2007-@@YEAR@@ Holger Bruenjes, holgerbruenjes(at)gmx(dot)net # # Mime type: application/octet-stream # Comment: Converts attachments to PS # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version.. #---------------------------------------------------------------------------- mime_path=/var/spool/hylafax/mimeconverters DISCARDMSG="DISCARDED application/octet-stream goes here" FILECMD=/usr/bin/file . /var/spool/hylafax/etc/setup.cache if [ ! -x ${FILECMD} ] then echo "${DISCARDMSG}" | ${LIBEXEC}/textfmt -B exit fi MIMETYPE="$(${FILECMD} -bi "${1}" | ${SED} 's/;.*//g')" case "${MIMETYPE}" in "application/postscript") cat "${1}" ;; "application/pdf") ${mime_path}/application/pdf "${1}" ;; "image/tiff"|"image/tif") ${mime_path}/image/tiff "${1}" ;; "image/jpeg"|"image/jpg") ${mime_path}/image/jpeg "${1}" ;; "image/gif") ${mime_path}/image/gif "${1}" ;; "image/png") ${mime_path}/image/png "${1}" ;; "image/bmp") ${mime_path}/image/bmp "${1}" ;; "text/html") ${mime_path}/text/html "${1}" ;; "text/plain") ${mime_path}/text/plain "${1}" ;; "message/rfc822") cat "$1" | ${LIBEXEC}/textfmt -B ;; text/*) cat "${1}" | ${LIBEXEC}/textfmt -B ;; *) echo "${DISCARDMSG}" | ${LIBEXEC}/textfmt -B ;; esac exit