/usr/share/doc/hylafax-client/faxmail/mailfax.sh-smail is in hylafax-client 3:6.0.6-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #!/bin/bash
#
# mailfax - email to fax gateway for smail3.1.
#
# This file should be installed as /usr/local/bin/mailfax, and the
# following changes made to the smail configuration:
#
# Add the following to /usr/local/lib/smail/transports:
# fax: driver=pipe, local;
# pipe_as_sender, cmd="/usr/local/bin/mailfax"
#
# Add the following at the start of /usr/local/lib/smail/routers:
# fax: driver=queryprogram, transport=fax;
# cmd="/usr/bin/expr ${lc:host} : '.*\.fax$'"
#
# If you do not already have a routers file, you *must* create one
# with the default routing info, included below:
# inet_addrs: driver=gethostbyaddr, transport=smtp;
# fail_if_error, check_for_local,
# inet_hosts: driver=gethostbyname, transport=smtp;
# -required, -domain, -only_local_domain,
# paths: driver=pathalias, transport=uux;
# file=paths, proto=bsearch, optional, -required, domain=uucp,
# uucp_neighbors: driver=uuname, transport=uux;
# cmd=/usr/bin/uuname, domain=uucp,
# smart_host: driver=smarthost, transport=uux;
# -path,
#
# Note: I'm not a smail expert; this file is the result of a couple
# of hours of experimentation. Rick Lyons.
TMPVAR=${SENDER//\`/}
TMPVAR=${TMPVAR//\$\(/}
SENDER=${TMPVAR//\(/}
TMPVAR=${ADDR//\`/}
TMPVAR=${TMPVAR//\$\(/}
ADDR=${TMPVAR//\(/}
TMPVAR=${PRIMARY_NAME//\`/}
TMPVAR=${TMPVAR//\$\(/}
PRIMARY_NAME=${TMPVAR//\(/}
/usr/local/bin/faxmail | /usr/local/bin/sendfax -n -d \
"`/usr/bin/expr \"$ADDR\" : '\(.*\)\.fax$'`" -f "$SENDER@$PRIMARY_NAME"
|