From owner-freebsd-questions Tue Feb 18 0:34:50 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 66FB137B401 for ; Tue, 18 Feb 2003 00:34:48 -0800 (PST) Received: from bebop.inter-sonic.com (bebop.inter-sonic.com [212.247.185.185]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3503543F93 for ; Tue, 18 Feb 2003 00:34:47 -0800 (PST) (envelope-from peo@intersonic.se) Message-ID: <3E51F020.3040205@intersonic.se> Date: Tue, 18 Feb 2003 09:34:40 +0100 From: "Per olof Ljungmark" Organization: Intersonic AB User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: faxrcvd problem solved THANKS, now next (long) Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-100.7 required=5.7 tests=NOSPAM_INC,SPAM_PHRASE_00_01,USER_AGENT, USER_AGENT_MOZILLA_UA,USER_IN_WHITELIST,X_ACCEPT_LANG version=2.44 X-Spam-Level: X-Sanitizer: bebop mail filter Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thanks to you kind people on the list I learned how to debug and fix the bin/faxrcvd script with Hylafax. The solution was to use "/usr/local/bin/ps2pdfwr" instead of /usr/local/bin/ps2pdf. Apparently some enviroment info got lost during script execution, something that I think I've seen before with scripts written under Linux and then used with FreeBSD? Now the next one: We want to use a script from http://www.purpel3.com/sambafax/ to extract a fax number from a print through CUPS like: app--->cups--->sambafax script--->sendfax The problem here seems to be a mysterious "permission denied" error that can be seen in the CUPS error log below (which is probably going to look weird). A tmpfile is created ok then not much more happens. Then follows a stripped version of the script with just the necessary parts. CUPS log: [18/Feb/2003:09:28:32 +0100] [Job 192] FAXNUM=`${FAXFILE} | ${AWK} '{ IGNORECASE=1 } /FAX-Nr ?: ?[0-9-]*/ \ D [18/Feb/2003:09:28:32 +0100] [Job 192] { $0=$0 "xxx"; \ D [18/Feb/2003:09:28:32 +0100] [Job 192] gsub(/-/,""); \ D [18/Feb/2003:09:28:32 +0100] [Job 192] anfang=match($0,/ ?: ?/); \ D [18/Feb/2003:09:28:32 +0100] [Job 192] anfang=anfang+match(substr($0,anfang),/[0-9]/)-1; \ D [18/Feb/2003:09:28:32 +0100] [Job 192] ende=match(substr($0,anfang),/[^0-9]/)-1; \ D [18/Feb/2003:09:28:32 +0100] [Job 192] printf ("%s",substr($0,anfang,ende)) \ D [18/Feb/2003:09:28:32 +0100] [Job 192] }'` D [18/Feb/2003:09:28:32 +0100] [Job 192] + /tmp/sambafax/sambafax.87654+ /usr/local/bin/gawk D [18/Feb/2003:09:28:32 +0100] [Job 192] { IGNORECASE=1 } /FAX-Nr ?: ?[0-9-]*/ { $0=$0 "xxx"; gsub(/-/,""); /usr/local/libexec/cups/backend/sambafax.cups: /tmp/sambafax/sambafax.87654: permission denied D [18/Feb/2003:09:28:32 +0100] [Job 192] 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)) } D [18/Feb/2003:09:28:32 +0100] [Job 192] + FAXNUM= D [18/Feb/2003:09:28:32 +0100] [Job 192] if [ "${FAXNUM}" = "" ] ; then D [18/Feb/2003:09:28:32 +0100] [Job 192] echo "Please correct and retry" Script to extract fax number: #!/bin/sh -xv SENDMAIL="/usr/sbin/sendmail" AWK="/usr/local/bin/gawk" SENDFAX="/usr/local/bin/sendfax" umask 000; FAXFILE=/tmp/sambafax/sambafax.$$ cat >${FAXFILE} # this comes from the pipe (local mission) cat $6 >>${FAXFILE} # or this comes from samba as a file FAXNUM=`${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 [ "${FAXNUM}" = "" ] ; then echo "Please correct and retry" else ${SENDFAX} -n -D -f ${MailTo} -d ${FAXNUM} ${FAXFILE} fi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message