home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk1.iso / altsrc / articles / 11413 / adcomplain
Text File  |  1994-11-01  |  3KB  |  96 lines

  1. #!/bin/csh
  2.  
  3. ## adcomplain V2.0   13-Oct-94
  4. ## Bill McFadden
  5.  
  6. ## Composes and mails a complaint about inappropriate commercial use of
  7. ## Usenet.
  8.  
  9. ## This was written in the belief that a single, concise message to the
  10. ## offending poster is the most appropriate way to complain.  A message to
  11. ## his or her postmaster may also be warranted if the originating site
  12. ## prohibits such postings.  Mail bombing (e-mailing megabytes of useless
  13. ## data) and public flaming (replying on Usenet, causing your complaint to be
  14. ## duplicated on every machine in the network) are discouraged.
  15.  
  16. ## Arguments:
  17. ##   $1 subject
  18. ##   $2 newsgroup
  19. ##   $3 poster
  20.  
  21. ## For rn, trn, and strn users, the following macros in your .rnmac file will
  22. ## run this script when the 'a' (or 'A') key is pressed:
  23. ##
  24. ## a %(%m=[pa]?|adcomplain '%s ' %C %t\n:a)
  25. ## A %(%m=[pa]?|adcomplain "%s " %C %t\n:A)
  26. ##
  27. ## Note: The first macro breaks if subject line contains the ' character.  If
  28. ## this occurs, use the second macro.
  29.  
  30. set dest = /tmp/$user-$$
  31.  
  32. echo "I object to the posting of commercial advertisements to $2." >$dest
  33. echo "My site must pay to receive, store, and transmit your" >>$dest
  34. echo "message." >>$dest
  35.  
  36. echo -n "Is $1relevant to $2? [yn] "
  37. set ans = "`head -1 </dev/tty`"
  38. if ($ans == n) echo "In addition, $1has nothing to do with $2." >>$dest
  39.  
  40. echo "" >>$dest
  41. echo "The biz.* newsgroup hierarchy is the appropriate place for" >>$dest
  42. echo "commercial postings." >>$dest
  43. echo "For more information about Usenet etiquette, see" >>$dest
  44. echo "news.announce.newusers.  Thanks." >>$dest
  45. echo "" >>$dest
  46.  
  47. ## reformat message text
  48. fmt -78 $dest >$dest-1
  49. rm $dest
  50. mv $dest-1 $dest
  51.  
  52. ## determine postmaster's email address
  53. cat >$dest-1
  54. set postmaster = `echo $3 | sed 's/.*\(@.*\)/\1/'`
  55. set postmaster = postmaster$postmaster
  56. echo -n "Mail a copy to $postmaster? [ny] "
  57. set ans = "`head -1 </dev/tty`"
  58. if ($ans == y) then
  59.     echo "--------forwarded message--------" >>$dest
  60.     cat $dest-1 >>$dest
  61.     echo "-----end of forwarded message-----" >>$dest
  62.     echo "" >>$dest
  63. endif
  64. rm $dest-1
  65.  
  66. ## Remove the following section if your mailer automatically adds your
  67. ## signature
  68.  
  69. if (-e $HOME/.signature) then
  70.     echo "--" >>$dest
  71.     cat $HOME/.signature >>$dest
  72. endif
  73.  
  74. ## print copy of message on user's terminal
  75. echo "" >>$dest-1
  76. echo "To: $3" >>$dest-1
  77. if ($ans == y) echo "cc: $postmaster" >>$dest-1
  78. echo "Subject: $1" >>$dest-1
  79. echo "" >>$dest-1
  80. cat $dest >>$dest-1
  81. echo "" >>$dest-1
  82. more <$dest-1
  83. rm $dest-1
  84. if ($ans == y) echo "~c $postmaster" >>$dest
  85.  
  86. echo -n "Send it? [ny] "
  87. set ans = "`head -1 </dev/tty`"
  88. if ($ans == y) then
  89.     mail -s "$1" $3 <$dest
  90.     echo "done"
  91. else
  92.     echo "aborted"
  93. endif
  94. echo ""
  95. rm $dest
  96.