PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Hylafax verschickt keine Mails beim Faxeingang



Tastengott
14.07.02, 14:07
Moin!

Nachdem ich jetzt 24 Stunden versucht habe Hylafax zum laufen zu bringen, werd ich jetzt euch mal damit belasten ;-)

Eins vorneweg, ich habe ein System from Scratch, also nix mit Heulsusen und Mützenträgern ;-)

Ich habe eine ISDN-Karte (AVM Fritz/ISA) A1 oder so hieß das mal.
CAPI20 und alles was dazu gehört von AVM hab ich installiert, also capi4hylafax, capi4k-utils sind auch installiert.

Faxe senden kann ich. Empfangen ebenfalls, jedenfalls liegen die im Verzeichnis recvq.

Ich habe das sample Script von capi4hylafax mal ins bin Verzeichnis gepackt und umbenannt. Da meckert er mich an, das er mimencode nicht finden kann.
Logisch, ist nicht installiert. Warum?
Weil das Ding 8 Jahre alt ist und zu metamail gehört, was man nicht so einfach übersetzen kann.
Wer mir eine einfache Möglichkeit geben kann, wie man das Übrsetzt bin ich dabei.

Aber jetzt zu dem eigentlichen Problem:
Wie gesagt, ich bekomme keine E-Mail über ein eingegangenes fax.
Die Datei FaxDispatch existiert und die richtige E-Mail Adresse steht drin.

Muß ich jetzt noch irgendetwas anpassen?
Aus dem Howto von Hylafax werd ich nicht ganz schlau, meiner Meinung nach habe ich alles gemacht, was nötig ist.

Bin für alle Anregungen dankbar.

READY
14.07.02, 16:31
bei mir funzt die ganze geschichte..

du musst die datei bin/faxrcvd anpassen, welche ja bei faxempfang aufgerufen wird, bei mir schaut die jetzt so aus: (mein system sendet mir das fax als pdf anhang)



