Hallo, ich lasse mir die Empfangenen Faxe, die Hylafax empfangt per E-MAil zustellen. Ich erhalte auch eine Mail, allerdings hat die PDF-Datei im Mailanhang eine größe von 0 Bytes. --- snip (faxrcvd)--- #! /bin/sh # # /var/spool/fax/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 # #echo "`date`:$@/EOL" >>/tmp/fax.out if [ $# != 4 -a $# != 5 ]; 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 FATALER FEHLER: $SPOOL/etc/setup.cache existiert nicht! Die Datei $SPOOL/etc/setup.cache ist nicht vorhanden. Das bedeutet moeglicherweise, dass Sie HylaFax bisher nicht mittels faxsetup konfiguriert haben. Lesen Sie zunaechst in der Dokumentation nach, bevor Sie ein Faxsystem mit HylaFax installieren. 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 if [ "$5" != "" ]; then PHONEMATCH=$5\$ USERENTRY=`grep -v "^#" etc/users | grep "$PHONEMATCH"` if [ "$USERENTRY" != "" ]; then USERMAIL=`echo $USERENTRY | awk '{print $1}'` TOADDR="$USERMAIL" fi else TOADDR=bastian@es fi 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. # #echo "f:$FILE d:$DEVICE c:$COMMID m:$MSG t:$TOADDR fm:FaxMaster tf:$TRUNCFILE.pdf" >> /tmp/fax.out if faxrcvd-mail "$FILE" "$DEVICE" "$COMMID" "$MSG" "$TOADDR" FaxMaster "$TRUNCFILE.pdf" | \ /usr/sbin/sendmail $TOADDR; then rm -f $SPOOL/$TRUNCFILE.pdf rm -f $SPOOL/$TRUNCFILE.ps fi --- snap --- --- snip (faxrcvd-mail) --- #! /usr/bin/perl -w # # /var/spool/fax/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: Fax Assistent < $fromaddr > To: Empfaenger < $toaddr > Subject: Neues FAX von $info{sender} am $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 Es wurde nicht das gesamte Dokument empfangen, weil: $msg EOF ; } if( open(IN, "<log/c$commid") ) { print <<EOF ---- Mitschnitt der Uebertragung folgt ---- EOF ; print while(<IN>); close(IN); } print <<EOF --$boundary Content-Type: application/pdf; name="FAX_von_$info{sender}_vom_$info{received}.pdf" Content-Description: FAX_von_$info{sender}_vom_$info{received} Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="FAX_von_$info{sender}_von_$info{received}.pdf" EOF ; open(IN, "mimencode $pdffile |") || die ("Fehler beim Kodieren von $pdffile: $!"); print while(<IN>); close(IN) || die("mimeencode: $?"); print <<EOF --$boundary-- EOF --- snap --- Viele Grüße Bastian