eval CreateMailMessage "$template" $ATTACH_ARGS \
2>$ERRORSTO | $SENDMAIL -f"$FROMADDR" -oi "$mailaddr"
[COLOR="Red"][B]TEMPLATE_PATH=`etc/templates/$TEMPLATE/`
$SED -n -e '1,/^$/d;p' $template | template "$TEMPLATE_PATH" > $TMPDIR/body.txt
cat $TMPDIR/body.txt | lpr
rm -rf $TMPDIR/body.txt
[/B][/COLOR]
CleanupPrivateTmp
RETURNFILETYPE=pdf;
etc/FaxNotify
Aug 5 16:02:35 localhost FaxSend[22054]: MODEM WWW.SOFT-SWITCH.ORG spandsp/
Aug 5 16:02:35 localhost FaxSend[22054]: SEND FAX: JOB 15 DEST xxxxx COMMID 000000066 DEVICE '/dev/ttyIAX0' FROM 'XXXX <XXX@XXX>' USER fax
Aug 5 16:02:49 localhost kernel: zaptel Disabled echo canceller because of tone (rx) on channel 2
Aug 5 16:03:08 localhost FaxSend[22054]: SEND FAX: JOB 15 SENT in 0:00:13
Aug 5 16:03:10 localhost FaxQueuer[21753]: NOTIFY: bin/notify "doneq/q15" "done" "0:00:44"
Aug 5 16:03:10 localhost FaxQueuer[21753]: NOTIFY exit status: 0 (22082)
Aug 5 16:03:33 localhost FaxGetty[1995]: MODEM WWW.SOFT-SWITCH.ORG spandsp/
bin/notify "doneq/q15" "done" "0:00:44"
Hi,
das ist jetzt ev. eine blöde Frage, aber Drucken generell funktioniert schon, oder?
z.B. : lpr /etc/hosts
schufti
Aug 5 16:03:10 localhost FaxQueuer[21753]: NOTIFY: bin/notify "doneq/q15" "done" "0:00:44"
Aug 5 16:03:10 localhost FaxQueuer[21753]: NOTIFY exit status: 0 (22082)
set -x
bin/notify "doneq/q15" "done" "0:00:44"
Alternativ kannst Du in bin/notify.sh mal als ersten Befehl
Code:set -x
einfügen, danach nochmal
Code:bin/notify "doneq/q15" "done" "0:00:44"
ausführen und die entstehenden Ausgaben hier posten.
++ PCL6CMD=pcl6
++ PSPACKAGE=gs
++ QPENCODE=/usr/bin/mimencode -q
++ RM=/bin/rm
++ SBIN=/usr/local/sbin
++ SCRIPT_SH=/bin/bash
++ SED=/bin/sed
++ SENDMAIL=/usr/sbin/sendmail
++ SPOOL=/var/spool/hylafax
++ SYSVINIT=
++ TARGET=i686-pc-linux-gnu
++ TIFF2PDF=/usr/bin/tiff2pdf
++ TIFFBIN=/usr/bin
++ TTYCMD=/usr/bin/tty
++ UUCP_LOCKDIR=/var/lock
++ UUCP_LOCKTYPE=ascii
++ UUENCODE=/usr/bin/uuencode
+ INFO=/usr/local/sbin/faxinfo
+ TIFFINFO=tiffinfo
+ FAX2PS=/usr/bin/fax2ps
+ TIFF2PS=tiff2ps
+ PS2PDF=ps2pdf
+ PDF2PS=pdf2ps
+ PS2FAX=bin/ps2fax
+ PDF2FAX=bin/pdf2fax
+ TOADDR=FaxMaster
+ FROMADDR=fax
+ NOTIFY_FAXMASTER=never
+ RETURNFILETYPE=
+ MIMEBOUNDARY=NextPart3805
+ RETURNTECHINFO=yes
+ /usr/bin/tty
++ /usr/bin/tty
+ ERRORSTO=/dev/pts/2
+ SetupPrivateTmp
+ '[' -d '' ']'
+ '[' -z '' ']'
+ TMPDIR=/tmp
++ mktemp -d /tmp/hylafaxtmp-XXXXXXXX
+ HYLAFAX_TMPDIR=/tmp/hylafaxtmp-XXGPaqyE
+ '[' 0 '!=' 0 ']'
+ TMPDIR=/tmp/hylafaxtmp-XXGPaqyE
+ export TMPDIR
+ trap cleanupExit 0
+ trap 'hfExit 1' 1 2 15
+ parseQfile
+ VAR_PREFIX=
+ '[' -n '' ']'
+ FILENAME=doneq/q15
+ '[' '!' -f doneq/q15 ']'
+ /usr/bin/mawk -F: '
function p(varname,val)
{
gsub(/\047/, "\047\\\047\047", val);
# mawk sees 047 as decimal 47 rather than octal, so we use the decimal
# value of the quote character: 39.
printf "%s%s=%c%s%c\n",var_prefix,varname,39,val,39
printf "export %s%s\n",var_prefix,varname
}
BEGIN {
var_prefix="";
nfiles = 0;
npins = 0;
}
/^nsf/ { p("equipment", $3); p("station", $5); next; }
/^external/ { p("number", $2); next; } # override unprocessed number
/^regarding/ { regarding = $0; sub("regarding:", "", regarding); p("regarding", regarding); next; }
/^jobtag/ { jobtag = $0; sub("jobtag:", "", jobtag); p("jobtag", jobtag); next; }
# status needs to be used in the shell as faxstatus since status is reserved word
/^status:/ { status = $0; sub("status:", "", status);
while ($0 ~ /\\\\$/ && getline > 0) {
sub(/\\\\$/, "\\n", status);
status = status $0;
} p("faxstatus", status);
next;
}
/^[!]*post/ { p("files_"++nfiles, $4); p("filetype_"nfiles, "PostScript"); next; }
/^[!]*tiff/ { p("files_"++nfiles, $4); p("filetype_"nfiles, "TIFF"); next; }
/^[!]*pdf/ { p("files_"++nfiles, $4); p("filetype_"nfiles, "PDF"); next; }
/^[!]*pcl/ { p("files_"++nfiles, $4); p("filetype_"nfiles, "PCL"); next; }
/^page:/ { p("pins_"++npins, $4); next; }
/^data:/ { p("files_"++nfiles, $4); next; }
/^poll/ { p("poll", " -p"); next; }
# Only parse remaining valid lines and allows for colons to appear in the value part
/^[a-z]+:/ { str = $0; sub($1":", "", str); p($1, str); next; }
{printf "# Invalid line> %s\n", $0;}
END { p("nfiles", nfiles); p("npins", npins) } ' doneq/q15
+ . /tmp/hylafaxtmp-XXGPaqyE/qfile-awk.sh
++ tts=1249480990
++ export tts
++ killtime=1249491685
++ export killtime
++ retrytime=0
++ export retrytime
++ state=7
++ export state
++ npages=1
++ export npages
++ totpages=1
++ export totpages
++ nskip=0
++ export nskip
++ skippages=0
++ export skippages
++ ncover=0
++ export ncover
++ coverpages=0
++ export coverpages
++ ntries=0
++ export ntries
++ ndials=0
++ export ndials
++ totdials=1
++ export totdials
++ maxdials=12
++ export maxdials
++ tottries=1
++ export tottries
++ maxtries=3
++ export maxtries
++ pagewidth=209
++ export pagewidth
++ resolution=98
++ export resolution
++ pagelength=296
++ export pagelength
++ priority=127
++ export priority
++ schedpri=127
++ export schedpri
++ minbr=0
++ export minbr
++ desiredbr=13
++ export desiredbr
++ desiredst=0
++ export desiredst
++ desiredec=2
++ export desiredec
++ desireddf=3
++ export desireddf
++ desiredtl=0
++ export desiredtl
++ useccover=1
++ export useccover
++ usexvres=0
++ export usexvres
++ number=xxxx
++ export number
++ number=xxxx
++ export number
++ [email protected]
++ export mailaddr
++ sender=senf
++ export sender
++ jobid=15
++ export jobid
++ jobtag=
++ export jobtag
++ pagehandling=
++ export pagehandling
++ modem=any
++ export modem
++ faxnumber=
++ export faxnumber
++ tsi=
++ export tsi
++ receiver=
++ export receiver
++ company=
++ export company
++ location=
++ export location
++ voice=
++ export voice
++ fromcompany=
++ export fromcompany
++ fromlocation=
++ export fromlocation
++ fromvoice=
++ export fromvoice
++ regarding=
++ export regarding
++ comments=
++ export comments
++ cover=
++ export cover
++ client=localhost.localdomain
++ export client
++ owner=fax
++ export owner
++ groupid=15
++ export groupid
++ signalrate=14400 bit/s
++ export signalrate
++ dataformat=2-D MMR
++ export dataformat
++ jobtype=facsimile
++ export jobtype
++ tagline=
++ export tagline
++ subaddr=
++ export subaddr
++ passwd=
++ export passwd
++ doneop=default
++ export doneop
++ commid=000000066
++ export commid
++ csi=+49 xxxx
++ export csi
++ equipment=Canon Laser Class 9000 Series
++ export equipment
++ station=YYYY
++ export station
++ pagerange=
++ export pagerange
++ faxstatus=
++ export faxstatus
++ statuscode=0
++ export statuscode
++ returned=2
++ export returned
++ notify=none
++ export notify
++ pagechop=default
++ export pagechop
++ chopthreshold=3
++ export chopthreshold
++ files_1=docq/doc15.ps
++ export files_1
++ filetype_1=PostScript
++ export filetype_1
++ nfiles=1
++ export nfiles
++ npins=0
++ export npins
+ '[' default = default ']'
+ doneop=remove
+ '[' facsimile = pager ']'
+ '[' -n '' ']'
+ DESTINATION=xxxxx
+ '[' -n '' ']'
+ JOBINFO=15
+ COMMID=000000066
+ SENDTO=
+ export COMMID SENDTO FROMADDR TOADDR DESTINATION WHY JTIME NEXT JOBINFO
+ '[' -f etc/FaxNotify ']'
+ . etc/FaxNotify
++ RETURNFILETYPE=pdf
+ SENDTO=FaxMaster
+ [email protected]
+ export SENDTO
+ CleanupPrivateTmp
+ '[' -d /tmp/hylafaxtmp-XXGPaqyE ']'
+ rm -Rf /tmp/hylafaxtmp-XXGPaqyE
+ cleanupExit
+ trap - 0 1 2 15
+ CleanupPrivateTmp
+ '[' -d /tmp/hylafaxtmp-XXGPaqyE ']'
+ '[' -f etc/FaxNotify ']'
+ . etc/FaxNotify
++ RETURNFILETYPE=pdf
+ SENDTO=FaxMaster
+ [email protected]
+ export SENDTO
+ CleanupPrivateTmp
+ '[' -d /tmp/hylafaxtmp-XXGPaqyE ']'
+ rm -Rf /tmp/hylafaxtmp-XXGPaqyE
## We process the NOTIFY_FAXMASTER first, because we want
## this to go without the attachemnts, if they are used
## Faxmaster goes to $TOADDR, but templates always use SENDTO
[B]SENDTO="$TOADDR"[/B]
case "$NOTIFY_FAXMASTER:$WHY" in
"always:*") do_faxmaster;;
"yes:*") do_faxmaster;;
"errors:success") ;; # Not errors
"errors:blocked") ;; # Not errors
"errors:*") do_faxmaster;; # errors
*) ;; # Do nothing;
esac
# We use SENDTO in the templates, but $mailaddr is the job
# param. We set this *after* FaxNotify is sourced, because
# some admins seem to play with mailaddr expecting it to change
# the destination of the nofify email
[B]SENDTO="$mailaddr"
export SENDTO
[/B]
case "$WHY:$notify" in
*":always") do_notify;; # They've asked for it
"requeued:when done+requeued") do_notify;; # Requeued
"requeued:when requeued") do_notify;; # Requeued
"requeued:when done") ;; # Do nothing;
"requeued:none") ;; # Do nothing;
"blocked:"*) ;; # Blocked
"done:when done+requeued") do_notify;; # Done
"done:when requeued") ;; # Do nothing
"done:when done") do_notify;; # Done
"done:none") ;; # Do nothing
# Anything else is a "failure", which always runs notification
*) do_notify;;
esac
[B]CleanupPrivateTmp[/B]
++ notify=none --> Kommt aus dem Faxjob
+ NOTIFY_FAXMASTER=never --> Kommt als Parameter aus notify.sh
-D
Enable notification by electronic mail when the facsimile has been delivered. By default Hyla FAX will notify the submitter only if there is a problem with a job.
Ich möchte, dass mein Hylafax eine Sendebestätigung druckt.
Leider finde ich nirgends, wie ich das anstellen kann.
TEMPLATE_PATH=`etc/templates/$TEMPLATE/`
$SED -n -e '1,/^$/d;p' $template | template "$TEMPLATE_PATH" > $TMPDIR/body.txt
cat $TMPDIR/body.txt | lpr
rm -rf $TMPDIR/body.txt
und wie geht das mit der neusten Version 6.0.3
Drucken will ich nicht, und ein Drucker ist auch nicht angeschlossen
fax unix - n n - 1 pipe flags= user=fax argv=/usr/bin/faxmail -n -d ${user}
fax unix - n n - 1 pipe flags= user=fax argv=/usr/bin/faxmail -n -t done ${user}
fax unix - n n - 1 pipe flags= user=fax argv=/usr/bin/faxmail -n -t done ${user}
case "$WHY:$notify" in
*":always") | do_notify;; # They've asked for it
..............
"done:when done+requeued") | do_notify;; # Done
"done:when requeued") | ;; # Do nothing
"done:when done") | do_notify;; # Done
"done:none") | ;; # Do nothing
....
esac
-d | Enable direct delivery of facsimile; the formatted document will be submitted directly to a HylaFAX server for transmis-
sion as facsimile. This option is similar to piping the output of faxmail to the input of sendfax(8C) except when direct
delivery is enabled faxmail interprets ``x-fax-'' header lines in the envelope of the mail message to look for control
information to use in delivering the facsimile and, by default, no automatic cover page generation is done.
-t when | Notify the sender of job status according to when.
nur das -d nicht mehr unterstützt wird.
Ich habe mir die common_functions mal angesehen, in welcher 1. Buildattachmens und 2. Createmail gemacht werden, da muss ja irgendwo die schleife sein, die alle Attachments zusammen anhängt. Wenn ich diese extrahiert bekäme könnte ich das zusammenasteln.
for i in `LocalSequence 1 $nfiles`
do
(...)
if [ -f "$a_file" ]
then
ARGS="$ARGS"" \"$a_file\" \"$a_type\" \"$a_name\" \"$a_desc\""
fi
done
printf '%s "$ARGS"
if [ -n "$RETURNFILETYPE" ]; then
for ft in $RETURNFILETYPE
do
ATTACH_ARGS="$ATTACH_ARGS "`BuildAttachArgs $ft`
done
fi
eval CreateMailMessage "$template" $ATTACH_ARGS \
2>$ERRORSTO | $SENDMAIL -f"$FROMADDR" -oi "$SENDTO"
(...)
if [ -f "$a_file" ]
then
[COLOR="#B01837"]if [ "{$1,,}" == "pdf" ] ; then
MFILES="$MFILES"" "$a_file
MPATH=$(dirname $a_file)
MNAME=$a_name
else[/COLOR]
ARGS="$ARGS"" \"$a_file\" \"$a_type\" \"$a_name\" \"$a_desc\""
[COLOR="#B01837"] fi[/COLOR]
fi
done
[COLOR="#B01837"] if [ "$1" == "PDF" ] || [ "$1" == "pdf" ] && [ "$2" == "notify" ] ; then
touch $MPATH/merged_attachments.pdf
gs \
-q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dSAFER -dPDFSETTINGS="/printer" \
-dColorConversionStrategy=/LeaveColorUnchanged \
-dSubsetFonts=true -dEmbedAllFonts=true \
-sOutputFile="$MPATH/$MNAME" \
${MFILES:1}
ARGS="$ARGS"" \"$MPATH/$MNAME\" \"application/pdf\" \"$MNAME\" \"FAX Dokument (PDF)\""
fi[/COLOR]
printf '%s' "$ARGS"
}