[ERLEDIGT] Asterisk & Hylafax -> Fax2Mail

HobbyStern

Aktives Mitglied
Mitglied seit
5 Dez 2005
Beiträge
1,844
Punkte für Reaktionen
0
Punkte
36
Hallo Alle,

ich habe mich nebenher immer mal wieder etwas mit Hylafax beschäftigt - das ganze klappt auch soweit beim Empfang, s.h. :

- Iaxmodem nimmt ab
- Hyla empfängt das Fax
- Legt es als tif ab und loggt alles brav

Code:
REC,2007,07,05,14,44,53,Faxnummer-ist-geheim,<NONE>,,000000024,ttyIAX0,fax000000012.tif,
REC,2007,07,05,15,20,53,Faxnummer-ist-geheim,<NONE>,,000000025,ttyIAX0,fax000000013.tif,
REC,2007,07,05,15,33,52,Faxnummer-ist-geheim,<NONE>,,000000026,ttyIAX0,fax000000014.tif,
Jedoch wird die Emailadresse bereits im Log nicht eingetragen, obwohl sie im faxrcvd hinterlegt ist (root).

Die users.conf existiert nicht.

Ein Versand ist problemlos möglich.

Nur wie schaffe ich es Hyla erstmal ohne FaxDispatch eine einfache Mailadresse mit auf den Weg zu geben? Ich verzweifele da etwas, die Docs von hylafax.org habe ich auch durch, jedoch sind diese nicht gerade aussagekräftig wenn etwas nicht sauber läuft, Google ebenso.

Ich dachte ich frage (wenn auch etwas offtopic) erst hier und melde mich dann in der hylacommunity neu an.

Danke im Vorab (!!)

Stefan
 
Zuletzt bearbeitet:
Meines Wissens muss für die Verteilung eingehender Faxe als Mail zwingend eine FaxDispatch vorhanden sein (während beim Ausgang in der einfachsten Form ein NotifyFaxmaster=always in der notify genügt).
Dabei kann die Faxdispatch ja einfach gehalten sein, indem keine zusätzlichen Kriterien verwendet werden.
 
in der einfachsten form habe ich die FaxDispatch vor einigen Tagen so getestet (ist nun nicht der genaue wortlaut) :


Code:
SENDEMAIL=root;
FILETYPE=pdf;
Auch das brachte leider einen Erfolg = 0.

Ich habe im faxrcvd Skript danach einfach die Prüfung nach FaxDispatch und users.conf auskommentiert und die Variable SENDTOMAIL (ich meine so hiess sie) auf "root" gesetzt - auch das brachte keinen Erfolg. Während es natürlich problemlos funktioniert wenn ich den gesamten "sendemail "$sendtomail" usw usf" auf der bash starte - dann geht die mail durch. auch die rechte habe ich geprüft und uucp für die hylafax verzeichnisse auf 755 gesetzt.

Hat jemand ggf. eine bestehende Konfig ?

Grüsse, Stefan
 
Du hast Dich in der Variable vertan:

Code:
FILETYPE=ps # oder pdf oder tiff
SENDTO=root # fuer Dein Beispiel

eine komplette faxrcvd koennte dann so aussehen (hylafax 4.3.4):

Code:
#! /bin/bash
#       $Id: faxrcvd.sh.in,v 1.49 2007/02/28 13:18:01 aidan 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
#
if [ $# -lt 4 ]; then
    echo "Usage: $0 file devID commID error-msg [ callID-1 [ callID-2 [ ... [ callID-n ] ] ] ]"
    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
}

# These settings may not be present in setup.cache if user upgraded and
# didn't re-run faxsetup; we set them before calling setup.cache for
# backward compatibility.
ENCODING=base64
TIFF2PDF=bin/tiff2pdf
TTYCMD=tty

. etc/setup.cache
. bin/common-functions

INFO=$SBIN/faxinfo
FAX2PS=$TIFFBIN/fax2ps
TIFF2PS=tiff2ps
TOADDR=FaxMaster
FROMADDR=fax
TIFFINFO=tiffinfo
NOTIFY_FAXMASTER=never

#
# Redirect errors to a tty, if possible, rather than
# dev-nulling them or allowing them to creep into
# the mail.
#
if $TTYCMD >/dev/null 2>&1; then
    ERRORSTO=`$TTYCMD`
else
    ERRORSTO=/dev/null
fi

#
# Permit various types of attachment types: ps, tif, pdf
# Note that non-ASCII filetypes require an encoder.
# pdf requires tiff2ps and tiff2pdf
# Multiple file types may be specified by separating them with
# whitespace; in that case a separate attachment for each filetype
# will be created.
#
FILETYPE=ps
SENDTO=root

