Faxverteiler (Serienfax) unter FreeBSD

daiv

AgainstAllAuthority
Hallo,

ist einem von euch bekannt ob man mit z. B. hylafax Serienfaxe rausschicken kann? Ich habe eine AVM C2 Karte, mit 2 ISDN Kanälen und möchte auch beide nutzen. Ist das möglich?
Ich denke mal ich brauche dann die CAPI Treiber für FreeBSD dafür? Hat einer von euch schon Erfahrungen gesammelt?

Vielen Dank
 
Hi

Wir haben hier einen Rechner mit einer C4 stehen. Zwar nicht zum Faxen, aber als
Telefonbeantworter. Die Treiber müssen im Kernel eingerichtet werden und die
Firmware muss beim Start geladen werden, alles kein Problem. Da gibt es einige
Anleitungen im Netz.

Faxe versenden habe ich auf FreeBSD noch nicht versucht, aber meiner Meinung
nach ist das c4b (CAPI for BSD von Thomas Wintergerst) und das capi4hylafax
(http://www.shellbang.org) nötig.

Hoffe das hilft dir weiter.

Dom
 
Ja das hilft mir sehr weiter. Vielen Dank!!!
Ich denke mal das Hylafax das kann. Wichtig ist nur das die Karte läuft.
Welche FreeBSD Version verwendest du?
 
Momentan Version 5.4.

Bei HylaFAX hast du verschiedene Möglichkeiten deine Dokumente zu versenden. Am einfachsten
wäre z.B. ein Shellscript, welches alle Fax-Nummern aus einem Textfile liest und per loop mit
'sendfax' versendet. HylaFAX hat einen Spooler und versendet dann sämtliche Aufträge
automatisch.

Gruss

Dom
 
Die Frage ist ob er dabei beide Ports nutzen kann. Weil das wäre wichtig. Es sind nämlich sehr viele Faxe.
Könnt ihr alle Ports bei eurer Karte nutzen?
 
Also habe es geschafft. Der Faxverteiler funktioniert. Jetzt muss das Fax nur noch personalisiert werden. Aber das stelle ich mir einfacher vor. Mal sehen.

Wie auch immer, kurz erklärt wie ich es geschafft habe:
Also als erstes habe hier diese Anleitung durchgemacht. Aber leider hat damit noch lange nicht meine C2 auf allen Kanälen gesendet.
Also habe ich lange lange gesucht bis ich auf meinem eigenen Rechner (nein nicht in mit google ;)) eine sample file (sample_AVMC4_config.faxCAPI) für die C4 (8 Kanäle) gefunden habe.
Diese liegt unter /usr/local/share/examples/capi4hylafax
Dort steht auch wenn man eine C2 hat, ab wann man in der Datei die Zeilen löschen soll.
Dann habe ich diese Konfiguration etwas angepasst.
Außerdem symbolische Links zur /var/spool/hylafax/etc/config.faxCAPI in das Verzeichnis /var/spool/hylafax/etc mit den Namen der Devices.

Meine config.faxCAPI sieht so aus:
SpoolDir: /var/spool/hylafax
FaxRcvdCmd: /var/spool/hylafax/bin/faxrcvd
FaxReceiveUser: uucp
LogFile: /var/log/hylafax.log
LogTraceLevel: 0
LogFileMode: 0600

