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] HELP!!!!! SambaFax



> Thanks for responding.
>
> Currently I have the following working correctly
> Hylafax - I can send faxes through the command prompt
> Samba - It has been working for about 6 months or so flawlessly
> Cups - I can print to an actual printer just fine
>
> When I type in the following, I get the following error msg.
>
> mail:/usr/local/www/fax# lpadmin -p SambaFax -E -v sambafax:
> lpadmin: add-printer failed: client-error-not-possible
>
>
> Here is a portion of the CUPS log that shows the error msg.
> E [24/Sep/2002:12:49:53 -0400] add_printer: bad device-uri attribute
> 'sambafax:'!
> D [24/Sep/2002:12:49:53 -0400] Sending error: client-error-not-possible

Well, I got onto my machine and looked at my printers.conf file which I
think is the problem you are having... Mine for hylafax is as follows:

<Printer hylafax>
DeviceURI hylafax:/localhost
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>


Then I have a backend as follows in /usr/lib/cups (named hylafax)

#!/bin/sh
# constants
SENDMAIL="/usr/sbin/postfix"
PS2ASCII="/usr/bin/ps2ascii"
AWK="/bin/awk"
SENDFAX="/usr/bin/sendfax" # make up a temporary file
FAXFILE=/tmp/sambafax.$$ # retrieve the username and hostname from the
paramaters
Username=$2 # if the samba user is anonumous then send mails to the
postmaster
if [ "$Username" = "nobody" ];
   then
    MailTo="postmaster"
   else
    MailTo=${Username}
fi # now dump the to-be faxewd data (PS fdormat) to the temp file
cat >${FAXFILE}       # this comes from the pipe (local mission)
cat $6 >>${FAXFILE}   # or this comes from samba as a file # retrieve the
faxnumber fr
om the printfile
# the silly three x's are added because some awk strugle with an immediate CR
# we use a PS to ascii pipe to strip (most of) the Postscript controls
FAXNUM=`${PS2ASCII} ${FAXFILE} | ${AWK} '{ IGNORECASE=1 } /FAX-Nr ?:
?[0-9-]*/ \
         {  $0=$0 "xxx"; \
            gsub(/-/,""); \
            anfang=match($0,/ ?: ?/); \
            anfang=anfang+match(substr($0,anfang),/[0-9]/)-1; \
            ende=match(substr($0,anfang),/[^0-9]/)-1; \
            printf ("%s",substr($0,anfang,ende)) \
         }' ` # if faxnumber is found fax the tempfile
# we donot check the validity of the faxnumber, let sendfax do this...
if [ "${FAXNUM}" = "" ] ; then
    (echo "To: ${MailTo}"
     echo "From: The HylaFAX Samba dancer "
     echo "Subject: your facsimile request failed"
     echo ""
     echo "The faxnumber is not recognized in your fax of"
     echo `date`
     echo ""
     echo "The faxnumber is recognised via this text:"
     echo "   Fax-Nr : ddd-ddddddd"
     echo "No spaces or characters are allowed between the digits, just a -"
     echo ""
     echo "Please correct and retry"
    ) | 2>&1 ${SENDMAIL} -ffax -oi ${MailTo}
else
  ${SENDFAX} -n -D -f ${MailTo} -d ${FAXNUM} ${FAXFILE}
fi # remove the temp file
#rm -f ${FAXFILE} # end of show


Finally I needed to add a .ppd description which is as follows (in
/usr/share/cups/model):

... a little too big to paste for the whole group ...

Anyway, the way i did it again is:

(1)  Go look on www.sourceforge.net for FAX4CUPS.  Use the fax4cups stuff
to install hylafax first!!!!  Get cups up and running.  Once you have your
cups setup all set, then...

(2)  Make sure you can see the samba share for your new printer.  Restart
samba.  Look in shares.

(3)  Put an appropriate backend in /usr/lib/cups/backends.  In my case, I
found that the sambafax script that they have for cups is great...

(4)  Finally, download the adobe generic postscript driver, install, and
use it to point to the new samba share.  Now follow instructions for
sambafax, and you are done.

I did not directly try to use the sambafax setup.  Just for the backend,
that was it.

Sunil






____________________ 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@hylafax.org < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@hylafax.org.*




Project hosted by iFAX Solutions