HylaFAX The world's most advanced open source fax server

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

[hylafax-users] user uucp - MIME:Lite - Perl



Hello all.
I'm trying to finish a GPL PHP/MYSQL/PERL/HYLAFAX Fax hosting plateform using an Ubuntu distribution on a dedicated server
I'm using capi4hylafax also


I modified  the file : /var/spool/hylafax/bin/faxrcvd file
and added this :

#
# Apply customizations.  All customizable variables should
# be set to their non-customized defaults prior to this.
#
if [ -f etc/FaxDispatch ]; then
   . etc/FaxDispatch           # NB: FaxDispatch sets SENDTO
fi

# We start perl perl script once received

/var/spool/hylafax/bin/faxperl.pl $1 $2 $3 $4 $5 $6 $7

The last line is to start a perl script I made.
The purpose of this perl script is to rename the Tiff fax to a unique name, and move it to a directory around /var/www/vdfax/faxes so people will be able to get then via HTTP.
The script queries a MySQL database to find the ISDN Short ID number and if an email is attached to this number. If there is an email, if make a MIME Lite email and attaches the file.


"
use DBI;
use MIME::Lite;

..... if (length($row[7]) <= 0){# No emaik to forward to in MYSQL Table
} else
{ # We have an email to forward to in the sql table
print FILE2 "Forwarding and alert to pager $row[7] with no attachment \n";


            my $msg = new MIME::Lite
            From    =>'$faxmaster',
            To      =>'$row[7]',
            Subject =>'Fax received from $mynumber[7]',
            Type    =>'TEXT',
            Data    =>"Download from: http://www.testfax.com/$timest.tif";;
            $msg -> send;


};



When I run this script as root (shell), or normal user from shell, the mail is produced, even with attachment if I ask the scritp to make attachment


When Hylafax starts faxrcvd then jumps to faxperl.pl everything goes ok in my script (I can move , rename files; query and insert into database) except
MIME::Lite which does not send mail. I supposed uucp does not know where to find MIME:Lite (Perl CPAN Module) - I found the way to start 'c2faxrecv ' as root but still get the MIME::LITE not working when
/faxperl.pl $1 $2 $3 $4 $5 $6 $7 is lauched from faxrecv


a ps -aux gives
uucp 10587 0.0 0.3 19960 1688 pts/0 Sl 10:34 0:00 c2faxrecv
or
root 10587 0.0 0.3 19960 1688 pts/0 Sl 10:34 0:00 c2faxrecv (if launched as root)


Which is the waiting process for Hylafax on my ISDN card

As I'm not an expert I would like some advices or shares with people who already faced the problem.
How can we make uucp load the MIME:Lite CPAN module. Is there a way to define a kind of environment in the header of the script with (forced PATH to the Lite.pm CPAN libary )?
Am I missing something , the most strange thing is that DBI module called from the same perl script wirks fine.









____________________ 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