{
# Controller 1, B-Channel 1
HylafaxDeviceName: faxCAPI
RecvFileMode: 0600
#FAXNumber:
LocalIdentifier: "TEST"
MaxConcurrentRecvs: 2
OutgoingController: 1
OutgoingMSN:
SuppressMSN: 1
NumberPrefix:
UseISDNFaxService: 1
RingingDuration: 0
{
Controller: 1
AcceptSpeech: 0
UseDDI: 0
DDIOffset: "39976"
DDILength: 3
IncomingMSNs:
AcceptGlobalCall: 1
}
}
{
# Controller 1, B-Channel 2
HylafaxDeviceName: faxCAPI12
RecvFileMode: 0600
#FAXNumber:
#LocalIdentifier: "AVM CAPI4HylaFAX"
MaxConcurrentRecvs: 2
OutgoingController: 1
OutgoingMSN:
SuppressMSN: 1
NumberPrefix:
UseISDNFaxService: 1
RingingDuration: 0
{
Controller: 1
AcceptSpeech: 0
UseDDI: 0
DDIOffset: "39976"
DDILength: 3
IncomingMSNs:
AcceptGlobalCall: 1
}
}
{
# Controller 2, B-Channel 1
HylafaxDeviceName: faxCAPI21
RecvFileMode: 0600
#FAXNumber:
#LocalIdentifier: "AVM CAPI4HylaFAX"
MaxConcurrentRecvs: 4
OutgoingController: 1
OutgoingMSN:
SuppressMSN: 1
NumberPrefix:
UseISDNFaxService: 1
RingingDuration: 0
{
Controller: 2
AcceptSpeech: 0
UseDDI: 0
DDIOffset: "39976"
DDILength: 3
IncomingMSNs:
AcceptGlobalCall: 1
}
}
{
# Controller 2, B-Channel 2
HylafaxDeviceName: faxCAPI22
RecvFileMode: 0600
#FAXNumber:
#LocalIdentifier: "AVM CAPI4HylaFAX"
MaxConcurrentRecvs: 2
OutgoingController: 2
OutgoingMSN:
SuppressMSN: 1
NumberPrefix:
UseISDNFaxService: 1
RingingDuration: 0
{
Controller: 2
AcceptSpeech: 0
UseDDI: 0
DDIOffset: "39976"
DDILength: 3
IncomingMSNs:
AcceptGlobalCall: 1
}
}


SpeakerVolume: quiet

Mein /var/spool/hylafax/etc Verzeichnis sieht demnach so aus:
260 Nov 23 17:12 config
2870 Nov 23 17:37 config.faxCAPI
37 Nov 23 17:16 config.faxCAPI12 -> /var/spool/hylafax/etc/config.faxCAPI
37 Nov 23 17:16 config.faxCAPI21 -> /var/spool/hylafax/etc/config.faxCAPI
37 Nov 23 17:16 config.faxCAPI22 -> /var/spool/hylafax/etc/config.faxCAPI
10421 Nov 21 15:36 cover.templ
1904 Nov 21 15:36 dialrules
2453 Nov 21 15:36 dialrules.europe
2148 Nov 21 15:36 dialrules.sf-ba
3267 Nov 21 15:36 dpsprinter.ps
40 Nov 23 16:09 hosts.hfaxd
14072 Nov 21 15:36 lutRS18.pcf
1183 Nov 23 14:58 setup.cache
680 Nov 23 14:58 setup.modem
14482 Nov 23 17:40 xferfaxlog

