HylaFAX The world's most advanced open source fax server

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

Re: problems with faxrcvd script...

Hello Josh :

    I also required to process the incoming FAX such as converting to
other format, updating WEB pages etc. . I did similar thing as what you
did and it works. I put my stuff near the beginning of 'faxrcvd'. Here is
exectly what I did :

    # 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`"

    # Check for CLK fax input  K.S.Wat 06-Feb-98
    if [ -f etc/ckCLKfaxinput ]
       . etc/ckCLKfaxinput

    # Check for MTC FAX input
    if [ -f etc/ckMTC ]
       . etc/ckMTC

    if [ -f etc/FaxDispatch ]; then
        . etc/FaxDispatch       # NB: FaxDispatch sets SENDTO based on $SENDER

    I added my stuff after setting the SENDER variable so that my scripts
can process input based on sender. Also note that the working directory of
the script 'faxrcvd' is the FAXSPOOL directory, if you put your script in
the same directory as 'faxrcvd' then you should insert the line

On Wed, 22 Jul 1998, Josh Duncan wrote:

> Hello all,
> Well, I did as you all told and looked into the faxrcvd script to post
> process incoming faxes.  i thought it should be weasy to do what I wanted
> to do, but alas no.
> what i need to do is insert three lines, one line to copy the incoming tif
> file to a temporary directory, one to do conversion on it(by adding a line
> to execute a shell script) and a third line to execute a shellscript to
> create a web page index.
> now, I thought the best place to put it would be after all the mail stuff
> for a successful mreciept.  that is, the faxrcvd script would mail the
> user saying hey it worked, then my scripts woudl run and convert the tif
> to a pdf, and then make a web index of all recieved pdfs.
> so here's where i looked to put it:
>          echo ""
>          $FAX2PS $FILE 2>/dev/null
>          echo ""
>          echo "--$MIMEBOUNDARY--"
>         ) | 2>&1 $SENDMAIL -ffax -oi $SENDTO
>     fi
> ---my stuff inserted here-----
> else
>     #
>     # Generate notification mail for a failed attempt.
>     #
> now, i put my three lines there, but nothing gets executed.  all the mail
> still works just fine, but nothing that I have added works correctly.  so
> then i tried putting my stuff closer to the "front" of the faxrcvd script,
> right here:
> if [ -f $FILE ]; then
>     #
>     # Check the sender's TSI and setup to dispatch
>     # facsimile received from well-known senders.
>     #
> ---mine go here---
>     SENDER="`$INFO $FILE | $AWK -F: '/Sender/ { print $2 }' 2>/dev/null`"
>     SENDTO=
>     if [ -f etc/FaxDispatch ]; then
> again, everything from the default works, as far as email goes, but
> nothing i have added gets executed.
> anyone have any ideas on how i am supposed to do this?  I could have sworn
> I understood shell scripts, and the syntax of this shell script in
> particular, but this has got me totally stumped.
> if this is an easy solution, my apologies in advance for any wasted
> bandwidth.
> also, thanks in advance, for any help you can give me.
> Josh
> ----
> Josh Duncan
> duncan@msmd.org
> God's like Comet(TM), nothing cleans better.

K.S.Wat SSA(D)12
Computer Division,
Hong Kong Observatory.

Project hosted by iFAX Solutions