1 --- mgetty-1.1.30.old/samples/new_fax.mime4 1999-04-17 06:38:50.000000000 -0400
2 +++ mgetty-1.1.30/samples/new_fax.mime4 2003-07-01 23:45:07.000000000 -0400
4 PATH=/usr/sbin:/usr/local/bin:/usr/bin:/bin:$PATH
6 # Select image type by uncommenting one of the following lines:
7 -#PBMTOX=pnmtopng ; MIME_TYPE="image/png" ; FILE_EXTN=png
8 -PBMTOX=ppmtogif ; MIME_TYPE="image/gif" ; FILE_EXTN=gif
9 +PBMTOX=pnmtopng ; MIME_TYPE="image/png" ; FILE_EXTN=png
10 +#PBMTOX=ppmtogif ; MIME_TYPE="image/gif" ; FILE_EXTN=gif
11 #PBMTOX=pnmtotiff ; MIME_TYPE="image/tiff" ; FILE_EXTN=tif
12 # PBM files may be huge
13 #PBMTOX=cat ; MIME_TYPE="image/x-portable-bitmap" ; FILE_EXTN=pbm
14 # compressed PBM files
15 #PBMTOX=gzip ; MIME_TYPE="application/octet-stream"; FILE_EXTN=pbm.gz
16 +#PBMTOX=NONE ; MIME_TYPE="image/fax-g3"; FILE_EXTN=g3
18 # The binaries we need; please check carefully !!!
22 # Some miscellaneous data and filenames.
24 -MAIL_MESS=$TMP/MESS_$$
25 -ERRO_MESS=$TMP/ERRO_$$
26 -IMAG_FILE=$TMP/TIFF_$$
27 -MIME_MESS=$TMP/MAIL_$$
28 +MAIL_MESS=`/bin/tempfile -pMESS_`
29 +ERRO_MESS=`/bin/tempfile -pERRO_`
30 +IMAG_FILE=`/bin/tempfile -pTIFF_`
31 +MIME_MESS=`/bin/tempfile -pMAIL_`
32 +if [ ! -f $MAIL_MESS ] ||\
33 + [ ! -f $ERRO_MESS ] ||\
34 + [ ! -f $IMAG_FILE ] ||\
37 + echo "Could not create one of the temporary files. Aborting...";
43 # Clean up from previous invocations and trap errors
44 -$RM -f $MAIL_MESS $ERRO_MESS $IMAG_FILE $MIME_MESS
45 +# $RM -f $MAIL_MESS $ERRO_MESS $IMAG_FILE $MIME_MESS
46 trap "$RM -f $MAIL_MESS $ERRO_MESS $IMAG_FILE $MIME_MESS; exit" 0 1 2 15
48 # Essential lines to put into the header of a MIME mail.
50 ATTACHMENT_ENDLINE="--attachment--"
52 # Now we build our MIME mailheader using commandline arguments.
53 -$ECHO "Subject: incoming FAX from $2 with $3 pages" > $MAIL_MESS
54 +$ECHO "Subject: incoming FAX from $2 with $3 pages" >> $MAIL_MESS
55 $ECHO "$HEADERLINE_1" >> $MAIL_MESS
56 $ECHO "$HEADERLINE_2" >> $MAIL_MESS
57 $ECHO "" >> $MAIL_MESS
62 +if [ "$PBMTOX" = "NONE" ]; then
65 # We use the second character in the filename to identify the
66 # resolution of our incoming fax, so we can easily scale the fax for
67 # display on a screen.
69 # handle standard input correctly.
70 $CAT $i 2>> $ERRO_MESS \
71 | $G3TOPBM $STRETCH 2>> $ERRO_MESS \
72 - | $PBMTOX >> $IMAG_FILE 2>> $ERRO_MESS
73 + | $PBMTOX > $IMAG_FILE 2>> $ERRO_MESS
76 # Now we put the header for each attachment into our MIME mail.
77 $ECHO "$ATTACHMENT_HEADERLINE_1" >> $MIME_MESS