Chandlog since HylaFAX 4.3.1
+* Simplify/Unify mime encoder selection and use (9 Jan 2007)
* Add the Include: option for Config file options (8 Jan 2007)
* Redirected unwanted output from pd2pdf while running notify (24 Dec 2006)
* Use @SCRIPT_SH@ for bin/ scripts to allow configure selection (23 Dec 2006)
#
# Check for email encoders.
#
-test "$UUENCODE" || {
- UUENCODE=`findAppDef uuencode $PATH uuencode`
-}
-test -x "$UUENCODE" && Note "Found uuencode encoder: $UUENCODE"
-
-if [ -z "$BASE64ENCODE" ]; then
- # Use suggested $MIMENCODE for compatibility with earlier versions:
- BASE64ENCODE=$MIMENCODE;
-fi
-test "$BASE64ENCODE" || {
- BASE64ENCODE=`findAppDef mimencode $PATH mimencode`
- test -x $BASE64ENCODE || {
- BASE64ENCODE=`findAppDef base64-encode $PATH base64-encode`
- if [ -x "$UUENCODE" ]; then
- if capture "$UUENCODE -m port.h foo"; then
- BASE64ENCODE="$UUENCODE -m ===="
- fi
- fi
- }
-}
-test -n "$BASE64ENCODE" && Note "Found base64 encoder: $BASE64ENCODE"
-
-test "$QPENCODE" || {
- cmd=`findAppDef mimencode $PATH mimencode`
- QPENCODE="$cmd -q"
- test -x $cmd || {
- QPENCODE=`findAppDef qp-encode $PATH qp-encode`
- }
-}
-test -n "$QPENCODE" && Note "Found Quoted-Printable encoder: $QPENCODE"
-
-# Keeping $MIMENCODE up to date for older scripts...
-test "$MIMENCODE" || MIMENCODE=$BASE64ENCODE
-
-if [ -z "$ENCODING" ]; then
- if [ -n "$BASE64ENCODE" ]; then
- ENCODING=base64
- Note "Looks like $MIMENCODE supports base64 encoding."
- elif [ -n "$UUENCODE" ]; then
- ENCODING=x-uuencode
- Note "Looks like $UUENCODE does not support base64 encoding."
- fi
-fi
+test -n "$UUENCODE" && Note "Using uuencode encoder: $UUENCODE"
+test -n "$BASE64ENCODE" && Note "Using base64 encoder: $BASE64ENCODE"
+test -n "$QPENCODE" && Note "Using Quoted-Printable encoder: $QPENCODE"
+test -n "$MIMENCODE" && Note "Using mimencode for compatibility: $QPENCODE"
#
# Pick install mechanism.
test -d /usr/local/bin && PATH=$PATH:/usr/local/bin # for GNU tools
AWK=@AWK@ # awk for use below
-BASE64ENCODE=@BASE64ENCODE@ # base64encode command to dump in setup.cache
CAT=@CAT@ # cat command for use below
CHARSET=@CHARSET@ # character set to use in e-mails
CHGRP=@CHGRP@ # change file group for use below
GREP=@GREP@ # grep command for use below
LN=@LN@ # ln command for use below
LN_S=@LN_S@ # ln option for creating a symbolic link
-MIMENCODE=@MIMENCODE@ # mimencode command to dump in setup.cache
MKFIFO=@MKFIFO@ # FIFO creation program for use below
MV=@MV@ # move file for use below
-QPENCODE=@QPENCODE@ # qpencode command to dump in setup.cache
RMCMD=@RM@ # remove file for use below
SCRIPT_SH=@SCRIPT_SH@ # shell for use below
SED=@SED@ # sed for use below
TIFF2PDF=@TIFF2PDF@ # tiff-to-pdf conversion tool
TTYCMD=@TTYCMD@ # tty for error output
-UUENCODE=@UUENCODE@ # uuencode command to dump in setup.cache
+
+BASE64ENCODE="@BASE64ENCODE@" # base64encode command to dump in setup.cache
+MIMENCODE="@MIMENCODE@" # mimeencode command to dump in setup.cache for old notifys
+QPENCODE="@QPENCODE@" # qpencode command to dump in setup.cache
+UUENCODE="@UUENCODE@" # uuencode command to dump in setup.cache
FAX=@FAXUID@ # identity of the fax user
SERVICES=/etc/services # location of services database
test -x "$UUENCODE" && Note "Found uuencode encoder: $UUENCODE"
}
-if [ -z "$BASE64ENCODE" ]; then
- # Keep configured base64 encoder for upgrades from earlier versions:
- BASE64ENCODE=$MIMENCODE;
-fi
# $BASE64ENCODE may contain parameters
-cmd=`echo $BASE64ENCODE | $SED -e "s/^ *//" -e "s/ .*$//"`
+cmd=`echo "$BASE64ENCODE" | $SED -e "s/^ *//" -e "s/ .*$//"`
test -x "$cmd" || {
BASE64ENCODE=`findAppDef mimencode $PATH mimencode`
test -x $BASE64ENCODE || {
test -x $BASE64ENCODE || {
if [ -x "$UUENCODE" ]; then
if capture "$UUENCODE -m $PASSWD foo"; then
- BASE64ENCODE="$UUENCODE -m ===="
+ BASE64ENCODE="$UUENCODE -m ==== | $GREP -v ===="
fi
fi
}
}
- test -n "$BASE64ENCODE" && Note "Found base64 encoder: $BASE64ENCODE"
}
+test -n "$BASE64ENCODE" && Note "Found base64 encoder: $BASE64ENCODE"
# $QPENCODE may contain parameters
cmd=`echo $QPENCODE | $SED -e "s/^ *//" -e "s/ .*$//"`
test -x $cmd || {
QPENCODE=`findAppDef qp-encode $PATH qp-encode`
}
- test -n "$QPENCODE" && Note "Found Quoted-Printable encoder: $QPENCODE"
}
-
-# Keeping $MIMENCODE up to date for older scripts...
-test -x "$MIMENCODE" || MIMENCODE=$BASE64ENCODE
+test -n "$QPENCODE" && Note "Found Quoted-Printable encoder: $QPENCODE"
if [ -n "$BASE64ENCODE" ]; then
if [ "$ENCODING" != "base64" ]; then
fi
fi
+# $MIMENCODE may contain parameters
+cmd=`echo "$MIMENCODE" | $SED -e "s/^ *//" -e "s/ .*$//"`
+test -x "$cmd" || {
+ MIMENCODE=`findAppDef mimencode $PATH mimencode`
+}
+test -n "$MIMENCODE" && Note "Found mimencode for compatibilty: $MIMENCODE"
+
+
RM="$RMCMD -f" # remove file for use below
#
eval "$AWK_OUTPUT"
}
+programOfCommand()
+{
+ echo "$*" | $SED -e -'s/^ *//' -e 's/ .*$//'
+}
+
#
# Produce mailable encoding for binary files.
# mimeEncode(filename, encoding)
fi
encoding=`echo $encoding | $SED -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
- # Configuration for which faxsetup was not rerun contains $MIMENCODE
# rather than separate $BASE64ENCODE and $QPENCODE
case "$encoding" in
base64)
if [ -n "$BASE64ENCODE" ]; then
+
# $BASE64ENCODE may contain parameters
- cmd=`echo $BASE64ENCODE | $SED -e "s/^ *//" -e "s/ .*$//"`
+ cmd=`programOfCommand $BASE64ENCODE`
if [ -x "$cmd" ]; then
- ($BASE64ENCODE < $1 \
- | $GREP -v "====$") \
- 2>$ERRORSTO
+ $BASE64ENCODE < $1 2>$ERRORSTO
fi
- # For compatibility with earlier configurations:
- elif [ -x "$MIMENCODE" ]; then
- $MIMENCODE < $1 2>$ERRORSTO
- elif [ -x "$UUENCODE" ]; then
- ($UUENCODE -m ==== < $1 \
- | $GREP -v "====$") \
- 2>$ERRORSTO
+ else
+ $AWK -f bin/b64-encode.awk < $1 2>$ERRORSTO
fi;;
quoted-printable)
if [ -n "$QPENCODE" ]; then
# $QPENCODE may contain parameters
- cmd=`echo $QPENCODE | $SED -e "s/^ *//" -e "s/ .*$//"`
+ cmd=`programOfCommand $QPENCODE`
if [ -x "$cmd" ]; then
$QPENCODE < $1 2>$ERRORSTO
fi
- # For compatibility with earlier configurations:
- elif [ -x "$MIMENCODE" ]; then
- # Take a chance that $MIMENCODE really contains mimencode
- $MIMENCODE -q < $1 2>$ERRORSTO
+ else
+ $AWK -f bin/qp-encode.awk < $1 2>$ERRORSTO
fi;;
*uue*)
if [ -x "$UUENCODE" ]; then
# didn't re-run faxsetup; we set them before calling setup.cache for
# backward compatibility.
ENCODING=base64
-MIMENCODE=mimencode
TIFF2PDF=bin/tiff2pdf
TTYCMD=tty
CHARSET=us-ascii
# didn't re-run faxsetup; we set them before calling setup.cache for
# backward compatibility.
ENCODING=base64
-MIMENCODE=mimencode
TIFF2PDF=bin/tiff2pdf
TTYCMD=tty
CHARSET=us-ascii
# didn't re-run faxsetup; we set them before calling setup.cache for
# backward compatibility.
ENCODING=base64
-MIMENCODE=mimencode
TIFF2PDF=bin/tiff2pdf
TTYCMD=tty
CHARSET=us-ascii
# didn't re-run faxsetup; we set them before calling setup.cache for
# backward compatibility.
ENCODING=base64
-MIMENCODE=mimencode
TTYCMD=tty
. etc/setup.cache