mailfax.sh-smail
上传用户:weiyuanprp
上传日期:2020-05-20
资源大小:1169k
文件大小:2k
源码类别:

传真(Fax)编程

开发平台:

C/C++

  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. TMPVAR=${SENDER//`/}
  32. TMPVAR=${TMPVAR//$(/}
  33. SENDER=${TMPVAR//(/}
  34. TMPVAR=${ADDR//`/}
  35. TMPVAR=${TMPVAR//$(/}
  36. ADDR=${TMPVAR//(/}
  37. TMPVAR=${PRIMARY_NAME//`/}
  38. TMPVAR=${TMPVAR//$(/}
  39. PRIMARY_NAME=${TMPVAR//(/}
  40. /usr/local/bin/faxmail | /usr/local/bin/sendfax -n -d 
  41.         "`/usr/bin/expr "$ADDR" : '(.*).fax$'`" -f "$SENDER@$PRIMARY_NAME"