home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / sed-3.02 / testsuite / distrib.sed < prev    next >
Text File  |  1995-12-26  |  1KB  |  58 lines

  1. #   This is straight out of C News
  2. #
  3. #
  4. # All this does is massage the headers so they look like what news
  5. # software expects.  To:, Cc: and Resent-*: headers are masked.
  6. # Reply-To: is turned into references, which is questionable (could
  7. # just as well be dropped.
  8. #
  9. # The From: line is rewritten to use the "address (comments)" form
  10. # instead of "phrase <route>" form our mailer uses.  Also, addresses
  11. # with no "@domainname" are assumed to originate locally, and so are
  12. # given a domain.
  13. #
  14. # The Sender: field below reflects the address of the person who
  15. # maintains our mailing lists.  The Approved: field is in a special
  16. # form, so that we can do bidirectional gatewaying.  Any message
  17. # in a newsgroup that bears this stamp will not be fed into the
  18. # matching mailing list.
  19. 1{i\\
  20. Path: $path
  21. }
  22.  
  23. :a
  24. /^[Rr]eceived:/b r
  25. /^[Nn]ewsgroups:/b r
  26. /^[Pp]ath:/b r
  27. /^[Tt][Oo]:/s/^/Original-/
  28. /^[Cc][Cc]:/s/^/Original-/
  29. /^[Rr][Ee][Ss][Ee][Nn][Tt]-.*/s/^/Original-/
  30. /^[Mm][Ee][Ss][Ss][Aa][Gg][Ee]-[Ii][Dd]:/s/@/.$newsgroup@/
  31. s/^[Ii]n-[Rr]eply-[Tt]o:/References:/
  32. /^From:/{
  33.     s/<\([^@]*\)>\$/<\1@$thissite>/
  34.     s/^From:[     ][    ]*\(.*\)  *<\(.*\)>\$/From: \2 (\1)/
  35.     }
  36. s/-[Ii]d:/-ID:/
  37. s/^[Ss][Uu][Bb][Jj][Ee][Cc][Tt]:[     ]*$/Subject: (none)/
  38. s/^\([^:]*:\)[     ]*/\1 /
  39. /^\$/{i\\
  40.     Newsgroups: $newsgroup\\
  41.     Distribution: $distribution\\
  42.     Sender: $admin@$thissite\\
  43.     Approved: $newsgroup@cygnus.com
  44.     b e
  45. }
  46. p
  47. n
  48. b a
  49. :r
  50. s/.*//g
  51. n
  52. /^[     ]/b r
  53. b a
  54. :e
  55. p
  56. n
  57. b e
  58.