#! /bin/sh
#
# /var/spool/hylafax/bin/faxrcvd
# Noel Burton-Krahn <noel@burton-krahn.com>
# Sept 4, 1999
#
#
# faxrcvd file devID commID error-msg
#
# modified faxrcvd from hylafax which calls faxrcvd-mail
#
if [ $# != 4 ]; then
echo "Usage: $0 file devID commID error-msg"
exit 1
fi
FILE="$1"
DEVICE="$2"
COMMID="$3"
MSG="$4"
TRUNCFILE=`echo $FILE | sed -e 's/\.tif//'`

test -f etc/setup.cache || {
SPOOL=`pwd`
cat<<EOF

FATAL ERROR: $SPOOL/etc/setup.cache is missing!

The file $SPOOL/etc/setup.cache is not present. This
probably means the machine has not been setup using the faxsetup(1M)
command. Read the documentation on setting up HylaFAX before you
startup a server system.

EOF
exit 1
}
. etc/setup.cache

/usr/bin/tiff2ps -a -O $SPOOL/$TRUNCFILE.ps $SPOOL/$FILE
/usr/bin/ps2pdf $SPOOL/$TRUNCFILE.ps $SPOOL/$TRUNCFILE.pdf

TOADDR=faxrec@bast.ligno.com
PATH="$SPOOL/sbin:$SPOOL/bin:$PATH"

#
# If you're using faxcron and would like to have the recvq file removed if
# mail delivery was successful, then uncomment this if clause and comment
# the line(s) following.
#
#if faxrcvd-mail "$FILE" "$DEVICE" "$COMMID" "$MSG" "$TOADDR" fax "$TRUNCFILE.pdf" | \
#/usr/sbin/sendmail $TOADDR; then
# rm -f $SPOOL/$TRUNCFILE*
#fi

if faxrcvd-mail "$FILE" "$DEVICE" "$COMMID" "$MSG" "$TOADDR" fax "$TRUNCFILE.pdf" | \
/usr/sbin/sendmail $TOADDR; then
rm -f $SPOOL/$TRUNCFILE.pdf
rm -f $SPOOL/$TRUNCFILE.ps
fi


die variable TOADDR beinhaltet die addy, wos hingeschickt werden soll...
mimencode/metamail muss auch installiert sein...

zusätzlich brauche ich für diese konfiguration eine datei bin/faxrcvd-mail
welche wie folgt aussieht:



#! /usr/bin/perl -w
#
# /var/spool/hylafax/bin/faxrcvd-mail
# Noel Burton-Krahn <noel@burton-krahn.com>
# Sept 4, 1999
#
# a replacement for hylafax's faxrcvd which sends the whole fax by email

use strict;


my($file, $device, $commid, $msg, $toaddr, $fromaddr, $pdffile) = @ARGV;

#open(STDOUT, "|send -oi -f fax $toaddr");

my(%info, $info);
my($boundary);

$boundary=join('---',
"=Boundary=",
$$,
sprintf('%x', rand(0xffffffff)));

open(IN, "/usr/sbin/faxinfo $file|") || die("/usr/sbin/faxinfo $file:
$!");
while(<IN>) {
$info .= $_;
$info{lc($1)} = $2 if( /^\s*(\S+): (.*)$/ );
}
close(IN) || die("/usr/sbin/faxinfo: $?");

print <<EOF
From: HylaFAX Server < $fromaddr >
To: $toaddr
Subject: FAX from $info{sender} at $info{received}
Mime-Version: 1.0
Content-Type: Multipart/Mixed; Boundary=\"$boundary\"
Content-Transfer-Encoding: 7bit

This is a multi-part message in MIME format.

--$boundary
Content-Type: text/plain; charset=us-ascii
Content-Description: FAX information
Content-Transfer-Encoding: 7bit

$info

EOF
;

if( $msg ne "" ) {
print <<EOF
The full document was not received because:

$msg

EOF
;
}
if( open(IN, "<log/c$commid") ) {
print <<EOF
---- Transcript of session follows ----
EOF
;
print while(<IN>);
close(IN);
}

print <<EOF
--$boundary
Content-Type: application/pdf; name="FAX from $info{sender} at $info{received}.pdf"
Content-Description: FAX from $info{sender} at $info{received}
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="FAX from $info{sender} at $info{received}.pdf"

EOF
;

open(IN, "mimencode $pdffile |") || die ("couldn't mimencode $pdffile: $!");
print while(<IN>);
close(IN) || die("mimencode: $?");

print <<EOF
--$boundary--
EOF
#! /usr/bin/perl -w
#
# /var/spool/hylafax/bin/faxrcvd-mail
# Noel Burton-Krahn <noel@burton-krahn.com>
# Sept 4, 1999
#
# a replacement for hylafax's faxrcvd which sends the whole fax by email

use strict;


my($file, $device, $commid, $msg, $toaddr, $fromaddr, $pdffile) = @ARGV;

#open(STDOUT, "|send -oi -f fax $toaddr");

my(%info, $info);
my($boundary);

$boundary=join('---',
"=Boundary=",
$$,
sprintf('%x', rand(0xffffffff)));

open(IN, "/usr/sbin/faxinfo $file|") || die("/usr/sbin/faxinfo $file:
$!");
while(<IN>) {
$info .= $_;
$info{lc($1)} = $2 if( /^\s*(\S+): (.*)$/ );
}
close(IN) || die("/usr/sbin/faxinfo: $?");

print <<EOF
From: HylaFAX Server < $fromaddr >
To: $toaddr
Subject: FAX from $info{sender} at $info{received}
Mime-Version: 1.0
Content-Type: Multipart/Mixed; Boundary=\"$boundary\"
Content-Transfer-Encoding: 7bit

This is a multi-part message in MIME format.

--$boundary
Content-Type: text/plain; charset=us-ascii
Content-Description: FAX information
Content-Transfer-Encoding: 7bit

$info

EOF
;

if( $msg ne "" ) {
print <<EOF
The full document was not received because:

$msg

EOF
;
}
if( open(IN, "<log/c$commid") ) {
print <<EOF
---- Transcript of session follows ----
EOF
;
print while(<IN>);
close(IN);
}

print <<EOF
--$boundary
Content-Type: application/pdf; name="FAX from $info{sender} at $info{received}.pdf"
Content-Description: FAX from $info{sender} at $info{received}
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="FAX from $info{sender} at $info{received}.pdf"

EOF
;

open(IN, "mimencode $pdffile |") || die ("couldn't mimencode $pdffile: $!");
print while(<IN>);
close(IN) || die("mimencode: $?");

print <<EOF
--$boundary--
EOF



eine FaxDispatch oder so brauche ich dafür garnicht, naja hoffe dir geholfen zu haben...

tschau..

Tastengott
14.07.02, 18:49
Vielen Dank erstmal!

Aber das bringt mich wohl im Moment nicht wirklich weiter, da ich metamail nicht zum kompilieren bewegen kann :mad:

READY
14.07.02, 23:01
trotzdem müste ne email ankommen, wenn metamail nich installiert is funktionier halt nur der dateianhang nicht korrekt..
hast dus schonmal mit ner RPM version versucht? die hab bei mir auch gefunzt..
http://www.rpmfind.net

Tastengott
15.07.02, 15:18
Soderle :D

Ich habe jetzt metamail installiert bekommen.
Irgendwie scheinen aber die tiff dateien kaputt zu sein, denn ich bekomme jetzt Mails, aber die sind leer.

Wenn ich die tiff Dateien versuche per Hand, also sprich: tiff2ps o.ä. umzuwandeln.
Sagt er mir, das der Header von der tiff Datei defekt ist.

Das muß ich mir morgen mal gesondert reinziehen.

Vielen Dank erstmal an alle!!

Ein Problem bleibt allerdings noch.
Was ist die beste möglichkeit ein fax über diesen Server zu senden?
Also ohne, das ich mich dort anmelde. Ist schließlich mein Server, der irgendwo in der ecke steht.

THX A LOT!

READY
15.07.02, 16:53
bitte kein problem ;)

faxclient möglichkeiten:

#1 ssh einloggen und mit sendfax schicken

#2 Susefax unter linux oder windows benutzten (beide betriebssysteme werden unterstützt, der client is in java)

#3 WHFC unter windows benutzten (auch kein schlechter faxclient)

#4 Khylafax unter KDE benutzten

..
-> TIP: richte dir wenn du mit win arbeitest nen postscript drucker ein, der in eine datei druckt, diese ausgabe datei ist dann eine *.ps (postscript) datei, auch wenn sie in win da ne andere dateiendung hat...
-> TIP: richte dir nachdem du WHFC installiert hast (falls du das benutzt) nen Postscript drucker ein der auf dem (dann möglichen anschluss) WHFC läuft, wenn du dann damit drückst, wird WHFC geöffnet und sagt dir du sollst ne faxnr eingeben, so haste nen hylafaxclient als win fax drucker... is ganz praktisch ;) genauere infos dazu auf der WHFC page.. musste halt ma googlen ;)