Außerdem habe ich mir HylaFaxServer 1.5 für Webmin installiert. Ist ganz nett! (http://www.tecchio.net/webmin/hylafax)

Mit der Clientsoftware für Windows spiele ich mich noch. Aber da ist die Auswahl groß!

DANKE nochmal für eure Hilfe!!!

David
 
Für personalisierte Fax-Dokumente würde sich ein Samba-Server, welcher einen Netzwerkdrucker
zur Verfügung stellt, anbieten. HylaFAX kann, soweit ich weiss, die Faxnummer aus dem
Postscript-File lesen und das Dokument an diese Nummer senden.

So könntest du einen Serienbrief mehrfach an den Faxdrucker senden.

Gruss
Dom
 
Das http://www.bsdforen.de/showthread.php?t=11399 hat mir auch nur soweit geholfen, dass ich das Programm SWT HylaFAX-Light (http://www.swt-online.de/hylafax/index.html) installiert hab und dann kann ich Faxen. Allerdings immer nur eins. Wenn ich Serienfax versuche (z. B. 4 Gleichzeitig) dann kommen alle leer an.
Ich vermute mal dass es ein Windows Problem ist. Im grunde wird ja das Dokument in Windows schon in eine PS Datei umgewandelt wenn ich das richtig verstehe?!
Kommt der Adobe PS Treiber nicht mit so vielen Dokumenten klar?
 
dfa schrieb:
Für personalisierte Fax-Dokumente würde sich ein Samba-Server, welcher einen Netzwerkdrucker
zur Verfügung stellt, anbieten. HylaFAX kann, soweit ich weiss, die Faxnummer aus dem
Postscript-File lesen und das Dokument an diese Nummer senden.

So könntest du einen Serienbrief mehrfach an den Faxdrucker senden.

Gruss
Dom

Jetzt wollte ich diese Lösung probieren. Leider kommt immer "Zugriff Verweigert" beim dem Drucker in XP. Ich hab wirklich schon alle möglichen Zugriffsrechte bei FreeBSD gecheckt, das müsste alles passen. Hier hänge ich fest. Ich komme nicht mehr weiter. Hat einer von euch noch ne Idee? Bin schon den ganzen tag dabei.
Samba Druck wäre geil, da ich dann ohne zusätzliche Software Serienbriefe machen könnte.

Hier meine smb.conf (hab ich mehr oder weniger von irgendwo kopiert, weil ichs einfach nicht gebacken kriege):

[global]
workgroup = ANDREEDENTAL
guest account = nobody
keep alive = 30
os level = 2
security = user
printing = bsd
printcap name = /etc/printcap
load printers = yes

[homes]
comment = Heimatverzeichnis
browseable = no
read only = no
create mode = 0750

[printers]
comment = All Printers
browseable = no
printable = yes
public = no
read only = yes
create mode = 0700
directory = /var/spool/samba

Meine /etc/printcap

faxlp:\
:lp=/dev/null:\
:sd=/var/spool/lpd/faxlp:\
:if=/var/spool/hylafax/bin/sambafax:\
:sh:sf:mx#0:

Danke
 
Zuletzt bearbeitet:
Danke dfa, aber bin grad dabei das mit sambafax oder salsafax über cups zu lösen. Das Problem ist, dass das Script anscheinend die Nummer nicht richtig rausliest. Ist ein Script für Linux. Vielleicht entdeckt einer von euch den Fehler oder kann sagen was ich für FreeBSD umschreiben muss?

SambaFax Script:
#!/bin/sh
# constants
SENDMAIL="/usr/sbin/sendmail"
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 from 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


und salsafax wäre das:

#!/usr/bin/perl -w

##########################################################################
#
# SALSAFAX
#
# This perl script routes postscript printerdata from printerspooler to
# faxsend. It is typically used in a print-to-fax setup. Read more about
# its purpose on www.purpel3.com/sambafax/
#
# After installing run this script from the commandline:
# echo blah | ./salsafax
#
# This will learn if there are any dependancies unsolved: this tool is
# dependant upon the following:
# perl (we tested with v5.6 and its likely any v5 will do)
# perl module Getopt-Long-2.32
# perl module Mail-Sendmail-0.78
# sendmail (from the hylafax package)
# ps2ascii (comes with the ghostscript package)
#
# After you run salsafax without any errors you can deploy it meaningfull.
#

use strict;
use Getopt::Long;
use Mail::Sendmail;

# constants you must check if they are ok
my $ALLOWMULTIFAX = 0; # allow (1) or not (0) multiple faxdestinations
my $EMAILFROMDOC = 1; # get the emailaddress from samba (0) or the doc (1)
my $SENDFAX = "/usr/bin/sendfax"; # the command to send a fax
my $PS2ASCII = "/usr/bin/ps2ascii"; # the command to convert postscript to readable text

# constants you can alter but should consider not to
my $TMPDIR = "/tmp/"; # the directory to store temporary files
my $MYNAME = "salsafax"; # the name of this tool
my $LOGFILE = $TMPDIR . $MYNAME . ".log"; # the name of the logfile - debugging sessions only
my $PSFILE = $TMPDIR . $MYNAME . ".ps." .$$ ; # the name of the postscript temporary file
my $MAILADDRESS = 'postmaster@localhost'; # the default mailaddress for errormessages
my $MULTISEP = ";"; # if you have more than 1 faxnr on a line, they are seperated by ;
# this character should NOT appear in $DIGITS
my $DEBUG=0;

# constants you really should not touch !!!
my $FAXID = 'Fax-Nr{0,1}\s*:\s*'; # search string for fax-nr
my $FAXIDS = 'Fax-Nrs\s*:\s*'; # search string for fax-nrs ( for multifax }
my $DIGITS = '0123456789+( ),-'; # digits allowed in the faxnr
my $MODEMLIKES = '0123456789+,'; # digits my modem will not reject: ,=wait +=int.access
# this should be a subset of $DIGITS
my $EMAILDOC = 'E-m@il :'; # the string to look for an emailaddress

########## from here on, leave the code alone, unless you are really sure ############

#variables
my @faxlines; # stores the raw faxlines
my @faxdest; # stores the faxnumbers
my $MultiFax = 0; # determines if ENDuser specified to multifax
my $mailaddress = ""; # how do we treat the errormessages
my $lpuser = ""; # username retrieved from lprng or lpd commandline
my $lphost = ""; # hostname retrieved from lprng or lpd commandline
my @emaillines; # stores the documentlines containing EMAILDOC


# check some dependencies
if ( ! -d $TMPDIR ) {
print("Error: temporary directory not found: ", $TMPDIR );
exit 1;
}
if ( ! -e $SENDFAX ) {
Log("Error: sendfax command not found: ", $SENDFAX );
exit 1;
}
if ( ! -e $PS2ASCII ) {
Log("Error: ghostscript command not found: ", $PS2ASCII );
exit 1;
}


# get usefull parameters
my $cupsfile = $ARGV[5]; # CUPS parses a filename with the printdata as the 6th parameer
# this could be undef (after lpr -d blah) or a filename (after a samba action)
my $cupsuser = $ARGV[1]; # CUPS paresed the username with the printdata as the 2nd parameter
# this is usually a user from localhost
GetOptions( 'h=s' => \$lphost, # LPD and LPRng parse host and user name under the -h and -n parameter
'n=s' => \$lpuser); # the postscript is parsed to it in a pipe - to be found in STDIN


# ok lets find out where we can send the mail to
if ( ( $lphost ) and ( $lpuser ) ) { #if the user and host can be found on the commandline
$mailaddress = $lpuser . '@' . $lphost ;
} elsif ( $cupsuser) {
$mailaddress = $cupsuser . '@localhost' ;
} else {
$mailaddress = $MAILADDRESS;
}

# where is the printerdata?
if ( ( $cupsfile ) and ( -e $cupsfile ) ) {
$PSFILE = $cupsfile;
} else {
&SavePostscriptdata;
}


# ok we have a postscriptfile, now
if ( &RetrieveRawFaxline ) { # we found one ore more lines
if ( &ExtractFaxnumber ) { # we could extract a real faxnumber
if ($EMAILFROMDOC) {
$mailaddress = &GetEmailFromDoc;
}
&TrySending;
} else { # no real faxnumber could be extracted
&SendErrorMail;
}
} else { # no lines with faxnr found
&SendErrorMail;
}

# delete the printfile in any case
unlink $PSFILE;

# always exit gracefully.
exit 0;


# sub #################################################
# save the information in the pipe to the ps tmp file
sub SavePostscriptdata {
open PS, ">".$PSFILE or die("Sorry, cannot open temporary postscript file $PSFILE .\n");
while (<STDIN>) {
print PS $_ ;
}
close PS;
}

# sub #################################################
sub RetrieveRawFaxline {
my $CL = $PS2ASCII . " " . $PSFILE . " |";
my $ret = 0;

open CL, $CL; # carry out ps2ascii on the ps-file and return the output into perl
while (my $line=<CL>) {
chomp $line;
if ($line =~ /$FAXID/i) { # if the rawline matches with fax-nr
push @faxlines, $line ; # add it to the stack of matching lines
$ret++;
}
if ($line =~ /$FAXIDS/i) { # if the rawline matches with fax-nrs
$MultiFax = 1; # the userties to multifax
}
if ($line =~ /$EMAILDOC/i) { # if the rawline matches with "email"
push @emaillines, $line; # add it to the emailstack
}
}
close CL;

# check the multifax setting
$MultiFax = $ALLOWMULTIFAX if $MultiFax; # ALLOWMULTIFAX overrides Multifax

return $ret;
}


# sub #################################################
sub ExtractFaxnumber {
my $ret = 0; # return value: 0=nothing found, more=ok

if ( $MultiFax ) { # extract all the faxnumbers you can find
for ( my $i=0; $i<@faxlines; $i++) { # for all the rawline
push @faxdest, &GetFaxNumbersFrom($faxlines[$i]); #extract the numbers
}
$ret = @faxdest;
} else { # just extract the first faxnumber in the first line
my @fns = &GetFaxNumbersFrom($faxlines[0]); # extract the numbers from the first raw line
if ( defined $fns[0] ) { # if it exists
push @faxdest, $fns[0]; # put it on the return stack
$ret++;
}
}

return $ret;
}


# sub #################################################
sub GetFaxNumbersFrom {
my @ret = ();
my $rawline = shift;
if ( defined $rawline ) {

my $ModemRejects = "[^" . $MODEMLIKES . "]"; # regexp with non-modem chars

if ( $rawline =~ /$FAXIDS/i ) { #line contains fax-nrs
$rawline =~ s/$FAXID/;/gi ; # substitute all the Fax-Nr with an ;
my @fnrs = split(/;/, $rawline); # split the line up between non-allowed digits
for ( my $i=0; $i<@fnrs; $i++) { # for all the splitups
my $f = $fnrs[$i];
my $goodpart = '([' . $DIGITS . ']*)[^' . $DIGITS . ']*.*$';
$f =~ s/$goodpart/$1/ ; # keep the goodpart
$f =~ s/$ModemRejects//g; # remove all the non-modem characters
if ( $f gt "" ) { # and if anything is left
push @ret, $f; # add it to the return stack
}
}
} else { # if we find a faxnr, take special care
my $re = '^.*' . $FAXID; # search for fax-nr
$re .= "(";
$re .= "[" . $DIGITS . "]*"; # followed by allowed digits
$re .= ")";
$re .= "[^" . $DIGITS . ']*.*$'; # followed by non-allowed digits

$rawline =~ s/$re/$1/i ; # and extract the allowed part from it

$rawline =~ s/$ModemRejects//g; # then remove all the non-modem characters
if ( $rawline gt "" ) { # and if anything is left
push @ret, $rawline; # add it to the return stack
}
}
}
return @ret;
}

# sub #################################################
sub GetEmailFromDoc {
my $result = $mailaddress; # the default return is the existing mailaddress
if (@emaillines > 0) { # if there are any emailsadresses found
# take the 1st found only, ignore the rest
# anything after the : is the emailaddress
(undef, my $em) = split(/:/, $emaillines[0]);
# remove trailing and leading spaces
$em =~ s/^\s*(\S*)\s*$/$1/;
# if there is a @ in the middle consider the email adress valid
if ($em =~ /\w+@\w+/) {
$result = $em;
}
}
return $result;
}


# sub #################################################
sub TrySending {
for ( my $i=0; $i<@faxdest; $i++ ) { # for every found faxnumber
# compile a commandline
my $fc = $SENDFAX . " -n -D -f " . $mailaddress . " -d " . $faxdest[$i] . " " . $PSFILE ;
system $fc if not $DEBUG; # and execute it
Log($fc); # and log it
}
}

# sub #################################################
sub SendErrorMail {

my $mh = "\n";
$mh .= "The faxnumber is not recognized in your fax of " . localtime() . "\n";
$mh .= "\n";
$mh .= "The faxnumber is recognised via this text:\n";
$mh .= " Fax-Nr : <faxnumber> \n";
$mh .= "\n";

if ( $ALLOWMULTIFAX ) {
$mh .= " or\n";
$mh .= " Fax-Nrs : <faxnumber> ; <faxnumber> ; ... \n";
$mh .= "\n";
}

$mh .= "The 'Fax-Nr' part is not case sensitive.\n";
$mh .= "The characters allowed in the <faxnumber> are: '" . $DIGITS . "'.\n";
$mh .= "\n";
$mh .= "Please correct and retry.\n";

sendmail( To => $mailaddress ,
From => 'Your fax gateway <postmaster@localhost>',
Subject => 'Your facsimile request failed.',
Message => $mh
);

Log("sent errormail to $mailaddress");

}


# sub #################################################
sub Log {
open LG, ">>" . $LOGFILE;
print LG join(" ", @_), "\n";
close LG;
}


Die Pfade für sendfax und ps2ascii habe ich bei mir schon angepasst. das sind jetzt die original scripts von http://www.purpel3.nl/sambafax

Das Problem ist dass er als Fehler meldet er konnte die FaxNummer nicht herausfiltern. Diese habe ich aber hundert pro richtig geschrieben. So wie auf der Seite gezeigt: Fax-Nr : 444444
 
So ich habe mich jetzt mal rangemacht das sambafax script etwas zu durchleuchten. So langsam blicke ich durch was der Fehler ist.
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)) \
}' `
Speichert die Faxnummer nicht. Ich habe aber diesen Befehl getestet, er findet die Faxnummer. Auch sonst stimmt alles. Könnte es eventuell an den "`" liegen? Gibt es etwas BSD spezifisches was man umschreiben müsste? Gibt es eine art Debugger für so ein Script?

