HylaFAX The world's most advanced open source fax server

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

[hylafax-users] RE : RE : RE : RE : RE : SambaFax problem scanningFax-Nr



Whell, honest I don't know what else to tell you.
Here follows my sambafax scrip that works perfectly well with LPR and
portability optimized postscript on a HP4 PS driver. I use it everyday
for a long time.
Hope this helps.

--
Phil.

----SNIP--------
#!/bin/sh
# 
#     Faxing with HylaFax through a faxprinter
# 
# This script is heavily depending (just about copied) from the work of:
#     -------------------------------------------------
#     Faxfilter für MS-Windows und lpd und mgetty-paket
#     Author     : Wundrig Roland     
#     -------------------------------------------------
# The intellectual (c) remains with Roland Wundrig
# This rev created by ignace.suy@purpel3.nl, september 2000
# Developed and tested using Hylafax 4.1beta2 On SuSE 6.4.
#

# constants
SENDMAIL="/usr/sbin/sendmail"

# make up a temporary file
FAXFILE=/tmp/sambafax.$$

# retrieve the username and hostname from the paramaters
while :
do
    case "$1" in
        -n) Username="$2"
            shift ; shift
            ;;
        -h) Hostname="$2"
            shift ; shift
            ;;
       -*)  shift
            ;;
        *) break
    esac
done

# if the samba user is anonymous then send mails to the postmaster
if [ "$Username" = "nobody" ];
   then
    MailTo="faxmaster"
   else
    MailTo=${Username}
fi

# now dump the to-be faxed data (PostScript format) to the temp file
cat >${FAXFILE}

# retrieve the faxnumber from the printfile
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 do not check the validity of the faxnumber, let sendfax do this...
if [ "${FAXNUM}" = "" ] ; then
    (echo "To: ${MailTo}"
     echo "From: Le gestionnaire de telecopie CubiX <fax>"
     echo "Subject: Echec de l'envoi d'une telecpie"
     echo ""

     echo "Numero inutilisable dans votre fax du :" 
     echo `date`
     echo ""
     echo "La syntaxe du numero doit etre la suivante:"
     echo "Fax-Nr : ddd-ddddddd"
     echo "Aucun espace ni caractere a l'exception du tiret n'est
autorise"
     echo "dans le numero."
     echo ""
     echo "Merci de corriger et de recommencer."
    ) | 2>&1 $SENDMAIL -ffax -oi ${MailTo}
else
    sendfax -D -n -f ${MailTo} -d ${FAXNUM} ${FAXFILE}
fi

# remove the temp file
rm -f ${FAXFILE}

# end of script ######################################################


----SNIP--------

-----Message d'origine-----
De : hylafax-users-bounce@hylafax.org
[mailto:hylafax-users-bounce@hylafax.org] De la part de Shafeer
Hajamohideen
Envoyé : mardi 20 mai 2003 10:28
À : Xware
Cc : hylafax-users@hylafax.org
Objet : Re: [hylafax-users] RE : RE : RE : RE : SambaFax problem
scanningFax-Nr


Hi,

I tried that as well. But now my problem is when I print the document
from a client software (mentioned earlier - Sage KHK), I canot see any
text like a fax number, but I can open the file in gostveiew. may be I
have to use some other filters? Is there any other way to get the fax
number from the client software that send the fax?

Thanks in advance,

-Shafeer

