Hylafax Mailing List Archives

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

Re: [hylafax-users] mail fax as pdf



Yeah, it was the first part.
> # FaxDispatch
> # Dispatch fax to email depending on own MSN or
> extention (ISDN lines) #
> sourced from faxrcvd # if [ "$7" != "" ]; then
>     PHONEMATCH=$7$
>     USERENTRY=`grep -v "^#" etc/users | grep
> "$PHONEMATCH"`
>     if [ "$USERENTRY" != "" ]; then
> 	USERNAME=`echo $USERENTRY | awk '{print $1}'`
> 	FILETYPE=pdf
> 	SENDTO="$USERNAME"
> ;;
>     fi
> fi



-----Original Message-----
From: hylafax-users-bounce@xxxxxxxxxxx
[mailto:hylafax-users-bounce@xxxxxxxxxxx] On Behalf Of Pedro Rocadas
Sent: 9. september 2004 15:04
To: hylafax-users@xxxxxxxxxxx
Subject: Re: [hylafax-users] mail fax as pdf

Did you created FaxDispatch?
other way to see what could be wrong is running
faxrcvd from the shell.

--- rasmus.stokholm@xxxxxxxxxxxxx wrote:

> Still doesn't work,
> Ok last resort, can you take a look at my files and
> see if there is any
> thing wrong.
> 
> I'm not quite sure where the file should be
> attached.
> Maybe it is missing?
> 
> 
> # FaxDispatch
> # Dispatch fax to email depending on own MSN or
> extention (ISDN lines) #
> sourced from faxrcvd # if [ "$7" != "" ]; then
>     PHONEMATCH=$7$
>     USERENTRY=`grep -v "^#" etc/users | grep
> "$PHONEMATCH"`
>     if [ "$USERENTRY" != "" ]; then
> 	USERNAME=`echo $USERENTRY | awk '{print $1}'`
> 	FILETYPE=pdf
> 	SENDTO="$USERNAME"
> ;;
>     fi
> fi
> 
> 
> 
> #
> # faxrcvd file devID commID error-msg
> #
> if [ $# -lt 4 ]; then
>     echo "Usage: $0 file devID commID error-msg
> [CIDNumber] [CIDName]
> [destination]"
>     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(8C)
> 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
> MIMENCODE=mimencode
> ENCODING=base64
> TIFF2PS=tiff2ps
> PS2PDF=ps2pdf
> TOADDR=FaxMaster
> TIFFINFO=tiffinfo
> NOTIFY_FAXMASTER=always
> 
> #
> # wraper for base64 encoding
> #
> # first try uuencode if it is not installed fallback
> to
> # metamails mimencode if it is also not installed
> give an
> # error message
> #
> function base64 {
> 
>     if [ -x /usr/bin/uuencode ]; then
>         /usr/bin/uuencode -m $1 $1 | /usr/bin/sed
> '1d;$d'
>     elif [ -x /usr/bin/mimencode ]; then
>         /usr/bin/mimencode $1
>     else
>         echo "Error: No encoder for base64 found."
>         echo "Please install sharutils or metamail."
>     fi
> }
> 
> #
> # Permit various types of attachment types: ps, tif,
> pdf
> # Note that non-ASCII filetypes require sharutils or
> metamail. # pdf
> requires tiff2ps and ps2pdf # FILETYPE=pdf
> 
> #
> # 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"
> CIDNUMBER="$5"
> CIDNAME="$6"
> 
> FILENAME=`echo $FILE | $SED -e 's/.tif//' -e
> 's/recvq///'`
> 
> if [ -f $FILE ]; then
>     #
>     # Check the sender's TSI and setup to dispatch
>     # facsimile received from well-known senders.
>     #
>     SUBADDR="`$INFO $FILE | $AWK -F: '/SubAddr/ {
> print $2 }'
> 2>/dev/null`"
>     SENDER="`$INFO $FILE | $AWK -F: '/Sender/ {
> print $2 }'
> 2>/dev/null`"
>     SENDTO=
>     if [ -f bin/FaxDispatch ]; then
> 	. bin/FaxDispatch	# NB: FaxDispatch sets SENDTO
> based on
> $7
>     fi
>     #
>     # Don't send FaxMaster duplicates, and FaxMaster
> may not even
>     # want a message at all, depending on
> NOTIFY_FAXMASTER.
>     #
>     case $NOTIFY_FAXMASTER$MSG in
> 	never*)		NOTIFY_FAXMASTER=no;;
> 	errors)		NOTIFY_FAXMASTER=no;;
> 	*)		NOTIFY_FAXMASTER=yes;;
>     esac
>     if [ "$TOADDR" != "$SENDTO" -a
> "$NOTIFY_FAXMASTER" != "no" ]; then
> 	(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 [ "$CIDNUMBER" ]; then
> 	    echo " CIDNumber: $CIDNUMBER"
> 	fi
> 	if [ "$CIDNAME" ]; then
> 	    echo "   CIDName: $CIDNAME"
> 	fi
> 	if [ -n "$SENDTO" ]; then
> 	    echo ""
> 	    echo "The facsimile was automatically
> dispatched to:
> $SENDTO." 
> 	fi
> 	) | 2>&1 $SENDMAIL -rrasmus.stokholm@xxxxxxxxxxxxx
> -oi $TOADDR
>     fi
>     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"
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

____________________ HylaFAX(tm) Users Mailing List
_______________________
  To subscribe/unsubscribe, click
http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx <
/dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.

____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services