Vielen Dank!

David
 
Externe Programme können mit dem ASCII Zeichen 96 aufgerufen werden. Aber
vielleicht gibt es Probleme beim Umbruch des Scripts.

Gruss
Dom
 
dfa schrieb:
Externe Programme können mit dem ASCII Zeichen 96 aufgerufen werden. Aber
vielleicht gibt es Probleme beim Umbruch des Scripts.

Gruss
Dom

Wenn ich das Script in eine Datei schreibe, funktioniert das mit dem Umbruch. Ich werde es aber gleich mal versuchen! Danke erstmal. Bitte schreib wenn du noch eine Idee hast. Oder ein anderes Script!
 
Wenn ich im SambaFax Script in der Zeile mit:

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

eine Datei angebe, dann funktioniert es zb auch. Kann es an dem:

# 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

liegen? Funktioniert das nicht unter FreeBSD?

Ich hab jetzt das Script wirklich schon zerlegt bis zum geht nicht mehr. Ich habe einfach nicht so die Erfahrung. Kann bitte einer nochmal gucken ob ihm etwas auffällt?

Vielen Dank
 
Hast du auf dem Windows Rechner einen Apple Laserwriter mit der EPS Postscript
Option installiert? Wenn ja, kannst du bitte ein Testdokument in ein Zip-Archiv
packen und uploaden. Wenn nein, bitte installieren und testen, allenfalls auch
uploaden.

