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