home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / mail / misc / 4264 < prev    next >
Encoding:
Text File  |  1993-01-06  |  2.3 KB  |  75 lines

  1. Newsgroups: comp.mail.misc
  2. Path: sparky!uunet!sybus.sybus.com!myrddin!tct!chip
  3. From: chip@tct.com (Chip Salzenberg)
  4. Subject: Re: deliver program option -n
  5. Message-ID: <2B4B211C.8BCB@tct.com>
  6. Date: Wed, 6 Jan 1993 18:12:44 GMT
  7. References: <1993Jan5.211312.14560@progress.com>
  8. Organization: TC Telemanagement, Clearwater, FL
  9. Lines: 64
  10.  
  11. According to tucker@bedford.progress.COM:
  12. >I am working with the deliver program and have -n option being used in
  13. >the following deliver.sys:
  14. >
  15. >case $1 in
  16. >address)
  17. >        set -x
  18. >        SUBJECT=`grep "^Subject:" $HEADER`
  19. >        cat $HEADER $BODY | /usr/local/bin/deliver -vn tucker
  20. >        mailx -s "Re: $SUBJECT" $SENDER << XXX
  21. >Your mail regarding $SUBJECT has been forwarded to the proper person.
  22. >;;
  23. >esac
  24.  
  25. Mistake #1: deliver.sys may be called with several addresses, so you
  26. need a loop.  Mistake #2: if you want tucker's ".deliver" executed,
  27. you should just output "tucker" and let the parent Deliver handle it.
  28. So the code should be more like:
  29.  
  30. ================================================================
  31.  
  32. FWD=
  33.  
  34. for u
  35. do
  36.     case "$u" in
  37.     address1) echo "tucker"; FWD=yes ;;
  38.     address2) echo "someone"; FWD=yes ;;
  39.     address3) echo "otherone"; FWD=yes ;;
  40.     *)        echo "$u"    ;;
  41.     esac
  42. done
  43.  
  44. if test -n "$FWD"
  45. then
  46.     SUBJECT="`header -f subject $HEADER`"
  47.     mailx -s "Re: $SUBJECT" $SENDER << XXX
  48. Your mail regarding:
  49.    $SUBJECT
  50. has been forwarded to the proper person(s).
  51. XXX
  52. fi
  53.  
  54. ================================================================
  55.  
  56. >This is not using aliases as one would think -n would. As it is working, it
  57. >seems to just what -b would.
  58.  
  59. Deliver never uses aliases.  It executes delivery files.  And "-n"
  60. does just what the man page says it does: avoid all delivery files.
  61.  
  62. >Also, in the -v output below, what is the system delivery file disabled
  63. >line doing?
  64. >
  65. >found system delivery file /usr/local/lib/deliver.sys
  66. >system delivery file disabled
  67.  
  68. It's doing what you asked for when you used the "-n" option: finding
  69. but skipping the system delivery file.
  70. -- 
  71. Chip Salzenberg at Teltronics/TCT  <chip@tct.com>, <73717.366@compuserve.com>
  72.   "you make me want to break the laws of time and space / you make me
  73.    want to eat pork / you make me want to staple bagels to my face /
  74.    and remove them with a pitchfork" -- Weird Al Yankovic, "You Make Me"
  75.