#
# 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"; shift;
DEVICE="$1"; shift;
COMMID="$1"; shift;
MSG="$1"; shift;
COUNT=1
while [ $# -ge 1 ]; do
    # The eval has $1 set yet, and this forces a variable-to-variable
    # assignment, allowing us to not need to do escaping
    eval CALLID$COUNT='$1'
    export CALLID$COUNT
    shift
    COUNT=`expr $COUNT + 1`
done
CIDNUMBER="$CALLID1"
CIDNAME="$CALLID2"

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

SetupPrivateTmp

parseFaxInfo $FILE

MIMEBOUNDARY="NextPart$$"

if [ -n "$MSG" ]; then
    SESSION_LOG=`cat log/c$COMMID`
    export SESSION_LOG
fi

export FILE
export COMMID
export DEVICE
export MSG
export FROMADDR
export HOSTNAME
export PORT
export SENDTO
export TOADDR


#
# 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

if [ -f etc/templates/$TEMPLATE/hook.sh ]
then
    # Any hooks that the templates need
    . etc/templates/$TEMPLATE/hook.sh
fi


## MailWithFAX <type>
## Email the <type> template,adding the attachments according
## to $FILETYPE to $SENDTO
##
## We use the common CreateMailMessage <template> <f1> <t1> <n1> <d1>
## function, creating the file to mail as we go.
MailWithFAX ()
{
    template="etc/templates/$TEMPLATE/faxrcvd-$1.txt"
    files_1=$FILE;
    filetype_1=TIFF;
    nfiles=1;
    for ft in $FILETYPE
    do
        ATTACH_ARGS="$ATTACH_ARGS "`BuildAttachArgs $ft`
    done
    eval CreateMailMessage $template $ATTACH_ARGS \
        2>$ERRORSTO | $SENDMAIL -f"$FROMADDR" -oi "$SENDTO"

}

if [ -f $FILE ]; then
    #
    # Don't send FaxMaster duplicates, and FaxMaster may not even
    # want a message at all, depending on NOTIFY_FAXMASTER.
    #
    case $NOTIFY_FAXMASTER$MSG in
        never*)         NOTIFY_FAXMASTER=no;;
        errors)         NOTIFY_FAXMASTER=no;;
        *)              NOTIFY_FAXMASTER=yes;;
    esac
    if [ "$TOADDR" != "$SENDTO" ] && [ "$NOTIFY_FAXMASTER" != "no" ]; then
        if [ -z "$MSG" ]; then
            CreateMailMessage etc/templates/$TEMPLATE/faxrcvd-notify-success.txt \
                        2>$ERRORSTO | $SENDMAIL -f"$FROMADDR" -oi "$TOADDR"
        else
            CreateMailMessage etc/templates/$TEMPLATE/faxrcvd-notify-error.txt \
                        2>$ERRORSTO | $SENDMAIL -f"$FROMADDR" -oi "$TOADDR"
        fi
    fi
    if [ -n "$SENDTO" ]; then
        # Create the document to attache
        if [ -z "$MSG" ]; then
            MailWithFAX success
        else
            MailWithFAX error
        fi

    fi
else
    #
    # Generate notification mail for a failed attempt.
    # There is no file to send...
    #
    CreateMailMessage etc/templates/$TEMPLATE/faxrcvd-failure.txt \
        2>$ERRORSTO | $SENDMAIL -f"$FROMADDR" -oi "$TOADDR"
fi

CleanupPrivateTmp

Damit das ganze unabhängig von Deiner Hyla-Version ist, hier noch einmal eine FaxDispatch, die das gleiche bewirken sollte:


Code:
#
# Dispatch fax to email depending on own MSN or extention (ISDN lines)
# sourced from faxrcvd
#
# You may set the following parameters
# SENDTO - the user who'll receive the information of the incomming facsimile
# FILETYPE - the filetype the facsimile will be attached (pdf,ps,tiff)
#

SENDTO=root
FILETYPE=ps # oder pdf bzw. tiff

Danach sollte Dein Hylafax bei Faxempfang etwas in seinem Log schreiben in der Art:

Code:
FaxGetty[20466]: RECV FAX: bin/faxrcvd "recvq/fax000000058.tif" "ttyIAX0" "000000035" "" "XXXXXXXXXXXXXX" "" "<NONE>" "s"

und dann sollte auch im Log des MTA ein entsprechender Versand auftauchen.

Viel Erfolg! :)
 
Sorry - aber das brachte leider auch nichts - er merkt mittlerweile das die FaxDispatch existiert und loggt auch brav meine Mailadresse mit ein - es passiert nur nix im MTA (ich habe hier exim im einsatz als simplen mailsender konfiguriert).

Ich werde nun nochmals bei Adam und Eva anfangen - mal sehen ob da irgendwas schief gelaufen ist

:noidea:

ProblemResonanz kommt!

[Hier ist sie !]

Nun klappt´s - und zwar auf Anhieb und auch mit der bestehenden Konfiguration.

Nach einem erneuten kompilieren der Sources ist nun alles so wie es soll - da wird sich wohl irgendetwas verrannt haben beim make-ing - wie auch immer - ich habe zu Danken für Deine Hilfe - aller Anfang ist schwer und es ist nicht gerade förderlich das für Hylafax zig verschiedene HowTos existieren die sich meist auf veraltete Versionen beziehen und alle einen vollkommen anderen Weg gehen, mal abgesehen vom make :lach: .

Nun kann er auch Faxe empfangen und diese brav durchleiten, auch per FaxDispatch auf verschiedene User.

Danke nochmals !
 
Zuletzt bearbeitet:
Kostenlos!

Statistik des Forums

Themen
248,464
Beiträge
2,292,029
Mitglieder
377,899
Neuestes Mitglied
tazmaniancj