Gruss
Dom
 
Ja habe ich. Ich habe sogar die Einstellungen soweit angepasst dass er die Nummer raussucht (zb Postscript Version 1 statt 2 und statt geschwindigkeit optimieren etwas anderes, EPS oder so). Dh. wenn ich das Script soweit umschreibe das oben die Datei direkt angegeben wird (zb. /tmp/sambafax.789 und nicht wie im Script /tmp/sambafax.$$) dann liest er die Nummer aus dem Script und sendet einen Faxauftrag.
Ich bin jetzt daheim und nicht in der Arbeit, hier habe ich keinen Laserwriter installiert. Aber ich kann auf den Server zugreifen. Ich füge die Datei gleich ein...

Ok ich habs auch nochmal getestet. Bei dieser zeigt er auch die Nummer an.

Diese "^M" stehen für einen Absatz oder? Die stellen aber kein Problem dar, weil die Nummer wird ja ausgelesen :(

Liegt das nicht irgendwo am "cat"?

Danke nochmal für deine Hilfe, ist echt sehr wichtig!
 

Anhänge

  • test.zip
    6 KB · Aufrufe: 617
Zuletzt bearbeitet:
Das Problem scheint folgendes zu sein:

Ändere

FAXNUM=`${PS2ASCII} ${FAXFILE} | ${AWK} '{ IGNORECASE=1 } /FAX-Nr ?: ?[0-9-]*/ \

zu

FAXNUM=`${PS2ASCII} ${FAXFILE} | ${AWK} '{ IGNORECASE=1 } /[FAX-Nr ?: ?\[0-9-\]*]/ \

Der Regexp-Ausdruck /.../ muss in /[...]/ stehen und die enthaltenen Klammern werden mit \[ bzw. \] neutralisiert.

Hoffe dass dies das Problem war.

Gruss
dom
 
dfa schrieb:
Das Problem scheint folgendes zu sein:

Ändere

FAXNUM=`${PS2ASCII} ${FAXFILE} | ${AWK} '{ IGNORECASE=1 } /FAX-Nr ?: ?[0-9-]*/ \

zu

FAXNUM=`${PS2ASCII} ${FAXFILE} | ${AWK} '{ IGNORECASE=1 } /[FAX-Nr ?: ?\[0-9-\]*]/ \

Der Regexp-Ausdruck /.../ muss in /[...]/ stehen und die enthaltenen Klammern werden mit \[ bzw. \] neutralisiert.

Hoffe dass dies das Problem war.

Gruss
dom

Leider hat das auch nicht geholfen, trotzdem danke! Hat das bei dir funktioniert?

Wenn ich im Script manuell eine Datei angebe, und unten statt Sendfax ein " echo ${FAXNUM}" mache, dann spuckt er die Nummer richtig aus. Auch mit deinem geänderten Befehl.

Das Problem muss also hier liegen:

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

# 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

Hast du noch eine Idee?
 
Mal eine dumme Frage: Hast du das Script mit dem Input-Parameter gestartet? Also:

myfaxscript.sh < test.ps

Denn in /etc/printcap (LPD) werden die Daten in dieser Weise an das Script weitergeleitet.

Gruss
Dom
 
Nein ich habe wie auf der Seite (http://www.purpel3.nl/sambafax/sambatest_6B.html) beschrieben: lp -d SambaFax dateiname gemacht. Ich möchte ja mit CUPS drucken.

Aber wenn ich mit deiner Methode (also z. B. "./sambafax /tmp/sambafax.888") mache gehts!

Liegt der Fehler demnach bei CUPS (bzw. an mir)? Ich bin so vorgegangen wie auf der o.g. Seite beschrieben.
 
Das Problem liegt demnach schon an der Konfiguration des Druckerspoolers. Ich
persönlich würde es mit der lpd Variante versuchen. Das Dokument wird einfach an
das :if=<script> weitergeleitet.

Evtl. liegt es an den Ausführungsberechtigungen des Scripts oder an fehlenden oder
falschen Pfadangaben.

Sorry, viel mehr kann ich dir auch nicht helfen. Habe leider keine Zeit, ein System
zu installieren.

Gruss
Dom
 
Ok ich werde es nochmal mit lpd versuchen.

Dennoch vielen Dank für deine Hilfe. Wenn ichs hinbekomme schreibe ich.
 
Zurück
Oben