cya

Tastengott
15.07.02, 21:46
Soderle ;)

Es läuft soweit, aber der FaxServer schickt mir immernoch leere Mails :confused:

Wenn ich die einzelnen Schritte als User uucp manuell ausführe, also erstmal .ps datei erstellen, dann pdf usw.
Das funzt alles.

Jetzt brauch ich mal ein paar Ideen, wie ich die ganze Sache debuggen kann?

Sprich ich will jetzt wissen, WIE RUFT HYLAFAX faxrecvd auf?

Ich vermute, das an dem Sring etwas falsch ist!

Wär nett, wenn mir einer einen Tipp geben könnte.

THX A LOT!

audia8
16.07.02, 07:42
Hallo,

meine Faxrcvd sieht so aus:

#! /bin/sh
# $Id: faxrcvd.sh.in,v 1.3 2002/02/15 04:31:04 darren Exp $
#
# HylaFAX Facsimile Software
#
# Copyright (c) 1990-1996 Sam Leffler
# Copyright (c) 1991-1996 Silicon Graphics, Inc.
# HylaFAX is a trademark of Silicon Graphics
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#

#
# faxrcvd file devID commID error-msg
# nachstehender geändert von6 auf 4
if [ $# != 4 ]; then
echo "Usage: $0 file devID commID error-msg CIDNumber CIDName "
exit 1
fi

test -f etc/setup.cache || {
SPOOL=`pwd`
cat<<EOF

FATAL ERROR: $SPOOL/etc/setup.cache is missing!

The file $SPOOL/etc/setup.cache is not present. This
probably means the machine has not been setup using the faxsetup(8C)
command. Read the documentation on setting up HylaFAX before you
startup a server system.

EOF
exit 1
}
. etc/setup.cache

INFO=$SBIN/faxinfo
#FAX2PS=$TIFFBIN/fax2ps

FAX2PS=$TIFFBIN/fax2tiff

MIMENCODE=mimencode
TIFF2PS=tiff2ps
PS2PDF=ps2pdf
TOADDR=FaxMaster

#
# Permit various types of attachment types: ps, tif, pdf
# Note that non-ASCII filetypes require metamail.
# pdf requires tiff2ps and ps2pdf
#
FILETYPE=pdf #tif

#
# There is no good portable way to find out the fully qualified
# domain name (FQDN) of the host or the TCP port for the hylafax
# service so we fudge here. Folks may want to tailor this to
# their needs; e.g. add a domain or use localhost so the loopback
# interface is used.
#
HOSTNAME=`hostname` # XXX no good way to find FQDN
PORT=4559 # XXX no good way to lookup service

FILE="$1"
DEVICE="$2"
COMMID="$3"
MSG="$4"
CIDNUMBER="$5"
CIDNAME="$6"

FILENAME=`echo $FILE | $SED -e 's/\.tif//' -e 's/recvq\///'`

if [ -f $FILE ]; then
#
# Check the sender's TSI and setup to dispatch
# facsimile received from well-known senders.
#
SENDER="`$INFO $FILE | $AWK -F: '/Sender/ { print $2 }' 2>/dev/null`"
SENDTO=
if [ -f etc/FaxDispatch ]; then
. etc/FaxDispatch # NB: FaxDispatch sets SENDTO
fi
if [ "$TOADDR" != "$SENDTO" ]; then # don't send FaxMaster duplicate
(echo "To: $TOADDR"
echo "From: The HylaFAX Receive Agent <fax>"
echo "Subject: Facsimile received from $SENDER";
echo ""
echo "$FILE (ftp://$HOSTNAME:$PORT/$FILE):"; $INFO -n $FILE
echo "ReceivedOn: $DEVICE"
if [ "$MSG" ]; then
echo ""
echo "The full document was not received because:"
echo ""
echo " $MSG"
echo ""
echo " ---- Transcript of session follows ----"
echo ""
if [ -f log/c$COMMID ]; then
$SED -e '/-- data/d' \
-e '/start.*timer/d' -e '/stop.*timer/d' \
log/c$COMMID
elif [ -n "$COMMID" ]; then
echo " No transcript available (CommID c$COMMID)."
else
echo " No transcript available."
fi
else
echo " CommID: c$COMMID (ftp://$HOSTNAME:$PORT/log/c$COMMID)"
fi
if [ "$CIDNUMBER" ]; then
echo " CIDNumber: $CIDNUMBER"
echo ""
fi
if [ "$CIDNAME" ]; then
echo " CIDName: $CIDNAME"
echo ""
fi
if [ -n "$SENDTO" ]; then
echo ""
echo "The facsimile was automatically dispatched to: $SENDTO."
fi
) | 2>&1 $SENDMAIL -ffax -oi $TOADDR
fi
if [ -n "$SENDTO" ]; then
(MIMEBOUNDARY="NextPart$$"
echo "Mime-Version: 1.0"
echo "Content-Type: Multipart/Mixed; Boundary=\"$MIMEBOUNDARY\""
echo "Content-Transfer-Encoding: 7bit"
echo "To: $SENDTO"
echo "From: The HylaFAX Receive Agent <fax>"
echo "Subject: Facsimile received from $SENDER";
echo ""
echo "--$MIMEBOUNDARY"
echo "Content-Type: text/plain; charset=us-ascii"
echo "Content-Transfer-Encoding: 7bit"
echo ""
echo "$FILE (ftp://$HOSTNAME:$PORT/$FILE):"; $INFO -n $FILE
echo "ReceivedOn: $DEVICE"
if [ "$MSG" ]; then
echo ""
echo "The full document was not received because:"
echo ""
echo " $MSG"
echo ""
echo " ---- Transcript of session follows ----"
echo ""
if [ -f log/c$COMMID ]; then
$SED -e '/-- data/d' \
-e '/start.*timer/d' -e '/stop.*timer/d' \
log/c$COMMID
elif [ -n "$COMMID" ]; then
echo " No transcript available (CommID c$COMMID)."
else
echo " No transcript available."
fi
else
echo " CommID: c$COMMID (ftp://$HOSTNAME:$PORT/log/c$COMMID)"
fi
if [ "$CIDNUMBER" ]; then
echo " CIDNumber: $CIDNUMBER"
echo ""
fi
if [ "$CIDNAME" ]; then
echo " CIDName: $CIDNAME"
echo ""
fi
echo ""
echo "--$MIMEBOUNDARY"
if [ "$FILETYPE" = "tif" ]; then
echo "Content-Type: image/tiff; name=\"$FILENAME.tif\""
echo "Content-Description: FAX document"
echo "Content-Transfer-Encoding: base64"
echo "Content-Disposition: attachment; filename=\"$FILENAME.tif\""
echo ""
$MIMENCODE $FILE 2>/dev/null
elif [ "$FILETYPE" = "pdf" ]; then
echo "Content-Type: application/pdf; name=\"c$COMMID.pdf\""
echo "Content-Description: FAX document"
echo "Content-Transfer-Encoding: base64"
echo "Content-Disposition: attachment; filename=\"c$COMMID.pdf\""
echo ""
$TIFF2PS -a -O $FILE.ps $FILE 2>/dev/null # fax2ps looks bad
$PS2PDF $FILE.ps $FILE.pdf 2>/dev/null
$MIMENCODE $FILE.pdf 2>/dev/null
$RM -f $FILE.ps $FILE.pdf 2>/dev/null
else # default as Postscript
echo "Content-Type: application/postscript; name=\"$FILENAME.ps\""
echo "Content-Description: FAX document"
echo "Content-Transfer-Encoding: 7bit"
echo "Content-Disposition: attachment; filename=\"$FILENAME.ps\""
echo ""
$FAX2PS $FILE 2>/dev/null
fi
echo ""
echo "--$MIMEBOUNDARY--"
) | 2>&1 $SENDMAIL -ffax -oi $SENDTO
fi
else
#
# Generate notification mail for a failed attempt.
#
(echo "To: $TOADDR"
echo "From: The HylaFAX Receive Agent <fax>"
echo "Subject: facsimile not received"
echo ""
echo "An attempt to receive facsimile on $DEVICE failed because:"
echo ""
echo " $MSG"
echo ""
echo " ---- Transcript of session follows ----"
echo ""
if [ -f log/c$COMMID ]; then
$SED -e '/-- data/d' \
-e '/start.*timer/d' -e '/stop.*timer/d' \
log/c$COMMID
elif [ -n "$COMMID" ]; then
echo " No transcript available (CommID c$COMMID)."
else
echo " No transcript available."
fi
) | 2>&1 $SENDMAIL -ffax -oi $TOADDR
fi

Ich hoffe, dass ich das Script richtig und vollständig importiert habe.
Viel Glück!!

MFG

audia8