HylaFAX The world's most advanced open source fax server

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

[hylafax-users] Fax Spool Directory



	Hello all, I am new to HylaFax, I have started a job and had to "Jump" into
the scene, I am trying to change the directory where HylaFax keeps the
recieved faxes. I have tried many things. I was told to change the rcvdfax
script to move the file, here is a clip of it below. If anyone can tell me
what I am doing wrong it would be greatly appreciated. Thanks

----------------------------------------------------------------------------
----------[faxrcvd]------------
#! /bin/sh
#
# 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

INFO=$SBIN/faxinfo
FAX2PS=$TIFFBIN/fax2ps
TOADDR=FaxMaster
#
# 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"

/bin/chmod 555 $1

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`"
    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: facsimile received from $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: facsimile received from $SENDER";
         echo ""
         echo "--$MIMEBOUNDARY"
         echo "Content-Type: text/plain; charset=us-ascii"
         echo "Content-Transfer-Encoding: 7bit"
         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
         echo ""
         echo "--$MIMEBOUNDARY"
         echo "Content-Type: image/tiff; name=$FILE"
         echo "Content-Description: FAX document"
         echo "Content-Transfer-Encoding: base64"
         echo ""
         /usr/local/bin/mmencode $FILE
         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
/usr/local/bin/tiff2ps -2 -a -T $1 | lp
/bin/chmod 555 $1
bash-2.02#



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




Project hosted by iFAX Solutions