Rebuilt win.amd64 against r3658 (new compiler, xp64/w2k3 not support any more; new...
[kbuild-mirror.git] / src / oldsed / testsuite / distrib.sh
blobdbadbdcf7bf47275b04669df5a07e239a6043dc8
1 #! /bin/sh
3 # This is stolen from C News
4 #
8 # All this does is massage the headers so they look like what news
9 # software expects. To:, Cc: and Resent-*: headers are masked.
10 # Reply-To: is turned into references, which is questionable (could
11 # just as well be dropped.
13 # The From: line is rewritten to use the "address (comments)" form
14 # instead of "phrase <route>" form our mailer uses. Also, addresses
15 # with no "@domainname" are assumed to originate locally, and so are
16 # given a domain.
18 # The Sender: field below reflects the address of the person who
19 # maintains our mailing lists. The Approved: field is in a special
20 # form, so that we can do bidirectional gatewaying. Any message
21 # in a newsgroup that bears this stamp will not be fed into the
22 # matching mailing list.
24 sed=${1-sed}
26 $sed -n -e "1{i\\
27 Path: mailnewsgateway
28 }" \
29 -e ":a
30 /^[Rr]eceived:/b r
31 /^[Nn]ewsgroups:/b r
32 /^[Pp]ath:/b r
33 /^[Tt][Oo]:/s/^/Original-/
34 /^[Cc][Cc]:/s/^/Original-/
35 /^[Rr][Ee][Ss][Ee][Nn][Tt]-.*/s/^/Original-/
36 /^[Mm][Ee][Ss][Ss][Aa][Gg][Ee]-[Ii][Dd]:/s/@/.alt.buddha.fat.short.guy@/
37 s/^[Ii]n-[Rr]eply-[Tt]o:/References:/
38 /^From:/{
39 s/<\([^@]*\)>\$/<\1@$thissite>/
40 s/^From:[ ][ ]*\(.*\) *<\(.*\)>\$/From: \2 (\1)/
42 s/-[Ii]d:/-ID:/
43 s/^[Ss][Uu][Bb][Jj][Ee][Cc][Tt]:[ ]*$/Subject: (none)/
44 s/^\([^:]*:\)[ ]*/\1 /
45 /^\$/{i\\
46 Newsgroups: alt.buddha.short.fat.guy\\
47 Distribution: world\\
48 Sender: news@cygnus.com\\
49 Approved: alt.buddha.short.fat.guy@cygnus.com
50 b e
54 b a
56 s/.*//g
58 /^[ ]/b r
59 b a
63 b e"