HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

[hylafax-users] Re: Unable to open any attached document formats



Hello,

Greg Kelley schrieb:
...
> 
> I modified faxrcvd 3 times using three different suggestions I got from the
> archives for sending a tiff attachment.  All three cause Wang Image Viewer
> to complain about a bad format.

Try this tiff viewer: http://www.mieweb.com/alternatiff/

> 
> Now I would like to try to create a pdf attachment.  I cannot find the
> correct faxrcvd script to do this.

This is my fexrcvd : I get only notification and the link to received
tiff and
pdf file , which are generated by faxrcvd .
If you want to see how to attach the pdf , see please my example from my
answering machine.
this script sends a wav file to me (this script is below the faxrcvd
script.

The problem for me was everytime the correct mimeencoding. 
but there is a program called mimencode, which does this job for me.

It works for me. My System:
Suse 6.4 with Hylafax as binary rpm from Suse
(hylafax-4.1beta2-93.i386.rpm)

Sorry for the long Mail.

I hope it helps 

Torsten 

... but if your ps file is incorrect, ... hmmm



<faxrcvd script>
#! /bin/sh
# modifiziert um pdf dokumente weiterzuleiten statt ps
#       $Id: faxrcvd.sh,v 1.33 1998/02/12 10:04:57 guru Rel $
#
# HylaFAX Facsimile Software
#
# Copyright (c) 1990-1996 Sam Leffler
# Copyright (c) 1991-1996 Silicon Graphics, Inc.
# HylaFAX is a trademark of Silicon Graphics
# 
# Permission to use, copy, modify, distribute, and sell this software
and 
# its documentation for any purpose is hereby granted without fee,
provided
# that (i) the above copyright notices and this permission notice appear
in
# all copies of the software and related documentation, and (ii) the
names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
# 
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
# 
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY
OF 
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
# OF THIS SOFTWARE.
#

#
# faxrcvd file devID commID error-msg
#
if [ $# != 4 ]; then
    echo "Usage: $0 file devID commID error-msg"
    exit 1
fi

test -f etc/setup.cache || {
    SPOOL=`pwd`
    cat<<EOF

FATAL ERROR: $SPOOL/etc/setup.cache is missing!

The file $SPOOL/etc/setup.cache is not present.  This
probably means the machine has not been setup using the faxsetup(1M)
command.  Read the documentation on setting up HylaFAX before you
startup a server system.

EOF
    exit 1
}
. etc/setup.cache
CHMOD=/bin/chmod
INFO=$SBIN/faxinfo
FAX2PS=/usr/bin/tiff2ps
PS2PDF=/usr/bin/ps2pdf
CAT=/bin/cat
TOADDR=FaxMaster
COPY=/bin/cp

#
# There is no good portable way to find out the fully qualified
# domain name (FQDN) of the host or the TCP port for the hylafax
# service so we fudge here.  Folks may want to tailor this to
# their needs; e.g. add a domain or use localhost so the loopback
# interface is used.
#
HOSTNAME=`hostname`                     # XXX no good way to find FQDN
PORT=4559                               # XXX no good way to lookup
service

FILE="$1"
DEVICE="$2"
COMMID="$3"
MSG="$4"

if [ -f $FILE ]; then
    #
 
    # Check the sender's TSI and setup to dispatch
    # facsimile received from well-known senders.

    #
    SENDER="`$INFO $FILE | $AWK -F: '/Sender/ { print $2 }'
2>/dev/null`"
    
    
#    AUNAME="`date +%b-%d-%a-%H.%MUhr-$SENDER`"
    AUNAME="`date +%b-%d-%a-%H.%MUhr`"
    $FAX2PS -a $FILE > /var/spool/fax/recvq/tmp.ps
    $PS2PDF /var/spool/fax/recvq/tmp.ps /var/spool/fax/recvq/$AUNAME.pdf
    $CHMOD 0666 /var/spool/fax/recvq/$AUNAME.pdf
    $COPY /var/spool/fax/recvq/$AUNAME.pdf /daten/faxeingang/$AUNAME.pdf
    $CHMOD 0666 /daten/faxeingang/$AUNAME.pdf
    
    
    
    
    SENDTO=
    if [ -f etc/FaxDispatch ]; then
        . etc/FaxDispatch       # NB: FaxDispatch sets SENDTO based on
$SENDER
    fi
    (echo "To: $TOADDR"
     echo "From: The HylaFAX Receive Agent <fax>"
     echo "Subject: Neues Fax erhalten von $SENDER";
     echo ""
     echo "$FILE (ftp://$HOSTNAME:$PORT/$FILE):"; $INFO -n $FILE
     echo "ReceivedOn: $DEVICE"
     if [ "$MSG" ]; then
        echo ""
        echo "The full document was not received because:"

        echo ""
        echo "    $MSG"
        echo ""
        echo "    ---- Transcript of session follows ----"
        echo ""
        if [ -f log/c$COMMID ]; then
            $SED -e '/-- data/d' \
                 -e '/start.*timer/d' -e '/stop.*timer/d' \
                 log/c$COMMID

        elif [ -n "$COMMID" ]; then
            echo "    No transcript available (CommID c$COMMID)."

        else
            echo "    No transcript available."
        fi
     else
        echo "CommID:     c$COMMID (ftp://$HOSTNAME:$PORT/log/c$COMMID)"
     fi
     if [ -n "$SENDTO" ]; then
        echo ""
        echo "The facsimile was automatically dispatched to: $SENDTO." 
     fi
    ) | 2>&1 $SENDMAIL -ffax -oi $TOADDR
    if [ -n "$SENDTO" ]; then
        (MIMEBOUNDARY="NextPart$$"

         echo "Mime-Version: 1.0"
         echo "Content-Type: Multipart/Mixed;
Boundary=\"$MIMEBOUNDARY\""
         echo "Content-Transfer-Encoding: 7bit"
         echo "To: $SENDTO"
         echo "From: The HylaFAX Receive Agent <fax>"
         echo "Subject: Es wurde ein Fax empfangen von $SENDER";
         echo ""
         echo "--$MIMEBOUNDARY"
         echo "Content-Type: text/plain; charset=us-ascii"
         echo "Content-Transfer-Encoding: 7bit"
         echo ""
	 echo "Das Fax ist im Ordner Faxeingang unter"
	 echo "folgendem Namen zu finden:"
	 echo "$AUNAME.pdf"
	 echo ""
	 echo "Das Fax ist als tiff pdf oder ps Version  vor-"
	 echo "handen.  Die  ps  Datei  haengt  der  Mail  an"
	 echo "Es wird automatisch  nach 90  Tagen  geloescht"
	 echo "Die Faxe der letzten 90 Tage finden Sie unter:"
	 echo " http://slave.xtremeweb.de:81/faxeingang/?M=D "
	 echo "Klicken Sie bitte auf  folgenden Link, um sich"
         echo "das Fax in Ihrem Browser  anschauen zu koennen"
	 echo " ftp://$HOSTNAME:$PORT/$FILE ";
	 echo ""
	 echo "oder als PDF Datei: "
         echo " http://slave.xtremeweb.de:81/faxeingang/$AUNAME.pdf ";
$INFO -n $FILE
	 echo "ReceivedOn: $DEVICE"
         if [ "$MSG" ]; then
            echo ""
            echo "The full document was not received because:"
            echo ""
            echo "    $MSG"
            echo ""
            echo "    ---- Transcript of session follows ----"
            echo ""
            if [ -f log/c$COMMID ]; then
                $SED -e '/-- data/d' \
                     -e '/start.*timer/d' -e '/stop.*timer/d' \
                     log/c$COMMID
            elif [ -n "$COMMID" ]; then
                echo "    No transcript available (CommID c$COMMID)."
            else
                echo "    No transcript available."
            fi
         else
            echo "CommID:     c$COMMID
(ftp://$HOSTNAME:$PORT/log/c$COMMID)"
         fi
         echo $FILE
         echo ""
         echo "--$MIMEBOUNDARY"
         echo "Content-Type: application/postscript"

         echo "Content-Description: FAX document"
         echo "Content-Transfer-Encoding: 7bit"
         echo ""
         $FAX2PS $FILE 2>/dev/null
         echo ""
         echo "--$MIMEBOUNDARY--"
        ) | 2>&1 $SENDMAIL -ffax -oi $SENDTO
    fi
else
    #
    # Generate notification mail for a failed attempt.
    #
    (echo "To: $TOADDR"
     echo "From: The HylaFAX Receive Agent <fax>"
     echo "Subject: facsimile not received"
     echo ""
     echo "An attempt to receive facsimile on $DEVICE failed because:"
     echo ""
     echo "    $MSG"
     echo ""
     echo "    ---- Transcript of session follows ----"
     echo ""
     if [ -f log/c$COMMID ]; then
        $SED -e '/-- data/d' \
             -e '/start.*timer/d' -e '/stop.*timer/d' \
            log/c$COMMID
     elif [ -n "$COMMID" ]; then
        echo "    No transcript available (CommID c$COMMID)."
     else
        echo "    No transcript available."
     fi
    ) | 2>&1 $SENDMAIL -ffax -oi $TOADDR
fi
</faxrcvd script>


<part of the answering machine mailscript>
#! /bin/sh
#
# vboxmime zum Anhaengen der Audio Datei im
# Sun-Audio Format
#
PATH="${PATH}:/usr/bin/:/usr/local/bin"

BASENAME="`basename $0`"
MIMEBOUNDARY="NextPart$$"
CALLER="${2}"
SAMPLE="${1}"
NUMBER="${3}"
MAILTO="${4}"
VOLUME=1
#AUNAME="`date +%a-%b-%d-[%H.%M.%S]-$NUMBER`"
#AUNAME="`date +%b-%d-%a-[%H.%M.%S]-$NUMBER`"
AUNAME="`date +%b-%d-%a-%H.%MUhr-$NUMBER`"
/usr/bin/vboxtoau < $SAMPLE > /tmp/$AUNAME.au
/usr/bin/sox -v 2.0 /tmp/$AUNAME.au /tmp/$AUNAME.wav
/bin/chmod 0777 /tmp/$AUNAME.wav
/bin/rm /tmp/$AUNAME.au
#/bin/cp /datfax/ab/$AUNAME.wav /var/spool/fax/recvq/$AUNAME.wav
if [ "${MAILTO}" = "" ]
then
 if [ "${USER}" != "" ]
 then
 MAILTO="${USER}"
         fi
         fi

         if [ "${MAILTO}" = "" ]
         then
         echo "${BASENAME}: Can't find email address to mail message."
                 exit
                 fi

                 if (! test -r "${SAMPLE}")
                 then
                 echo "${BASENAME}: File '${SAMPLE}' doesn't exist."
                         exit
                         fi

                         (
                 echo "From: anrufb@gate.xtremeweb.de"
                 echo "To: ${MAILTO}"
                 echo "Subject: Neuer Anruf von ${NUMBER}"
                 echo "MIME-Version: 1.0"
                echo -e "Content-type: application/octet-stream;
name=\"${AUNAME}.wav\""
                echo "Content-Description: $AUNAME (Audio-Clip (Basic))"
                echo "Content-Transfer-Encoding: base64"
                echo -e "Content-Disposition: attachment;
filename=\"${AUNAME}.wav\""
                echo ""
                    /bin/cat /tmp/$AUNAME.wav | mimencode
                echo ""
                echo "Die Nachricht finden Sie auf dem Slave"
                echo "im Laufwerk Anrufe als Microsoft wav Datei"
                echo "Diese Datei koennen Sie durch Doppelt-klicken"
                echo "oeffnen"
                echo ""
                echo "Oder Sie oeffnen die Datei mit Ihrem Browser:"
                echo
"http://192.168.0.5:81/anrufbeantworter/${AUNAME}.wav"
                echo ""
                echo "Nach 90 Tagen wird diese Nachricht automatisch"
                echo "auf dem Slave geloescht"
                echo ""

/bin/rm /tmp/$AUNAME.wav


         ) | 2>&1 sendmail -fanrufb -oi $MAILTO

fi
</part of the answering machine mailscript>


____________________ HylaFAX(tm) Users Mailing List _______________________
 To unsub: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null




Project hosted by iFAX Solutions