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 20/10/05 07:26 PM:

Hi,

If HylaFax is chrooted to /var/spool/hylafax, wouldn't that mean even if I did copy of the faxrcvd.php script to /var/spool/hylafax/bin, the script itself wouldn't be able to reference any of the files in my intranet directory structure located elsewhere on the file system?

Yes, I guess that would be true. But at least you'd know (if the script is found, runs, and then has problems of its own finding other files outside that directory), that this chroot issue is indeed your problem.


If this is the case, is this a recent change to HylaFax because in the previous version of HylaFax (v4.2.0) that I was running, the script worked fine.

No, as far as I know, hylafax has been this way for a long time, so I don't know how it could have worked before (or looking at it another way, that suggests that your problem is something else).


Also, what does this mean for others who want to integrate HylaFax into their own intranet via the notification scripts?

That's kind of a vague question; I can't say what it means. It puts limitations on it, I guess. Anyway, I don't think altering faxrcvd is the normal way to customize things. I thought you were supposed to do that in FaxDispatch (faxrcvd will get overwritten on upgrades, FaxDispatch will not). Not that that alleviates the limitation, but I think that is the recommended way.


If someone could suggest an alternate way of knowing when HylaFax has sent and received a fax, I would gladly rewrite my scripts.

Thanks guys for what ever help you can give.

Richard Morris
HDD Broker Inc.

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



marthter wrote:

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.)


Regards.

Martin

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.

--

Richard Morris
HDD Broker Inc.

Toll-Free: (866) 960-3331
    Phone: (250) 474-6022
      Fax: (250) 474-6099
   E-Mail: richard@xxxxxxxxxxxxx <mailto:richard@xxxxxxxxxxxxx>
      Web: www.hddbroker.com <http://www.hddbroker.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*




Project hosted by iFAX Solutions