HylaFAX The world's most advanced open source fax server

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

[hylafax-users] MOD: Decide fax2mail or fax2prt in the users file (for ISDN users)



Hi,
i added some features to my SuSE10.3/Hylafax 4.4.0 installation
because some users wants to have the received fax mailed or printed.
I added the possibilitiy to decide the fax2mail format in the users file
(with the help of an third entry) and if you choose "prt" as fileformat
faxrcvd is printing (lpr command) instead of sending an mail.
In that case i use the email adress (in users) for nameing the printqueue.
 
I have modified
bin/FaxDispatch,
bin/faxrcvd (attached)
and
etc/users.
 
Changes:
users:
----------Begin------------
#
# Sample users file for FaxDispatch on ISDN lines
# format: <email/printqueue>  <MSN or extention> <filetype tif/pdf/ps/prt>
#
# When you use "prt" as filetype then define the printqueue in the email field.
# Examples:
# printer1   123 prt
receiver@xxxxxxx  124 pdf
prtqueue7   125 prt
----------End------------
 
FaxDispatch:
----------Begin------------
#
# Dispatch fax to email depending on MSN or extention (ISDN lines)
# sourced from faxrcvd
#
# changes by Lars Meuser (lm) 27.2.2008
# for define the filetype (ps/pdf/tif/prt) in the users file
# See also etc/users and bin/faxrcvd for more changes
#
 
if [ "$CALLID3" != "" ]; then
    PHONEMATCH=$CALLID3
    USERENTRY=`grep -v "^#" etc/users | grep $PHONEMATCH`
    if [ "$USERENTRY" != "" ]; then
 USERNAME=`echo $USERENTRY | awk '{print $1}'`
 SENDTO=$USERNAME
        # detect Filetype
 USERFILETYPE=`echo $USERENTRY | awk '{print $3}'`
 FILETYPE=$USERFILETYPE
    fi
fi
----------End------------
 
faxrcvd (complete as attachment):
----------Begin------------
..
..
export TOADDR
For adjusting the FILETYPE via FaxDisptach and the users file
export FILETYPE
..
..
..
            CreateMailMessage etc/templates/$TEMPLATE/faxrcvd-notify-error.txt \
       2>$ERRORSTO | $SENDMAIL -f"$FROMADDR" -oi "$TOADDR"
        fi
    fi
 # 27.2.2008 changes by lm for printing directly
    # be sure to have an working print queue
    # Check FILETYPE
    if [ "$FILETYPE" != 'prt' ]; then  #NEW
      if [ -n "$SENDTO" ]; then
   # Create the document to attache
        if [ -z "$MSG" ]; then
     MailWithFAX success
        else
     MailWithFAX error
      fi
      fi
    else #NEW
      # Print the fax, uses $SENDTO as Queuename
      # use -H and -W best for A4 paper
      if [ "$SENDTO" != "" ]; then
        $FAX2PS -H 11.4 -W 8.2 -S $FILE | lpr -P $SENDTO
      fi
    fi #NEW
----------End------------
 
Thanks
 

Lars Meuser | Information Systems

LMA | LMA Deutschland GmbH

Attachment: faxrcvd
Description: faxrcvd




Project hosted by iFAX Solutions