HylaFAX The world's most advanced open source fax server

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

Re: [hylafax-users] faxrcvd and notify

Richard Morris wrote  on 19/10/05 06:46 PM:
Hello all,

I have a situation that maybe someone can help me solve. 

I am setting up our new server and just finished installing HylaFax 4.2.2.  I can send and receive without a problem.  On our old system I had written a replacement script for faxrcvd so that faxes that HylaFax received would be added to our intranet's database.  That worked fine.  Now I am trying to get it to work on the new system and it isn't working.

The actual script is located at /intranet/serverscripts/fax/faxrcvd.php and so I originally edited the /var/spool/hylafax/etc/config.ttyS0 to have FaxRcvdCmd: /intranet/serverscripts/fax/faxrcvd.php.  The script worked right when I called it from the command line but when I faxed a test document to the server, HylaFax didn't call the script.  After some research I found that the *Cmd options paths are relative to the spool directory so I created a symbolic link called /var/spool/hylafax/bin/faxrcvd.php that pointed to the proper script.  I tested the script on the command line and it worked fine but when I sent a fax to the server, it didn't call the script again. 
Not only are the paths relative to the spool directory, but the Hylafax processes are "chrooted" (a security precaution) so that they can't even see anything outside the /var/spool/hylafax directory.  From their running environment, the /var/spool/hylafax directory IS / (the root directory).  So my guess is that if you changed your symbolic link to just be a copy of the faxrcvd.php file, it would work.  (This also explains why it works from the command line, because you are running it from your user perspective and that user can see outside of the /var/spool/hylafax directory.)



I have checked the syslog and see that it is calling the script:

Oct 19 11:43:20 server1 FaxGetty[3478]: RECV FAX: bin/faxrcvd.php "recvq/fax000000011.tif" "ttyS0" "000000016" ""

but for some reason the script isn't being executed by HylaFax.  The script's file permissions are:

-rwxrwxr-x  1 root apache 6.0K Oct 19 11:37 faxrcvd.php

I am not sure why the script isn't being called.  Can anyone suggest something for me to try?  Can I change the ServerTracing to something to see if an error is returned from the script?  Like I said, the faxrcvd.php works fine from command line.  The faxrcvd.php has #!/usr/local/bin/php at the top of the file so I don't need to specify the interpreter.

I am assuming that if I can get this to work, the NotifyCmd would be the same way to receive notice of faxes that have been sent (either successfully or requeued)?

Thanks for any help.

Untitled Document

Richard Morris
HDD Broker Inc.

Toll-Free: (866) 960-3331
    Phone: (250) 474-6022
      Fax: (250) 474-6099
   E-Mail: richard@xxxxxxxxxxxxx
      Web: www.hddbroker.com

Project hosted by iFAX Solutions