On Mon, 2003-05-19 at 09:44, Xware wrote:
> Hello!
> Imho, the pb sits in the EPS format for this example. Try to print 
> with postscript for optimal portability (ADSC), and then ps2ascii. I 
> bet you'll see the sentence 'fax-nr: YOURNUMBER' in clear. The script 
> needs to read it in clear form (read the script, you'll see it looks 
> for the sequence 'fax-nr : YOURNUMBER'. I don't think ps2ascii can do 
> it from an EPS file, although it does it from a standard PS file.
> 
> Hope this helps.
> 
> --
> Phil.
> 
> -----Message d'origine-----
> De : Shafeer Hajamohideen [mailto:shafeer@dichtelemente.de]
> Envoyé : jeudi 15 mai 2003 18:17
> À : Xware
> Cc : hylafax-users@hylafax.org
> Objet : Re: [hylafax-users] RE : RE : RE : SambaFax problem scanning
> Fax-Nr
> 
> 
> On Thu, 2003-05-15 at 09:01, Xware wrote:
> > Well if you need to print in EPS, you only have to set the tab
> > 'optimize for' to 'Encapsulated Postscript' in the driver. But I'm 
> > quite surprised.. I use sambafax for long, with 'maximum
portability' 
> > set to the driver, and encountered no trouble. I persist to think
that
> 
> > there could be a problem with cups.
> 
> In printer driver (Windows '98)option I found only the following;
>  - postscript for optimal speed and
>  - postscript for optimal portability (ADSC)
>  - EPS
>  - Archive
> 
> But here as I mentioned earlier I can only to a file when using EPS. 
> After making the changes in to the script file I can atleast fax. But 
> now I encountered another problem :-)
> 
> That, I wanted a third party software (SAGE KHK Classic Line) to print

> to this sambafax printer. Unfortunately, its not able to scan the fax 
> number. I can open the file printed out by this software in gostview 
> and see the contents but when i make a ps2ascii to this file I got 
> this;
> 
> ##DDPN#GLFKWHOHPHQWHjGH##
> 
> ##HG$QJHERW\Lambda YRQ\Lambda DUFXV##
> 
> 'LFKWHOHPHQWH\Lambda DUFXV\Lambda *PE+
> 
> \Lambda  $1*(%27 ^_oe*_ss\Lambda  'LFKWHOHPHQWH\Lambda DUFXV\Lambda 
> *PE+
> 
> *URL^PRRUULQJ\Lambda ss 0DUWLQ\Lambda .QRFKH,KU\Lambda %HDUEHLWHU AE 
> *^'aeo/\Lambda +DPEXUJ .XQGHQQXPPHU 'o/o/o/o/o/AE\Lambda 
> $QVSUHFKSDUWQHUAE 7DQMD\Lambda /XGROSK\Lambda i**
> 
> ^*j',j*''_ ^^ /6HLWH\Lambda AE+DPEXUJffl)$;\Lambda AE\Lambda 
> '*'aeae*o/^'aeae 3RVj $UWLNHO 0HQJH (i3UHLV (85 3( *i3UHLV (850(
> 
> ,''2i5LQJ\Lambda ae'\Lambda (3'0\Lambda ,*, ^'ffl'' ,'ffl''6WFN^ 
> *^'\Lambda fl\Lambda _\Lambda PP
> 
> 0LW\Lambda IUHXQGOLFKHQ\Lambda *UA,L^HQ'LFKWHOHPHQWH\Lambda 
> DUFXV\Lambda *PE+ 7DQMD\Lambda /XGROSK\Lambda i**
> 
> flflfl\Lambda \Lambda %LWWH\Lambda JHEHQ\Lambda 6LH\Lambda EHL\Lambda 
> %HVWHOOXQJ\Lambda XQVHUH\Lambda $QJHERWVQXPPHU\Lambda DQ\Lambda 
> \Lambda flflfl 3(\Lambda '\Lambda \Lambda SHU\Lambda ^\Lambda i\Lambda

> 3(\Lambda *\Lambda \Lambda SHU\Lambda ^''\Lambda fl\Lambda 
> ,UUWXP\Lambda XQG\Lambda =ZLVFKHQYHUNDXI\Lambda YRUEHKDOWHQ\Lambda 
> fl\Lambda $QJHERWVJA,OWLJNHLWAE\Lambda ss'\Lambda 
> 7DJH/LHIHUXQJAE\Lambda VRIHUQ\Lambda QLFKW\Lambda DQGHUV\Lambda 
> YHUHLQEDUWffl\Lambda DE\Lambda /DJHU\Lambda SHU\Lambda 8j3j6j\Lambda 
> i\Lambda DOOH\Lambda 3UHLVH\Lambda ]]JOj\Lambda GHU\Lambda 
> JHVHW]OLFKHQ\Lambda 0ZVWj
> 
> *^' _'=DKOXQJAE 7DJH \Phi \Lambda 6NRQWRffl QHWWR7DJH(V\Lambda 
> JHOWHQ\Lambda DXVVFKOLHL^OLFK\Lambda XQVHUH\Lambda DOOJHPHLQHQ\Lambda 
> *HVFKlIWVi\Lambda XQG\Lambda /LHIHUEHGLQJXQJHQ\Lambda i\Lambda 
> *HULFKWVVWDQG\Lambda LVW\Lambda +DPEXUJ
> 
> 7HOj\Lambda '\Lambda *'`aeae\Lambda *o/\Lambda ^'i*' *HVFKlIWVIA,KUHU 
> $PWVJHULFKW\Lambda +DPEXUJ 3RVWEDQN\Lambda +DPEXUJ'LFKWHOHPHQWH\Lambda

> DUFXV\Lambda *PE+*URL^PRRUULQJ\Lambda ss )D[\Lambda '\Lambda 
> *'`aeae\Lambda *o/\Lambda ^'iaeae 0DUWLQ\Lambda .QRFKH +5%\Lambda
> aeo/*o/* %/=\Lambda *''\Lambda ^''\Lambda *' *^'aeo/\Lambda +DPEXUJ 
> HPDLOAE\Lambda DUFXV#GLFKWHOHPHQWHjGH .WRj\Lambda aeae_\Lambda 
> *o/o/\Lambda *'^ %%[ Page: 1 ]%% %%[ LastPage ]%%
> 
> I'm not sure if the fax number will be extracted from this (what 
> format is this BTW)!
> 
> Any idea?
> 
> -Shafeer
> 
> 
> > --
> > Phil.
> > 
> 
> 
> 
> 
> 


____________________ 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.*





____________________ 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